Skip to content

Latest commit

 

History

History
104 lines (73 loc) · 5.37 KB

File metadata and controls

104 lines (73 loc) · 5.37 KB
author msangapu-msft
ms.service azure-app-service
ms.devlang azurecli
ms.topic quickstart
ms.date 02/14/2025
ms.author msangapu

In this quickstart, you learn how to deploy an ASP.NET app in a Windows image from Microsoft Artifact Registry to Azure App Service.

Azure App Service provides predefined application stacks on Windows that run on Internet Information Services (IIS). These preconfigured application stacks lock down the operating system and prevent low-level access.

Custom Windows containers don't have these restrictions. Developers can use custom containers to give containerized applications full access to Windows functionality.

Prerequisites

Connect to Azure

Sign in to your Azure account. Use the az login command and follow the prompt:

az login

Create a resource group

Create a resource group by using the az group create command. An Azure resource group is a logical container into which Azure resources are deployed and managed.

The following example creates a resource group named myResourceGroup in the eastus location. To see all supported locations for App Service, run the az appservice list-locations command.

az group create --name myResourceGroup --location eastus

Create your App Service plan

Create an App Service plan in the resource group with the az appservice plan create command.

The following example creates an App Service plan named myAppServicePlan in the P1V3 pricing tier (--sku P1V3).

az appservice plan create --resource-group myResourceGroup --location eastus --name myAppServicePlan --hyper-v --sku p1v3

Note

If you run into the error "The behavior of this command has been altered by the following extension: appservice-kube", remove the appservice-kube extension.

Create your web app

Create a custom container web app in the myAppServicePlan App Service plan with the az webapp create command. Don't forget to replace myContainerApp with a unique app name (valid characters are a-z, 0-9, and -).

az webapp create --name myContainerApp --plan myAppServicePlan --resource-group myResourceGroup --deployment-container-image-name mcr.microsoft.com/azure-app-service/windows/parkingpage:latest
  • The Name parameter specifies the web app name.
  • The AppServicePlan parameter specifies the name of the App Service plan.
  • The Location parameter specifies the location.
  • The ResourceGroupName parameter specifies the name of the resource group.
  • The deployment-container-image-name parameter specifies a container image name and optional tag.

Browse to the app

Browse to the deployed application in your web browser at the URL http://<app-name>.azurewebsites.net.

:::image type="content" source="../../media/quickstart-custom-container/browse-custom-container-windows-cli.png" alt-text="Screenshot that shows Windows App Service." lightbox="../../media/quickstart-custom-container/browse-custom-container-windows-cli.png":::

The App Service app pulls from the container registry each time it starts. If you rebuild your image, push it to your container registry. The app pulls in the updated image when it restarts. To tell your app to pull in the updated image immediately, restart it.

Clean up resources

Remove the resource group by using the az group delete command:

az group delete --no-wait --name <resource_group>

Related content