Skip to content

Instantly share code, notes, and snippets.

@staslebedenko
Last active February 26, 2020 15:41
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/61efa5f1f83f19de060dc58bed9bc8f7 to your computer and use it in GitHub Desktop.
Save staslebedenko/61efa5f1f83f19de060dc58bed9bc8f7 to your computer and use it in GitHub Desktop.
resourceGroup="AzureDurableDemo14397"
subscriptionId="03766965-6d6"
actionGroupId="/subscriptions/03766965-6d6/resourceGroups/default-activitylogalerts/providers/microsoft.insights/actionGroups/Admins"
scope='/subscriptions/03766965-6d6/resourceGroups/AzureDurableDemo14397/providers/Microsoft.Web/sites/azuredurabledemo14397'
desc='Spike detection 10 GBsec or 5000 requests over period of 6 hours'
name="ConsumptionCostAlert"
funcExecUnits="total FunctionExecutionUnits > 10000000"
funcExecCount="total FunctionExecutionCount > 5000"
az monitor metrics alert create -n $name -g $resourceGroup --scopes $scope --description "Spike detection 10 GBsec or 5000 requests" \
--condition $funcExecUnits --condition $funcExecCount --window-size 6h --evaluation-frequency 15m --severity 3 \
--action $actionGroupId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment