Skip to content

Latest commit

 

History

History
95 lines (64 loc) · 4.86 KB

File metadata and controls

95 lines (64 loc) · 4.86 KB
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.

Prerequisites

Connect to Azure

Sign in to your Azure account by using the Connect-AzAccount command and following the prompt:

Connect-AzAccount

Create a resource group

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 your App Service plan

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 your web app

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 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 ContainerImageName parameter specifies a container image name and optional tag.

The command might take a few minutes to finish.

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-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.

Clean up resources

Remove the resource group by using the Remove-AzResourceGroup command:

Remove-AzResourceGroup myResourceGroup

Related content