Skip to content

Commit

Permalink
Merge pull request #14 from xpouyat/master
Browse files Browse the repository at this point in the history
ARM template update for Functions v3
  • Loading branch information
xpouyat authored Nov 18, 2020
2 parents f8785b2 + 6e3904d commit cfe86f2
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 47 deletions.
1 change: 1 addition & 0 deletions LiveAndVodDRMOperationsV3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ local.settings.json will look like (please replace 'value' with the correct data
```

### 5. Optional but recommended : deploy a Cosmos Database

This database is used to read the settings when creating a live event. It is also used to store all the information about the live event, output created, and vod assets.
Database and collections are automatically created by the code if Cosmos fields are set in app settings. Collections use a partition key named "/partitionKey" and value is always "live".

Expand Down
132 changes: 85 additions & 47 deletions azuredeploy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"functionsAppName": {
Expand Down Expand Up @@ -112,26 +112,22 @@
{
"type": "Microsoft.Web/serverfarms",
"name": "[variables('hostingPlanName')]",
"apiVersion": "2015-08-01",
"apiVersion": "2020-06-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
"tier": "Dynamic"
},
"kind": "functionapp",
"properties": {
"name": "[variables('hostingPlanName')]",
"computeMode": "0"
"computeMode": "Dynamic"
}
},
{
"type": "Microsoft.Web/sites",
"name": "[variables('functionsAppName')]",
"apiVersion": "2015-08-01",
"apiVersion": "2020-06-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": [
Expand All @@ -143,59 +139,101 @@
"serverFarmId": "[variables('hostingPlanName')]",
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(variables('functionsAppName'))]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "beta"
"value": "~3"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "~10"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
},
{
"name": "Project",
"value": "[parameters('project')]"
},
{
"name": "SubscriptionId",
"value": "[parameters('mediaServicesAccountSubscriptionId')]"
},
{
"name": "Region",
"value": "[parameters('mediaServicesAccountRegion')]"
},
{
"name": "ResourceGroup",
"value": "[parameters('mediaServicesAccountResourceGroup')]"
},
{
"name": "AccountName",
"value": "[parameters('mediaServicesAccountName')]"
},
{
"name": "AadClientId",
"value": "[parameters('mediaServicesAccountServicePrincipalClientId')]"
},
{
"name": "AadClientSecret",
"value": "[parameters('mediaServicesAccountServicePrincipalClientSecret')]"
},
{
"name": "AadEndpoint",
"value": "https://login.microsoftonline.com"
},
{
"name": "AadTenantId",
"value": "[parameters('mediaServicesAccountAzureActiveDirectoryTenantId')]"
},
{
"name": "ArmEndpoint",
"value": "https://management.azure.com/"
},
{
"name": "ArmAadAudience",
"value": "https://management.core.windows.net/"
},
{
"name": "StorageConnection",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2019-06-01').keys[0].value)]"
},
{
"name": "SigningKey",
"value": "wOlDEUJ4/VN1No8HxVxpsRvej0DZrO5DXvImGLjFhfctPGFiMkUA0Cj8HSfJW7lePX9XsfHAMhw30p0yYqG+1A=="
},
{
"name": "WebHookEndpoint",
"value": "[concat(resourceId('Microsoft.Web/sites', variables('functionsAppName')),'/api/Notification_Webhook_Function?code=', parameters('functionKey'))]"
}
]
}
},
"resources": [
{
"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_WORKER_RUNTIME": "dotnet",
"FUNCTIONS_EXTENSION_VERSION": "~2",
"WEBSITE_NODE_DEFAULT_VERSION": "10.14.1",
"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)]",
"SubscriptionId": "[parameters('mediaServicesAccountSubscriptionId')]",
"Region": "[parameters('mediaServicesAccountRegion')]",
"ResourceGroup": "[parameters('mediaServicesAccountResourceGroup')]",
"AccountName": "[parameters('mediaServicesAccountName')]",
"AadClientId": "[parameters('mediaServicesAccountServicePrincipalClientId')]",
"AadClientSecret": "[parameters('mediaServicesAccountServicePrincipalClientSecret')]",
"AadEndpoint": "https://login.microsoftonline.com",
"AadTenantId": "[parameters('mediaServicesAccountAzureActiveDirectoryTenantId')]",
"ArmEndpoint": "https://management.azure.com/",
"ArmAadAudience": "https://management.core.windows.net/",
"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'))]"
}
},
{
"type": "sourcecontrols",
"name": "web",
"apiVersion": "2015-08-01",
"apiVersion": "2019-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('Microsoft.Web/sites/', variables('functionsAppName'), '/config/appsettings')]"
],
"properties": {
"RepoUrl": "[parameters('sourceCodeRepositoryURL')]",
"repoUrl": "[parameters('sourceCodeRepositoryURL')]",
"branch": "[parameters('sourceCodeBranch')]",
"IsManualIntegration": "true"
}
Expand All @@ -204,4 +242,4 @@
}
],
"outputs": {}
}
}

0 comments on commit cfe86f2

Please sign in to comment.