Skip to content

Instantly share code, notes, and snippets.

@ErikHen
Last active September 17, 2019 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ErikHen/676c317c9cae87f5dbbe072964b157db to your computer and use it in GitHub Desktop.
Save ErikHen/676c317c9cae87f5dbbe072964b157db to your computer and use it in GitHub Desktop.
PowerShell scale down azure resources
$azurePassword = ConvertTo-SecureString "<your azure portal password>" -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential("<your azure email address>", $azurePassword)
Login-AzureRmAccount -Credential $psCred
#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
#how to scale a web app to "B2 Basic"
#Set-AzureRmAppServicePlan -Name "<your sesrvice plan name>" -ResourceGroupName "<your resource group name>" -Tier Basic -WorkerSize Medium
#how to 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