book1: Design and implement Az App Service Web Apps Flashcards
Create app service plan (PS / CLI)
PS:
> New-AzureRmResourceGroup -Name fooRG -Location foo
> New-AzureRmAppServicePlan -ResourceGroupName fooRG -Name foo -Location “East US” -Tier Free -WorkerSize Small
CLI:
> az group create – location foo –name fooRG
> az appservice plan create –resource-group fooRG –name foo –location eastus –sku P1
New-AzureRmAppServicePlan -Tier ____ (6)
- Free
- Shared
- Basic
- Standard
- Premium (Premium V2)
- Isolated (aka App Service Environment (ASE)
New-AzureRmAppServicePlan -WorkerSize ____ (3)
- Small
- Medium
- Large
- ExtraLarge … available in tool, but not documented…?
az appservice plan create –sku ___ (5)
- F1 (Free),
- D1 (Shared),
- B1, B2, B3 (Basic small, medium, large)
- S1, S2, S3 (Standard)
- P1 | P1V2, P2 | P2V2, P3 | P3V2 (Premium | Premium V2)
- I1, I2, I3 (Isolated) # not currently supported via CLI
Default: B1.
Create web app (PS / CLI)
PS:
> New-AzureRmWebApp -ResourceGroupName fooRG -Location “East US” -AppServicePlan foo -Name foo
CLI:
> az webapp create –resource-group fooRG –plan foo –name foo
Instances & Slots allowed per tier
- Free, Shared: 1 instance, 1 slot
- Basic: 3 instances manually scaled, 1 slot
- Standard: 10 instances, 5 slots
- Premium: 20 instances, 20 slots
- Isolated: 100 instances, ? slots
Get a ref to the prod slot
$productionSite = Get-AzureRmWebAppSlot -ResourceGroupName $resourceGroupName `
-Name $webAppName -Slot $productionSlotName
Create a slot with cloned settings (PS / CLI)
PS:
> New-AzureRmWebAppSlot -ResourceGroupName $resourceGroupName `
-Name $webAppName -Slot $stagingSlotName `
-AppServicePlan $appServicePlanName -SourceWebApp $productionSite
CLI:
> az webapp deployment slot create –resource-group $resourceGroupName \
–name $webAppName –slot $stagingSlotName \
–configuration-source $productionSite
Steps of Multi phase swap
AKA: Swap w/ preview.
- apply destination settings to source
- test source
- if ok, proceed w/ swap of source -> destination
- if not ok, cancel swap operation
update webapp service plan (PS)
Set-AzureRmAppServicePlan -ResourceGroupName fooRG -Name foo-webapp -Tier Standard -WorkerSize Small