-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazuredeploy.json
181 lines (181 loc) · 6.25 KB
/
azuredeploy.json
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
"parameters": {
"webAppName": {
"type": "string",
"defaultValue": "[concat('ContosoPhoneRadio-', uniqueString(resourceGroup().id))]",
"metadata": {
"description": "The name of you Web App."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"sku": {
"type": "string",
"defaultValue": "F1",
"metadata": {
"description": "The pricing tier for the hosting plan."
}
},
"workerSize": {
"type": "string",
"allowedValues": [
"0",
"1",
"2"
],
"defaultValue": "0",
"metadata": {
"description": "The instance size of the hosting plan (small, medium, or large)."
}
},
"branch": {
"type": "string",
"defaultValue": "main",
"metadata": {
"description": "The branch of the GitHub repository to use."
}
},
"azureCommunicationServicesResourceName": {
"type": "string",
"metadata": {
"description": "Provide name of your Azure Communication Services resource. If you do not have Azure Communication Resource, Please provision first."
}
},
"provisionSystemTopic": {
"type": "string",
"allowedValues": [
"Yes",
"No"
],
"metadata": {
"description": "If you do not have event grid topic associated with ACS, say YES. If you already have the topic associated with your ACS, say NO."
}
},
"systemTopicName": {
"type": "string",
"metadata": {
"description": "Name of the system topic. If you have an existing topic, find it under 'Events' in your Azure Communication Services resource, otherwise specify a unique name"
}
},
"eventSubName": {
"type": "string",
"defaultValue": "IncomingCallSubscription",
"metadata": {
"description": "Provide a name for the Event Grid subscription."
}
},
"musicToPlay": {
"type": "string",
"defaultValue": "https://github.com/minwoolee-msft/contoso-phone-radio/raw/main/media/CanonDMajor.wav",
"metadata": {
"description": "Music .wav file that will be playing when you call in. We provided sample wav file for you, but you may change if you would like."
}
}
},
"variables": {
"hostingPlanName": "[concat('hpn-', resourceGroup().name)]",
"repoURL": "https://github.com/minwoolee-msft/contoso-phone-radio.git"
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-12-01",
"name": "[variables('hostingPlanName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('sku')]",
"capacity": "[parameters('workerSize')]"
},
"properties": {
"name": "[variables('hostingPlanName')]"
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"name": "[parameters('webAppName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
],
"properties": {
"id": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
},
"resources": [
{
"type": "sourcecontrols",
"apiVersion": "2020-12-01",
"name": "web",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('webAppName'))]"
],
"properties": {
"repoUrl": "[variables('repoURL')]",
"branch": "[parameters('branch')]",
"isManualIntegration": true
}
},
{
"name": "appsettings",
"type": "config",
"apiVersion": "2020-12-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('webAppName'))]"
],
"tags": {
"displayName": "appsettings"
},
"properties": {
"AppServiceEndpoint": "[concat('https://', parameters('webAppName'), '.azurewebsites.net')]",
"AzureCommunicationServiceKey": "[concat(concat('endpoint=https://', parameters('azureCommunicationServicesResourceName'), '.communication.azure.com/;accesskey='), listKeys(resourceId('Microsoft.Communication/CommunicationServices', parameters('azureCommunicationServicesResourceName')), '2020-08-20-preview').primaryKey)]",
"PlayMediaFileEndpoint": "[parameters('musicToPlay')]"
}
}
]
},
{
"condition": "[equals(parameters('provisionSystemTopic'), 'Yes')]",
"type": "Microsoft.EventGrid/systemTopics",
"apiVersion": "2021-06-01-preview",
"name": "[parameters('systemTopicName')]",
"location": "global",
"properties": {
"source": "[resourceId('Microsoft.Communication/CommunicationServices', parameters('azureCommunicationServicesResourceName'))]",
"topicType": "Microsoft.Communication.CommunicationServices"
}
},
{
"type": "Microsoft.EventGrid/systemTopics/eventSubscriptions",
"apiVersion": "2021-06-01-preview",
"name": "[concat(parameters('systemTopicName'), '/', parameters('eventSubName'))]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('webAppName'))]",
"[resourceId('Microsoft.Web/sites/config/', parameters('webAppName'), 'appsettings')]",
"[resourceId('Microsoft.EventGrid/systemTopics', parameters('systemTopicName'))]",
"[resourceId('Microsoft.Web/sites/sourcecontrols', parameters('webAppName'), 'web')]"
],
"properties": {
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "[concat('https://', parameters('webAppName'), '.azurewebsites.net/IncomingCallEvents')]"
}
},
"eventDeliverySchema": "EventGridSchema",
"filter": {
"includedEventTypes": [
"Microsoft.Communication.IncomingCall"
]
}
}
}
]
}