MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.21k stars 21.36k forks source link

eventGrid output binding for js #48921

Open tymoor opened 4 years ago

tymoor commented 4 years ago

Is this output binding for javascript already available? It does not appear as an option in the portal's function designer, and when I code it manually I get an error stating: 'Error: The binding type(s) 'eventGrid' are not registered.' ... it also doesn't appear in the extensions listed here: https://github.com/Azure/azure-functions-extension-bundles/blob/master/src/Microsoft.Azure.Functions.ExtensionBundle/extensions.json


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

DixitArora-MSFT commented 4 years ago

Hi @tymoor Thanks for reaching out. We will review and update as appropriate.

DixitArora-MSFT commented 4 years ago

@tymoor I have assigned this to content author for further review and update as appropriate.

kratoch-dig-it-ally commented 4 years ago

I am also facing the problem with usage of Event Grid as output binding in Azure Function. According to information in document https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings is should be Event Grid supported as output binding in Azure Functions. But when I try to create output binding then I see only following options: Azure Queue Storage, Azure Blob Storage, HTTP, Azure Service Bus, Azure Table Storage, Azure Event Hubs, SendGrid, Twilio SMS, Azure Cosmos DB and Signal IR. Event Grid isn’t offered. In the document https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-grid-output?tabs=javascript I found Event Grid output binding example and according to this example I added Event Grid output binding into my function.json file:

{
  "bindings": [
    {
      "authLevel": "function",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [
        "post"
      ]
    },
    {
      "type": "eventGrid",
      "name": "outputEvent",
      "topicEndpointUri": "https://xxxxx.westeurope-1.eventgrid.azure.net/api/events",
      "topicKeySetting": "xxxxxKey",
      "direction": "out"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    }
  ]
}

(I don’t want provide real Topic Endpoint Uri and Topic Key and therefore I replaced here beginning of real Uri by xxxxx and real Key by xxxxxKey) I developed Azure Function. When I am testing the function I receive error “Microsoft.Azure.WebJobs.Host: Unable to resolve the value for property 'EventGridAttribute.TopicEndpointUri'. Make sure the setting exists and has a valid value.” I can't find information how to fix it anywhere and also I can't find another examples of usage of Event Grid output binding in Azure Function.

acomley commented 4 years ago

@kratoch-dig-it-ally TopicEndpointUri should be the App Setting that contains the uri, not the uri itself.

The metadata was added to the 2.X branch recently. https://github.com/Azure/azure-functions-extension-bundles/issues/10

I get the following error locally and when deployed: The 'XXXXXX' function is in error: The binding type(s) 'eventGrid' are not registered. Please ensure the type is correct and the binding extension is installed.