English
Français

Blog of Denis VOITURON

for a better .NET world

Deploying in Azure Web App

Posted on 2024-10-28

In the same way as I wrote an article on how to deploy a static website in Azure, it is also possible to deploy a website in a Azure Hosted App Service, using CLI commands.

Azure App Service is a platform as a service (PaaS) offered by Microsoft Azure. It enables developers to rapidly create, deploy and scale web and mobile applications and APIs without worrying about the underlying infrastructure.

Deploying to Azure App Service can be done easily using the command az.

Follow these steps:

  1. Publish your website locally, for example using the command:

    dotnet publish -c Release -o ./bin/Publish -f net8.0
    
  2. Compress the resulting folder into a ZIP file.

    Compress-Archive ./bin/Publish/* ./bin/mysite.zip
    
  3. Once you have downloaded and installed the az command, you will need to sign in to your Azure hosting.

    az account login
    
  4. If you have several Azure subscriptions, please select the one you want.

    az account set --subscription "0cd5a0db-3c55-43ab-8ff0-a88b1886464c"
    
  5. Finally, publish your local (and compressed) website.

    az webapp deploy --resource-group <YourResourceGroup> --name <YourAppServiceName> --src-path ./bin/mysite.zip
    

    YourResourceGroup and YourAppServiceName are displayed on the Overview page of your website in Azure.

Languages

EnglishEnglish
FrenchFrançais

Follow me

Recent posts