Azure / azure-functions-eventgrid-extension

EventGrid extension for Azure Functions
MIT License
48 stars 34 forks source link

Error getting the SystemKey (404 or 401) #55

Closed olandese closed 6 years ago

olandese commented 6 years ago

I am using the latest 2.0.0 version in the latest azure V2 runtime: 2.0.12115.0

I try to create an Event Grid SystemKey (to link my function to an Event Grid subscription) and I use the following code: Invoke-RestMethod ("https://$functionAppName.azurewebsites.net/admin/host/systemkeys/eventgridextensionconfig_extension?code=" + $masterKey.masterKey.ToString())

I made a gist for the whole powershell script: https://gist.github.com/olandese/b534226d2a08cf1e64d909c72be399a5#file-get-event-grid-systemkey-ps1

Steps to reproduce:

Create a V2 function with an EventGridTrigger. Replace the $resourceGroupName and $functionAppName below the script and execute this after login in AzureRM in powershell.

When creating a function from the portal and executing the script i get a 404 when trying to retrieve the systemkey. If I create a precompiled C# function (with an eventgridtrigger) and try to get te systemkey I get a 401. This was all working fine until 2 days ago.

olandese commented 6 years ago

I solved the problem. The documentation is not correct, for V2 the endpoint to get the SystemKey should be:

http://{functionappname}.azurewebsites.net/admin/host/systemkeys/eventgrid_extension?code={masterkey}