Azure Function EventGrid Trigger does not support Key Vault references?

258 views Asked by At

Originally this Function was triggered by BlobStorage uploads. I changed the Function to now be triggered by EventGridEvents.

I'm now trying to register an event, but the trigger still shows Azure Blob Storage (myblob) as the trigger.

I've published the app 2x and refreshed a couple times, no avail.

Ideas?

enter image description here enter image description here enter image description here

1

There are 1 answers

1
ericOnline On

Here is how I fixed this:

  • Went into Portal and clicked Code+Test, Test/Run then Run

enter image description here

  • This resulted in errors which said the AzureWebJobsStorage value was incorrect.
  • I was using a Key Vault reference in local.settings.json rather than a Connection String directly (to keep secrets out of my code)
  • In local.settings.json, changed from the Key Vault Reference to the actual Connection String.
  • Re-published
  • Refreshed a couple times
  • Then...

Trigger shows correctly

enter image description here

  • Reverted to Key Vault Reference in local.settings.json and republished to test if errors return.

  • Sure enough:

2020-10-05T23:37:11.138 [Information] Initializing Warmup Extension./home/LogFiles/Application/Functions/Host/2020-10-05T21-04-07Z-59062a025e.log  (https://function-dev.scm.azurewebsites.net/api/vfs/LogFiles/Application/Functions/Host/2020-10-05T21-04-07Z-59062a025e.log)
2020-10-05T21:04:07.832 [Information] Host started (642ms)
2020-10-05T21:04:07.833 [Information] Job host started
2020-10-05T21:04:07.835 [Error] The 'function-dev' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.function-dev'. Microsoft.Azure.WebJobs.Extensions.Storage: Storage account connection string for 'AzureWebJobsStorage' is invalid.

Looks like using Key Vault References as AppSettings is unsupported with EventGrid triggers(?).