Murugesh
Murugesh

Reputation: 1001

Azure WebApp - Unable to auto-detect the runtime stack of your app

I'm trying to create Web App which is just having a Static HTML. I'm following this link https://learn.microsoft.com/en-us/azure/app-service/app-service-web-get-started-html. But when I execute the following command

az webapp up --location westeurope --name .

Got the error - " Could not auto-detect the runtime stack of your app" .

Upvotes: 9

Views: 6292

Answers (8)

Kilo zolo
Kilo zolo

Reputation: 11

To overcome this error you will need to:

cd {directory}
pip freeze > requirements.txt

The file does not need to have anything just needs to exist as azure looks for the files presence when running the deployment

Upvotes: 1

C Raghava
C Raghava

Reputation: 9

at end of az webapp command you have give run time stack if you are using an html page then --html you must give

Ex: az webapp up --location westeurope --name az204samplewebapphtml1 --html

Upvotes: 0

EZE ARINZE
EZE ARINZE

Reputation: 13

Make sure you're running the command "az webapp up --location westeurope --name" from your application root, ie inside 'html-docs-hello-world' folder.

Upvotes: 0

Mohamed Sahbi
Mohamed Sahbi

Reputation: 1143

I had the same problem. I solved it by using the flag --html to define explicitly the runtime according to the documentation of the runtime detection. https://github.com/Azure/app-service-linux-docs/blob/master/AzWebAppUP/runtime_detection.md

So, the solution is the following line of code:

az webapp up --location westeurope --name <name> --html

N.B: I used Azure cloud shell.

Upvotes: 0

RonaldB
RonaldB

Reputation: 1190

I tried the following, but added the --html flag at the end of the az webapp up command to bypass auto detection:

mkdir quickstart
cd quickstart
git clone https://github.com/Azure-Samples/html-docs-hello-world.git
cd html-docs-hello-world
az webapp up --location westeurope --name azurewebapptest123 --html

That forces HTML. In the help for the command it implies auto-detection works for a bunch of language, but not for static HTML.

Upvotes: 6

Mohit Verma
Mohit Verma

Reputation: 5294

I have tried the similar steps using the sample repo and was able to reproduce it.

enter image description here

Here is the version:

enter image description here

It's a known bug for Azure CLI 2.0.78 and team is working on it, Which you can track it here:

https://github.com/MicrosoftDocs/azure-docs/issues/43633

Work around of this issue is to use the older version of Azure CLi e.g. 2.0.75 * for deploying the solution.

Hope it helps.

Upvotes: 1

Gaurav Kumar
Gaurav Kumar

Reputation: 156

I just tried following the steps mentioned in the documentation. Works for me.

mkdir quickstart
cd quickstart
git clone https://github.com/Azure-Samples/html-docs-hello-world.git
cd html-docs-hello-world
az webapp up --location westeurope --name azurewebapptest123

Upvotes: 1

Thiago Custodio
Thiago Custodio

Reputation: 18387

Try to manually include a web.config file and/or select the stack on General Settings:

enter image description here

If you have no backend, the best option to host a static site is through Azure Storage:

https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website

Upvotes: 1

Related Questions