Here’s a bit of PowerShell to scale your Azure App Service down to save money. This task could be scheduled to “size down” at night, and “size up” for business hours.
Login-AzureRmAccount $AppServicesJson = @" [ { "ResourceGroupName": "MyAppServiceGroup", "NumberOfWorkers": 1, "AppServiceTier": "Basic", "WorkerSize": "Small" } ] "@; $AppServices = ConvertFrom-Json -InputObject $AppServicesJson $AppServices | ForEach-Object { $AppServicePlan = Get-AzureRmAppServicePlan -ResourceGroupName $_.ResourceGroupName -ErrorAction SilentlyContinue # Expects only one per resource group If ($null -eq $AppServicePlan) { Write-Warning "No AppService Plan found for Resource Group $($_.ResourceGroupName)." } Else { Write-Output "Setting $($AppServicePlan.Name) plan in resource group $($_.ResourceGroupName) to $($_.AppServiceTier) $($_.WorkerSize) with $($_.NumberOfWorkers) worker(s)..." Set-AzureRmAppServicePlan -ResourceGroupName $AppServicePlan.ResourceGroup -Name $AppServicePlan.Name -Tier $_.AppServiceTier -WorkerSize $_.WorkerSize -NumberofWorkers $_.NumberOfWorkers } }
Hope this helps!