-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeployEvent.bicep
41 lines (38 loc) · 1.22 KB
/
deployEvent.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
param location string = resourceGroup().location
param baseUrl string
param prNumber string = ''
param storageAccountName string = uniqueString(resourceGroup().id, '7f358957-c1be-48ad-8902-808564e0556f')
var eventName = !empty(prNumber) ? '${prNumber}-back-from-archive' : 'back-from-archive'
var storageAccountId = resourceId(resourceGroup().name, 'Microsoft.Storage/storageAccounts' , storageAccountName)
resource eventTopic 'Microsoft.EventGrid/systemTopics@2022-06-15' = {
name: 'storageEvents'
location: location
properties: {
source: storageAccountId
topicType: 'Microsoft.Storage.StorageAccounts'
}
}
resource archiveEvent 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2022-06-15' = {
name: eventName
parent: eventTopic
properties: {
destination: {
endpointType: 'WebHook'
properties: {
endpointUrl: '${baseUrl}/api/AddMetadata'
maxEventsPerBatch: 1
preferredBatchSizeInKilobytes: 64
}
}
filter: {
includedEventTypes: [
'Microsoft.Storage.BlobCreated'
'Microsoft.Storage.BlobTierChanged'
]
enableAdvancedFilteringOnArrays: true
advancedFilters: []
}
eventDeliverySchema: 'EventGridSchema'
labels: []
}
}