forked from officialmofabs/modern-data-warehouse-dataops
-
Notifications
You must be signed in to change notification settings - Fork 1
/
streamingjobs.bicep
90 lines (83 loc) · 1.92 KB
/
streamingjobs.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
param name string
param env string
param location string
param query string
param storageAccountName string
param iotHubsName string
param streamingUnits int = 1
resource storageAccount 'Microsoft.Storage/storageAccounts@2020-08-01-preview' existing = {
name: storageAccountName
}
resource iotHubs 'Microsoft.Devices/IotHubs@2022-04-30-preview' existing = {
name: iotHubsName
}
var serialization = {
type: 'Json'
properties: {
encoding: 'UTF8'
}
}
var input = {
name: 'iothub'
properties: {
type: 'Stream'
datasource: {
type: 'Microsoft.Devices/IotHubs'
properties: {
iotHubNamespace: iotHubs.name
sharedAccessPolicyName: iotHubs.listkeys().value[0].keyName
sharedAccessPolicyKey: iotHubs.listkeys().value[0].primaryKey
consumerGroupName: '$Default'
endpoint: 'messages/events'
}
}
serialization: serialization
}
}
var output = {
name: 'bloboutput'
properties: {
datasource: {
type: 'Microsoft.Storage/Blob'
properties: {
storageAccounts: [
{
accountName: storageAccount.name
accountKey: storageAccount.listKeys().keys[0].value
}
]
container: 'bloboutput'
pathPattern: '{date}/{datetime:HH}.{datetime:mm}.{datetime:ss}'
dateFormat: 'yyyy/MM/dd'
}
}
serialization: serialization
}
}
var transformation = {
name: 'Transformation'
properties: {
streamingUnits: streamingUnits
query: query
}
}
resource asa_tech_sample_job 'Microsoft.StreamAnalytics/streamingjobs@2017-04-01-preview' = {
name: 'asa-${name}-${env}'
location: location
properties: {
compatibilityLevel: '1.2'
outputStartMode: 'JobStartTime'
sku: {
name: 'Standard'
}
outputErrorPolicy: 'Stop'
dataLocale: 'en-US'
inputs: [
input
]
outputs: [
output
]
transformation: transformation
}
}