I've got an Azure Logic App that I want to run whenever a file is uploaded to a specific Azure Storage Account. The Logic App is deployed via an ARM template (which has also been configured to create the Event Grid and Blob Storage API connections).
When I deploy the ARM template, the Event Grid trigger isn't working as there's no event subscription in the Azure Storage Account.
FYI., I can get event subscriptions to work if I create a Logic App via the quick start option i.e. from my Azure Storage Account under Events > Get Started > Logic Apps > When a new blob is uploaded > Create
.
^^ This creates a new Logic App with an Azure Event Grid trigger (When a resource event occurs), but I actually want to create/link the event subscription to an existing Logic App i.e. the one that I deployed via the ARM template, and I want to be able to automate this.
If I reverse engineer the event subscription that was created by the Logic App quick start; I can see it's got an endpoint type of WebHook with an endpoint of the form {logic-app-access-endpoint}/triggers/{name-of-trigger}/versions/{logic-app-version}/run
. I can reconstruct this to something like the following by getting the params from my Logic App:
https://prod-24.australiaeast.logic.azure.com:443/workflows/12433cc68f0e916dc3048c1775333506/triggers/When_blah_blah_blah/versions/12345678901234567890/run
I can enter the Subscriber Endpoint and Confirm Selection, but when I try to create it; I'm getting the following error:
Deploying Event Subscription: Test123
Deployment has failed with the following error: {"code":"Url validation","message":"The attempt to validate the provided endpoint https://prod-24.australiaeast.logic.azure.com:443/workflows/12433cc68f0e916dc3048c1775333506/triggers/When_blah_blah_blah/versions/12345678901234567890/run failed. For more details, visit https://aka.ms/esvalidation."
What's strange is if I go into my logic app and change the event grid connection to a different one (but with the exact same properties) and then save my logic app; I can then create my event grid subscription without the error. It seems a bit temperamental...
I've tried a few things such as authorizing my event grid API connection, but it doesn't work...
Does anyone know if how set up event grid subscriptions to an existing Logic App without the errors / temperamental behavior... also how would one go about automating the creation of the event grid subscriptions (given there's some dynamic properties such as the logic app version).
TIA - Ryan.