How will I host a static HTML page on Azure linux web app?

2020-06-17T17:45:00.817+00:00

Hi,
I am quite new in Azure and facing an issue while hosting normal html page on azure web app.
I have a HTML page which I want to host on Azure web app. I need to host this HTML page in a resource group which is under OS Linux and so I ran the below azure cli command but, it failed.

"az webapp up -n surveyordemohtmlpage --html -g MyResource-Group --plan MyPlan -l westeurope"

It was throwing error that MyResource-Group cannot be used with the os windows, use different RG

But, I need to use this particular RG as, I need to connect with other web apps in the same RG which are all hosted in linux OS.

Let me know for any suggestion. How will I change the os to linux in the cli command.

Thanks in advance

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,872 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ryan Hill 25,666 Reputation points Microsoft Employee
    2020-06-18T20:55:47.693+00:00

    Hi @MITRADebarthaGECoreTechCyber-2843,

    The --html flag actually defaults to Windows OS. As a workaround, you can add a package.json file the root directory and remove the --html arg. This will tell the CLI to upload as a nodejs runtime. See https://github.com/Azure/app-service-linux-docs/blob/master/AzWebAppUP/runtime_detection.md for more details or to elect a different runtime other than node.

    I also created a new issue requesting that the --html arg doesn't default to Windows OS where you can add any additional details you like.


  2. Mia Taylor 1 Reputation point
    2020-08-08T01:06:13.053+00:00

    I'm only a bit familiar with your set up as I host my website with Linux also, but I host it using the web hosting company https://lightyearhosting.com/ . It looks like your html flag is directing to your Windows O/S instead of Linux (I'll collaborate if that doesn't make sense). You might want to create a requirements.txt file so that then your server will know to look for Python apps.

    0 comments No comments