jwendl / jwendl/functions-simulator

Can't use ARM to create EventGridTrigger subscription

Open
#9 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Right now we can't have a function generate the systemkey needed in order to do an EventGrid subscription via ARM (similar to below)

``` json
{
"name": "[concat(parameters('eventGridTopicName'), '/Microsoft.EventGrid/RegistrationSubscription')]",
"type": "Microsoft.EventGrid/topics/providers/eventSubscriptions",
"location": "[resourceGroup().location]",
"apiVersion": "2018-01-01",
"properties": {
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "[concat('https://', parameters('functionsApiAppName'), '.azurewebsites.net/runtime/webhooks/EventGridExtensionConfig?functionName=RegistrationConsumer&code=', listSecrets(resourceId('Microsoft.Web/sites/functions', parameters('functionsApiAppName'), 'RegistrationConsumer'), '2018-02-01').key)]"
}
},
"filter": {
"subjectEndsWith": "registration"
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('functionsApiAppName'))]",
"[resourceId('Microsoft.Web/sites/sourcecontrols', parameters('functionsApiAppName'), 'web')]"
]
},
{
"name": "[concat(parameters('eventGridTopicName'), '/Microsoft.EventGrid/SendEventConsumer')]",
"type": "Microsoft.EventGrid/topics/providers/eventSubscriptions",
"location": "[resourceGroup().location]",
"apiVersion": "2018-01-01",
"properties": {
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "[concat('https://', parameters('functionsApiAppName'), '.azurewebsites.net/runtime/webhooks/EventGridExtensionConfig?functionName=SendEventConsumer&code=', listSecrets(resourceId('Microsoft.Web/sites/functions', parameters('functionsApiAppName'), 'SendEventConsumer'), '2018-02-01').key)]"
}
},
"filter": {
"subjectEndsWith": "event"
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('functionsApiAppName'))]",
"[resourceId('Microsoft.Web/sites/sourcecontrols', parameters('functionsApiAppName'), 'web')]"
]
}
```

Because of this we will have to use Azure CLI instead...

``` bash
az eventgrid event-subscription create -g $resourceGroupName -n RegistrationConsumer --endpoint "https://$functionName.azurewebsites.net/runtime/webhooks/EventGridExtensionConfig?functionName=RegistrationConsumer&code=$masterKey"
az eventgrid event-subscription create -g $resourceGroupName -n SendEventConsumer --endpoint "https://$functionName.azurewebsites.net/runtime/webhooks/EventGridExtensionConfig?functionName=SendEventConsumer&code=$masterKey"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.