Azure / Azure/azure-quickstart-templates

ARM template StorageAccount - EventGrid

Open
#6,470 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

### Issue Details
I am trying the use the ARM template to provision an event-grid for a blob storage. The event grid triggers an Azure function to perform some operations.

Below is the command being run

`az group deployment create --resource-group $resourceGroupName --template-file "provision-template.json" --parameters "parameters.json";`

The provision-template.json is as follows
```
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"eventSubName": {
"type": "string",
"metadata": {
"description": "Provide a name for the Event Grid subscription."
}
},
"eventTopicPath": {
"type": "string",
"metadata": {
"description": "Provide the path to the Event Grid topic."
}
},
"endpoint": {
"type": "string",
"metadata": {
"description": "Provide the URL for the WebHook to receive events. Create your own endpoint for events."
}
}
},
"resources": [
{
"type": "Microsoft.EventGrid/eventSubscriptions",
"name": "[parameters('eventSubName')]",
"apiVersion": "2018-01-01",
"properties": {
"topic": "[parameters('eventTopicPath')]",
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "[parameters('endpoint')]"
}
},
"filter": {
"subjectBeginsWith": "",
"subjectEndsWith": "",
"isSubjectCaseSensitive": false,
"includedEventTypes": [
"Microsoft.Storage.BlobCreated",
"Microsoft.Storage.BlobDeleted"
]
},
"labels": [],
"eventDeliverySchema": "EventGridSchema"
}
}
]
}

```
The parameters.json is as below
```
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json",
"contentVersion": "1.0.0.0",
"parameters": {
"eventSubName": {
"value": "eventsubscription-efastorage-azfunction"
},
"eventTopicPath": {
"value": "/subscriptions/88cde288-0e32-41df-a6a4-df4ebfb3d69d/resourceGroups/blobstorage-backup-poc/providers/Microsoft.Storage/StorageAccounts/storageaccname1"
},
"endpoint": {
"value": "https://my-azfunction.azurewebsites.net/api/InitiateBlobBackUp"
}
}
}
```

I get the following exception when running the command
![image](https://user-images.githubusercontent.com/38790296/64161787-82d80480-ce3e-11e9-998a-10795c0910ec.png)

The topic name being used is _/subscriptions/88cde288-0e32-41df-a6a4-df4ebfb3d69d/resourceGroups/blobstorage-backup-poc/providers/Microsoft.Storage/StorageAccounts/storageaccname1_
This is based on the value in the "Advaced Editior" of the Azure portal
![image](https://user-images.githubusercontent.com/38790296/64161939-bfa3fb80-ce3e-11e9-90f0-98a79f242897.png)

How can I associate the storage account topic to the event grid subscription?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the deployment with provision-template.json, parameters.json, and the shown az group deployment create command. Compare the Event Grid eventTopicPath and endpoint values with the resource configuration in the Azure portal's Advanced Editor; done means the deployment completes and the storage account is associated with the event subscription.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.