4

Does anyone know why I'm getting this error? Here is my SendGrid output binding:

{
  "bindings": [
    {
      "name": "docId",
      "type": "queueTrigger",
      "direction": "in",
      "queueName": "movedocument",
      "connection": "cpoffice365_STORAGE"
    },
    {
      "type": "sendGrid",
      "name": "message",
      "apiKey": "<MYSENDGRIDKEY>",
      "from": "<MYFROMEMAIL>",
      "direction": "out"
    }
  ],
  "disabled": false
}

My code compiles, but then it throws this error in the log:

Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.<MYFUNCTIONAME>'. Microsoft.Azure.WebJobs.Host: '<MYSENDGRIDKEY>' does not resolve to a value.
Coder-256
  • 5,212
  • 2
  • 23
  • 51
statto
  • 492
  • 2
  • 6
  • 16

1 Answers1

6

Statto,

Please make sure you define an app setting (Function app settings > App Settings) with the name matching what you've used for your binding configuration, where the value is your Sendgrid key.

The binding configuration expects that to be an app setting name, not the actual key.

Thanks!

Fabio Cavalcante
  • 12,328
  • 3
  • 35
  • 43