Details
- Listens for web hook calls from an Event Grid
- Subscription-level Event Grid listeners aren't deployed into a Resource Group. Therefore, deployment of the Event Grid can't be automated from this template. After the template deploys successfully, retrieve the URL of the resulting Function app, and run the following code to create your Event Grid Subscription:
#Login-AzureRmAccount
$functionAppName = "[YOUR APP NAME]"
$functionAppApiKey = "[FUNCTION API KEY]"
$eventGridSubName = "[EVENT GRID SUBSCRIPTION NAME]"
$functionAppUrl = "https://$functionAppName.azurewebsites.net/api/TagManager?code=$functionAppApiKey"
$includedEventTypes = "Microsoft.Resources.ResourceWriteSuccess"
New-AzureRmEventGridSubscription `
-Endpoint $functionAppUrl `
-EventSubscriptionName $eventGridSubName `
-EndpointType webhook `
-IncludedEventType $includedEventTypes
Retrieve the Function app name and API key from within the portal after deploying the template:
- ARM template deploys the following:
- Azure Function App
- Azure Storage account
- Requires the following:
- Azure Event Grid Subscription (deploy via PSH script, sample above)
This code is made available as a sample to demonstrate processing Azure administration events as part of a larger compliance strategy. It should not be utilized directly in production without review and enhancement by your dev team or a partner.