| author | msangapu-msft |
|---|---|
| ms.service | azure-app-service |
| ms.devlang | powershell |
| 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). The 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.
- Azure PowerShell.
Sign in to your Azure account by using the Connect-AzAccount command and following the prompt:
Connect-AzAccount
Create a resource group with the New-AzResourceGroup 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 Get-AzLocation command.
New-AzResourceGroup -Name myResourceGroup -Location eastus
The command returns Login Succeeded.
Create a new App Service plan by using the New-AzAppServicePlan command.
The following example creates an App Service plan named myAppServicePlan in the PremiumV3 pricing tier (-Tier PremiumV3). The -HyperV parameter specifies Windows container.
New-AzAppServicePlan -Name myAppServicePlan -Location eastus -ResourceGroupName myResourceGroup -Tier PremiumV3 -HyperV
Create a new app by using the New-AzWebApp command:
New-AzWebApp -Name myWebApp -AppServicePlan myAppServicePlan -Location eastus -ResourceGroupName myResourceGroup -ContainerImageName 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
ContainerImageNameparameter specifies a container image name and optional tag.
The command might take a few minutes to finish.
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-powershell.png" alt-text="Screenshot that shows Windows App Service." lightbox="../../media/quickstart-custom-container/browse-custom-container-windows-powershell.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 Remove-AzResourceGroup command:
Remove-AzResourceGroup myResourceGroup
- 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