This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathmain.dexdataconnection.bicep
62 lines (58 loc) · 2.14 KB
/
main.dexdataconnection.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var dataExplorerClusterName = toLower('dex${uniqueString(subscription().id, resourceGroup().id)}')
var eventHubNamespaceName = 'eh${uniqueString(subscription().id, resourceGroup().id)}'
var consumerFunctionAppName = 'consumer${uniqueString(subscription().id, resourceGroup().id)}'
var eventGridTopicName = 'egt${uniqueString(subscription().id, resourceGroup().id)}'
resource sampledataCollector 'Microsoft.Kusto/clusters/databases/dataconnections@2019-11-09' = {
name: '${dataExplorerClusterName}/sampledata/collector'
location: resourceGroup().location
kind: 'EventHub'
properties: {
eventHubResourceId: resourceId('Microsoft.EventHub/namespaces/eventhubs', eventHubNamespaceName, 'collector')
consumerGroup: '$Default'
tableName: 'SampleDataTable'
mappingRuleName: 'DataMapping'
dataFormat: 'JSON'
}
}
resource egTopic 'Microsoft.EventGrid/topics@2020-06-01' existing = {
name: eventGridTopicName
}
resource consumerAppSubscription 'Microsoft.EventGrid/eventSubscriptions@2020-06-01' = {
scope: egTopic
name: consumerFunctionAppName
properties: {
destination: {
endpointType: 'AzureFunction'
properties: {
resourceId: resourceId('Microsoft.Web/Sites/functions', consumerFunctionAppName, 'EventGridProcessorAsync')
}
}
eventDeliverySchema: 'EventGridSchema'
}
}
resource consumerAppSubscription5 'Microsoft.EventGrid/eventSubscriptions@2020-06-01' = {
scope: egTopic
name: '${consumerFunctionAppName}5'
properties: {
destination: {
endpointType: 'AzureFunction'
properties: {
resourceId: resourceId('Microsoft.Web/Sites/functions', '${consumerFunctionAppName}5', 'EventGridProcessorAsync')
}
}
eventDeliverySchema: 'EventGridSchema'
}
}
resource consumerAppSubscription6 'Microsoft.EventGrid/eventSubscriptions@2020-06-01' = {
scope: egTopic
name: '${consumerFunctionAppName}6'
properties: {
destination: {
endpointType: 'AzureFunction'
properties: {
resourceId: resourceId('Microsoft.Web/Sites/functions', '${consumerFunctionAppName}5', 'EventGridProcessorAsync')
}
}
eventDeliverySchema: 'EventGridSchema'
}
}