-
Notifications
You must be signed in to change notification settings - Fork 0
/
azuredeploy.json
199 lines (199 loc) · 9.16 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"functionsAppName": {
"type": "string",
"metadata": {
"description": "The name of the Function application to be deployed. The name will automatically be made unique on deployment, all lowercase letters or numbers with no spaces."
}
},
"functionKey": {
"type": "string",
"defaultValue": "j0txf1f8msjytzvpe40nxbpxdcxtqcgxy0nt",
"metadata": {
"description": "Function App Key to use for authorization of Webhook. You should replace this with the key you want to use for your Function application authorization"
}
},
"project": {
"type": "string",
"defaultValue": "100-basic-encoding",
"allowedValues": [
"100-basic-encoding",
"101-notify-webhooks",
"102-notify-queues",
"201-logic-app-workflow-1",
"advanced-vod-workflow-functions",
"media-functions-for-logic-app"
],
"metadata": {
"description": "The project in the Media Services Functions samples to deploy. Choose the name that matches the folder name containing the functions samples that you wish to deploy."
}
},
"sourceCodeRepositoryURL": {
"type": "string",
"defaultValue": "ENTER PATH to YOUR FORK of https://github.com/Azure-Samples/media-services-dotnet-functions-integration",
"metadata": {
"description": "Source code repository URL. Is is REQUIRED that you first fork the samples repository and point this to your fork. If you are using your own fork, you may see an error in deployment related to GitHub auth. We require this for your own good, as we may update and break your application or testing as we deploy new updates to the public samples repository."
}
},
"sourceCodeBranch": {
"type": "string",
"defaultValue": "master",
"metadata": {
"description": "Sourcecode Repo branch. This should be set to Master for the public sample. You can adjust this to point to your own fork branch as recommended"
}
},
"mediaServicesAccountAzureActiveDirectoryTenantDomain": {
"type": "string",
"defaultValue": "ENTER YOUR TENANT DOMAIN, Example: microsoft.onmicrosoft.com",
"metadata": {
"description": "Azure Active Directory tenant domain of your media services account."
}
},
"mediaServicesAccountRestApiEndpoint": {
"type": "string",
"defaultValue": "Example: https://accountname.restv2.region.media.azure.net/api/",
"metadata": {
"description": "REST API endpoint of your media services account."
}
},
"mediaServicesAccountServicePrincipalClientId": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Service Principal Client ID to access your media services account. See https://docs.microsoft.com/en-us/azure/media-services/media-services-portal-get-started-with-aad#service-principal-authentication"
}
},
"mediaServicesAccountServicePrincipalClientSecret": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Service Principal Client Secret to access your media services account. See https://docs.microsoft.com/en-us/azure/media-services/media-services-portal-get-started-with-aad#service-principal-authentication"
}
},
"mediaServicesStorageAccountName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Storage Accouunt Name of the Media Services account"
}
},
"mediaServicesStorageAccountKey": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Storage Accouunt Key of the Media Services account"
}
}
},
"variables": {
"functionsAppName": "[concat(toLower(parameters('functionsAppName')),uniqueString(resourceGroup().id))]",
"storageAccountid": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
"storageAccountName": "[concat('storage',uniqueString(resourceGroup().id))]",
"hostingPlanName": "[concat(variables('functionsAppName'), 'plan')]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "2016-01-01",
"location": "[resourceGroup().location]",
"comments": "This storage account is used by the functions.",
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage"
},
{
"type": "Microsoft.Web/serverfarms",
"name": "[variables('hostingPlanName')]",
"apiVersion": "2015-08-01",
"location": "[resourceGroup().location]",
"comments": "This hosting plan is created to deploy the function app and set the billing sku tier",
"sku": {
"name": "Y1",
"tier": "Dynamic",
"size": "Y1",
"family": "Y",
"capacity": 0
},
"kind": "functionapp",
"properties": {
"name": "[variables('hostingPlanName')]",
"computeMode": "0"
}
},
{
"type": "Microsoft.Web/sites",
"name": "[variables('functionsAppName')]",
"apiVersion": "2015-08-01",
"location": "[resourceGroup().location]",
"comments": "This function app depends on the media services account and storage account and will pull down the source code from Github",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
],
"kind": "functionapp",
"properties": {
"serverFarmId": "[variables('hostingPlanName')]",
"siteConfig": {
"appSettings": [
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~1"
}
]
}
},
"resources": [
{
"type": "sourcecontrols",
"name": "web",
"apiVersion": "2015-08-01",
"comments": "This section sets up source control for continuous integration on the Function app and pulls the source code down from Github.",
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', variables('functionsAppName'))]",
"[concat(resourceId('Microsoft.Web/sites/', variables('functionsAppName')),'/config/appsettings')]"
],
"properties": {
"RepoUrl": "[parameters('sourceCodeRepositoryURL')]",
"branch": "[parameters('sourceCodeBranch')]",
"IsManualIntegration": "false"
}
},
{
"type": "config",
"name": "appsettings",
"apiVersion": "2015-08-01",
"comments": "These are the default appsettings configured on the functions app.",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"[resourceId('Microsoft.Web/Sites', variables('functionsAppName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"properties": {
"Project": "[parameters('project')]",
"FUNCTIONS_EXTENSION_VERSION": "~1",
"WEBSITE_NODE_DEFAULT_VERSION": "6.5.0",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]",
"WEBSITE_CONTENTSHARE": "[variables('functionsAppName')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]",
"AzureWebJobsDashboard": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]",
"AMSAADTenantDomain": "[parameters('mediaServicesAccountAzureActiveDirectoryTenantDomain')]",
"AMSRESTAPIEndpoint": "[parameters('mediaServicesAccountRestApiEndpoint')]",
"AMSClientId": "[parameters('mediaServicesAccountServicePrincipalClientId')]",
"AMSClientSecret": "[parameters('mediaServicesAccountServicePrincipalClientSecret')]",
"MediaServicesStorageAccountName": "[parameters('mediaServicesStorageAccountName')]",
"MediaServicesStorageAccountKey": "[parameters('mediaServicesStorageAccountKey')]",
"MediaServicesAttachedStorageCredentials": "",
"StorageConnection": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]",
"SigningKey": "wOlDEUJ4/VN1No8HxVxpsRvej0DZrO5DXvImGLjFhfctPGFiMkUA0Cj8HSfJW7lePX9XsfHAMhw30p0yYqG+1A==",
"WebHookEndpoint": "[concat(resourceId('Microsoft.Web/sites', variables('functionsAppName')),'/api/Notification_Webhook_Function?code=', parameters('functionKey'))]"
}
}
]
}
],
"outputs": {}
}