-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.bicep
59 lines (51 loc) · 1.75 KB
/
main.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
@description('The name for the Reserved Instance Notifier Logic App.')
param logicAppName string
@description('The name for the trigger Logic App.')
param triggerLogicAppName string
@description('A context that will be included in the email notification to identify the customer (usually the customer moniker).')
param contextIdentifier string
@description('A semi-colon seperated list of email addresses to send email notifications to.')
param emailResultsTo string
var mainLogicAppContent = loadJsonContent('ReservedInstanceNotifier.json')
var triggerLogicAppContent = loadJsonContent('ReservedInstanceNotifierTrigger.json')
resource o365connection 'Microsoft.Web/connections@2016-06-01' = {
name: 'ReservedInstanceNotifierO365Conn'
location: resourceGroup().location
properties: {
api: {
id: '${subscription().id}/providers/Microsoft.Web/locations/${resourceGroup().location}/managedApis/office365'
}
}
}
resource mainlogicApp 'Microsoft.Logic/workflows@2019-05-01' = {
name: logicAppName
location: resourceGroup().location
properties: {
definition: mainLogicAppContent
}
identity: {
type: 'SystemAssigned'
}
dependsOn: [
o365connection
]
}
resource triggerlogicApp 'Microsoft.Logic/workflows@2019-05-01' = {
name: triggerLogicAppName
location: resourceGroup().location
properties: {
definition: triggerLogicAppContent
}
dependsOn: [
mainlogicApp
]
}
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-10-01-preview' = {
name: guid('ReservationReaderAssignment', subscription().id, logicAppName)
scope: tenant()
properties: {
roleDefinitionId: '582fc458-8989-419f-a480-75249bc5db7e'
principalId: mainlogicApp.identity.principalId
principalType: 'ServicePrincipal'
}
}