question

Michael-5260 avatar image
0 Votes"
Michael-5260 asked anggilestari-9859 answered

How can I create an event subscription with power shell command such that the endpoint iof this subscription is an Azure Function

I am trying to create an event subscription with powershell command such that the endpoint is an Azure function. Does anybody know what I am supposed to put as the endpoint for the Azure fucntion?. I tried both the masterkey and systemkey URL of the function but the command failed.

Here are my details

resourcegroupname: nigrgp

topic name: nigtopic

function name: nigfunction

endpont: azltrialfuncapp.azurewebsites.net/runtime/webhooks/EventGrid?functionName=nigfunction&code=W/KKKKKKKKKKKKKKKKKEEEEEEEEEEEEEEEEEEEEEEYYYYYYYYYYYYYYYYYYYY==

subscription name: nigSubscription

 New-AzEventGridSubscription -ResourceGroup nigrgp -TopicName nigtopic -Endpoint azltrialfuncapp.azurewebsites.net/runtime/webhooks/EventGrid?functionName=nigfunction&code=W/KKKKKKKKKKKKKKKKKEEEEEEEEEEEEEEEEEEEEEEYYYYYYYYYYYYYYYYYYYY== -EventSubscriptionName nigSubscription






azure-functionsazure-event-grid
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Michael-5260 URL pattern that you're using is correct. Is your topic a System Topic or a custom one? If it's system topic, you can use the following Azure CLI in your Powershell: https://docs.microsoft.com/en-us/cli/azure/ext/eventgrid/eventgrid/system-topic/event-subscription?view=azure-cli-latest#ext-eventgrid-az-eventgrid-system-topic-event-subscription-create


0 Votes 0 ·
femiAladesuluMSFT-2546 avatar image
0 Votes"
femiAladesuluMSFT-2546 answered

Hello Michael-5260 ,


In addition to @MikeUrnun's update, take a peek at this solution that addresses a similar scenario.


10412-stackflow.png




stackflow.png (111.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

anggilestari-9859 avatar image
0 Votes"
anggilestari-9859 answered

I have similar case

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.