Last active
July 29, 2022 14:00
-
-
Save justinyoo/8865213b31baeda9f7c1ad258351a039 to your computer and use it in GitHub Desktop.
Provisioning EventGrid Subscription and LogicApp Handler Using Azure CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logicAppResourceId=$(az logic workflow show \ | |
-g <resource_group_name> \ | |
-n <logic_app_name> \ | |
--query "id" -o tsv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logicAppEndpoint=$(az rest \ | |
-m POST \ | |
-u "https://management.azure.com$logicAppResourceId/triggers/manual/listCallbackUrl?api-version=2016-06-01" \ | |
--query "value" -o tsv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eventGridTopicId=$(az eventgrid topic show \ | |
-g <resource_group_name> \ | |
-n <eventgrid_topic_name> \ | |
--query "id" -o tsv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az eventgrid event-subscription create \ | |
-n <eventgrid_subscription_name> \ | |
--source-resource-id $eventGridTopicId \ | |
--event-delivery-schema cloudeventschemav1_0 \ | |
--endpoint-type webhook \ | |
--endpoint $logicAppEndpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az eventgrid event-subscription create \ | |
-n <eventgrid_subscription_name> \ | |
--source-resource-id $(az eventgrid topic show \ | |
-g <resource_group_name> \ | |
-n <eventgrid_topic_name> \ | |
--query "id" -o tsv) \ | |
--event-delivery-schema cloudeventschemav1_0 \ | |
--endpoint-type webhook \ | |
--endpoint $(az rest \ | |
-m POST \ | |
-u "https://management.azure.com$(az logic workflow show \ | |
-g <resource_group_name> \ | |
-n <logic_app_name> \ | |
--query "id" -o tsv)/triggers/manual/listCallbackUrl?api-version=2016-06-01" \ | |
--query "value" -o tsv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource evtgrdtopic 'Microsoft.EventGrid/topics@2020-06-01' = { | |
name: 'my-eventgrid-topic' | |
} | |
resource evtgrdsub 'Microsoft.EventGrid/eventSubscriptions@2020-06-01' = { | |
name: 'my-eventgrid-sub' | |
scope: evtgrdtopic | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource evtgrdtopic 'Microsoft.EventGrid/topics@2020-06-01' = { | |
name: 'my-eventgrid-topic' | |
... | |
} | |
resource evtgrdsub 'Microsoft.EventGrid/topics/providers/eventSubscriptions@2020-06-01' = { | |
name: '${evtgrdtopic.name}/Microsoft.EventGrid/my-eventgrid-sub' | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment