Question:
You're building an ASP.NET Core Linux application utilizing Azure App Service Web App for Containers. You aim to deploy the application in a region in which your company's subscription does not currently have a resource group in there. What are the necessary Azure command-line interface (CLI) commands to deploy the application in that appropriate region?
location="West Europe"
resourceGroup="WEurope"
appServicePlan="WEuropePlan"
appName="AspApp"
containerImage="mcr.microsoft.com/dotnet/samples:aspnetapp"
# Code here
Answer:
location="West Europe"
resourceGroup="WEurope"
appServicePlan="WEuropePlan"
appName="AspApp"
containerImage="mcr.microsoft.com/dotnet/samples:aspnetapp"
# Create a new resource group in the West Europe region
az group create --name $resourceGroup --location "$location"
# Create an App Service plan in the West Europe region
az appservice plan create --name $appServicePlan --resource-group $resourceGroup --location "$location" --is-linux
# Create a web app in the new App Service Plan
az webapp create --name $appName --resource-group $resourceGroup --plan $appServicePlan --deployment-container-image-name $containerImage