-
Notifications
You must be signed in to change notification settings - Fork 4
/
azuredeploy.bicep
68 lines (60 loc) · 1.65 KB
/
azuredeploy.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
@description('Name of the AppService to create.')
param appName string
@description('The SKU of App Service Plan.')
param sku string = 'F1'
var appServicePlanPortalName = 'AppServicePlan-${appName}'
var packageUrl = 'https://github.com/Azure/communication-services-pstn-calling/releases/latest/download/calling-tutorial-build.zip'
var commsName = 'CommunicationServices-${appName}'
var location = resourceGroup().location
resource ACS 'Microsoft.Communication/communicationServices@2020-08-20' = {
name: commsName
location: 'global'
properties: {
dataLocation: 'United States'
}
}
resource serverFarm 'Microsoft.Web/serverfarms@2022-03-01' = {
name: appServicePlanPortalName
location: location
sku: {
name: sku
}
properties: {}
}
resource site 'Microsoft.Web/sites@2022-03-01' = {
name: appName
location: location
dependsOn: [ ACS ]
properties: {
serverFarmId: serverFarm.id
}
resource appsettings 'config@2022-03-01' = {
name: 'appsettings'
properties: {
ConnectionString: ACS.listKeys().primaryConnectionString
}
}
resource MSDeploy 'extensions@2022-03-01' = {
name: 'MSDeploy'
dependsOn: [ appsettings ]
properties: {
packageUri: packageUrl
}
}
}
resource incomingCallEventSub 'Microsoft.EventGrid/eventSubscriptions@2022-06-15' = {
name: 'PSTNIncomingCallSubscription'
scope: ACS
properties: {
destination: {
properties: {
endpointUrl: 'https://${site.properties.defaultHostName}/incomingCall'
}
endpointType: 'WebHook'
}
filter: {
includedEventTypes: [ 'Microsoft.Communication.IncomingCall' ]
}
}
dependsOn: [ site::MSDeploy ]
}