Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,109 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to filter events in event grid to be triggered only when an Azure function changes in my subscription (say configuration change, code updated or new function created/deleted).
The PowerShell script I am using is as follows:
# Provide an endpoint for handling the events. Must be formatted "https://your-endpoint-URL"
$myEndpoint = "https://myendpoint-function.azurewebsites.net"
$subscriptionId = "abcde-34df-4493-9477-notrealid980"
$eventSubscriptionName = "FunctionConfigChanges"
# Select the Azure subscription you want to subscribe to. You need this command only if the
# current subscription is not the one you wish to subscribe to.
Set-AzContext -Subscription $subscriptionId
$includedEventTypes = "Microsoft.Resources.ResourceActionSuccess", "Microsoft.Resources.ResourceDeleteSuccess", "Microsoft.Resources.ResourceWriteSuccess"
$AdvancedFilters = @{operator="StringContains"; key="Subject"; Values=@("providers/Microsoft.Web/sites")}
New-AzEventGridSubscription -Endpoint $myEndpoint -EventSubscriptionName $eventSubscriptionName -IncludedEventType $includedEventTypes -AdvancedFilter $AdvancedFilters
This filters to all functions and websites (check $AdvancedFilters
). Is there any way to get the event to be filtered to Azure functions only?
Any kind of solution help in Azure CLI, portal, Powershell or .net sdk is welcome.
Please note I had originally asked this question on stackoverflow.