Skip to content

Instantly share code, notes, and snippets.

@ErikHen
Created April 3, 2019 19:47
Show Gist options
  • Save ErikHen/2fdf9472421fddcd29913fbe8b47c811 to your computer and use it in GitHub Desktop.
Save ErikHen/2fdf9472421fddcd29913fbe8b47c811 to your computer and use it in GitHub Desktop.
Azure Automation Powershell Runbook that scales Azure resources
.\LoginToAzure.ps1
#scale down web app to "D1 Shared"
Set-AzureRmAppServicePlan -Name "<your sesrvice plan name>" -ResourceGroupName "<your resource group name>" -Tier Shared
#scale down database to "B1 Basic"
Set-AzureRmSqlDatabase -ResourceGroupName "<your resource group name>" -ServerName "<sql server name>" -DatabaseName "<database name>" -Edition Basic
#scale a web app to "B2 Basic"
#Set-AzureRmAppServicePlan -Name "<your sesrvice plan name>" -ResourceGroupName "<your resource group name>" -Tier Basic -WorkerSize Medium
#scale database to "S1 Standard"
#Set-AzureRmSqlDatabase -ResourceGroupName "<your resource group name>" -ServerName "<sql server name>" -DatabaseName "<database name>" -Edition Standard -RequestedServiceObjectiveName "S1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment