Skip to content

Instantly share code, notes, and snippets.

@ErikHen
Created November 22, 2017 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErikHen/2566ab67002ea16c940eba77aca97adc to your computer and use it in GitHub Desktop.
Save ErikHen/2566ab67002ea16c940eba77aca97adc to your computer and use it in GitHub Desktop.
Import-Module "D:\home\site\wwwroot\ScaleDownDevEnvironments\LoginToAzure.ps1"
Import-Module "D:\home\site\wwwroot\ScaleDownDevEnvironments\NotifySlack.ps1"
Login
#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
NotifySlack -message "Dev. environment is scaled down. Time to stop coding..." -channel "#myslackchannel" -webhookurl "https://hooks.slack.com/services/XXXXXXX/xxxxxx"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment