| 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.
- An Azure account with an active subscription. Create an account for free.
- The Azure CLI.
Sign in to your Azure account. Use the az login command and follow the prompt:
az loginCreate 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 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 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
Nameparameter specifies the web app name. - The
AppServicePlanparameter specifies the name of the App Service plan. - The
Locationparameter specifies the location. - The
ResourceGroupNameparameter specifies the name of the resource group. - The
deployment-container-image-nameparameter specifies a container image name and optional tag.
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.
Remove the resource group by using the az group delete command:
az group delete --no-wait --name <resource_group>
- Configure a custom container
- How to use managed identities for App Service and Azure Functions
- Application monitoring for Azure App Service overview
- Azure Monitor overview
- Secure with a custom domain and certificate
- Integrate your app with an Azure virtual network
- Use private endpoints for App Service apps
- Use Azure Container Registry with Azure Private Link
- Migrate to a Windows container in Azure
- Deploy a container with Azure Pipelines
- Deploy a container with GitHub Actions