Monday, July 31, 2023

Manage Deployment Slots in App Service using Azure CLI

Manage Deployment Slots in App Service using Azure CLI

az 
az -h 

az group list --output table

resource_group=Regroup_5wlAgklxKkjC6
location=westus
plan_name=brezyweather_plan
app_name=brezyweather

az appservice plan create \
--name $plan_name \
--resource-group $resource_group \
--sku S1 \
--is-linux

az appservice plan list --query "[].name"

az webapp create \
--name $app_name \
--plan  $plan_name \
--resource-group $resource_group \
--deployment-container-image-name codewithpraveen/labs-appservice-cli:1.0

az webapp list --output table

az webapp show \
--name $app_name \
--resource-group $resource_group \
--query "defaultHostName"

az webapp deployment slot create \
--name $app_name \
--resource-group $resource_group \
--slot staging

az webapp deployment slot list \
--name $app_name \
--resource-group $resource_group \
--output table

az webapp config container set \
--name $app_name \
--resource-group $resource_group \
--slot staging \
--docker-custom-image-name codewithpraveen/labs-appservice-cli:2.0

az webapp show \
--name $app_name \
--resource-group $resource_group \
--slot staging \
--query "defaultHostName"

az webapp deployment slot swap \
--name $app_name \
--resource-group $resource_group \
--slot staging \
--target-slot production

az resource delete \
--ids $(az resource list --query "[].id" --resource-group $resource_group --output tsv) \
--verbose

az resource list --resource-group $resource_group

Featured Post

Azure OpenAI Chat in C# and Python

Azure OpenAI Chat in C#: // Install the .NET library via NuGet: dotnet add package Azure.AI.OpenAI --version 1.0.0-beta.5   using System; u...

Popular posts