Skip to content

Instantly share code, notes, and snippets.

@staslebedenko
Created February 26, 2020 16:08
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 staslebedenko/8005af0fc4ca6b025403488eb0fe57d7 to your computer and use it in GitHub Desktop.
Save staslebedenko/8005af0fc4ca6b025403488eb0fe57d7 to your computer and use it in GitHub Desktop.
resourceGroup="azureadventcalendar29399"
subscriptionId="03766965-6d6"
actionGroupId="/subscriptions/03766965-6d6/resourceGroups/default-activitylogalerts/providers/microsoft.insights/actionGroups/Admins"
scope='/subscriptions/03766965-6d6/resourceGroups/AzureAdventCalendar29399/providers/Microsoft.Sql/servers/azureadventcalendar29399/databases/azureadventcalendar29399'
desc='Spike detection'
name="SQLServerlessCostAlert"
cpuBilled="total app_cpu_billed > 10000"
az monitor metrics alert create -n $name -g $resourceGroup --scopes $scope --description "Spike detection" \
--condition $cpuBilled --window-size 1h --evaluation-frequency 5m --severity 3 \
--action $actionGroupId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment