Skip to content

Commit

Permalink
fixes 3
Browse files Browse the repository at this point in the history
  • Loading branch information
markjbrown committed Jun 19, 2020
1 parent 8b97d9c commit 56a462d
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 22 deletions.
6 changes: 5 additions & 1 deletion 101-cosmosdb-webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ Below are the parameters which can be user configured in the parameters file inc
- **Location:** Azure region for all the resources.
- **App Service Plan Tier:** App Service Plan's pricing tier.
- **App Service Plan Instances:** App Service Plan's instance count.
- **Repo URL:** The URL for the GitHub repository that contains the project to deploy.
- **Repository URL:** The URL for the GitHub repository that contains the project to deploy.
- **Branch:** The branch of the GitHub repository to use.
- **Database Name:** The Cosmos DB database name.
- **Container Name:** The Cosmos DB container name.

[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-cosmosdb-webapp%2Fazuredeploy.json)

[![Deploy To Azure Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-cosmosdb-webapp%2Fazuredeploy.json)

[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-cosmosdb-webapp%2Fazuredeploy.json)
70 changes: 52 additions & 18 deletions 101-cosmosdb-webapp/azuredeploy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"applicationName": {
Expand Down Expand Up @@ -46,9 +46,9 @@
"description": "App Service Plan's instance count"
}
},
"repoURL": {
"repositoryURL": {
"type": "string",
"defaultValue": "https://github.com/Azure-Samples/cosmos-db-to-do.git",
"defaultValue": "https://github.com/Azure-Samples/cosmos-dotnet-core-todo-app.git",
"metadata": {
"description": "The URL for the GitHub repository that contains the project to deploy."
}
Expand All @@ -59,14 +59,26 @@
"metadata": {
"description": "The branch of the GitHub repository to use."
}
},
"databaseName": {
"type": "string",
"defaultValue": "Tasks",
"metadata": {
"description": "The Cosmos DB database name."
}
},
"containerName": {
"type": "string",
"defaultValue": "Items",
"metadata": {
"description": "The Cosmos DB container name."
}
}
},
"variables": {
"cosmosAccountName": "[toLower(parameters('applicationName'))]",
"webSiteName": "[parameters('applicationName')]",
"hostingPlanName": "[parameters('applicationName')]",
"repoUrl": "[parameters('repoURL')]",
"branch": "[parameters('branch')]"
"hostingPlanName": "[parameters('applicationName')]"
},
"resources": [
{
Expand All @@ -76,21 +88,31 @@
"kind": "GlobalDocumentDB",
"location": "[parameters('location')]",
"properties": {
"consistencyPolicy": {"defaultConsistencyLevel": "Session"},
"locations": [{"locationName": "[parameters('location')]", "failoverPriority": 0, "isZoneRedundant": false}],
"databaseAccountOfferType": "Standard"
"consistencyPolicy": {
"defaultConsistencyLevel": "Session"
},
"locations": [
{
"locationName": "[parameters('location')]",
"failoverPriority": 0,
"isZoneRedundant": false
}
],
"databaseAccountOfferType": "Standard"
}
},
{
"apiVersion": "2019-08-01",
"name": "[variables('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[parameters('location')]",
"dependsOn": [ "[resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosAccountName'))]" ],
"dependsOn": [
"[resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosAccountName'))]"
],
"sku": {
"name": "[parameters('appServicePlanTier')]",
"capacity": "[parameters('appServicePlanInstances')]"
},
},
"properties": {
"name": "[variables('hostingPlanName')]"
}
Expand All @@ -100,18 +122,28 @@
"name": "[variables('webSiteName')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]" ],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"siteConfig": {
"appSettings": [
{
"name": "Endpoint",
"value": "[reference(concat('Microsoft.DocumentDb/databaseAccounts/', variables('cosmosAccountName'))).documentEndpoint]"
"name": "CosmosDb:Account",
"value": "[reference(resourceId('Microsoft.DocumentDb/databaseAccounts/', variables('cosmosAccountName'))).documentEndpoint]"
},
{
"name": "Key",
"name": "CosmosDb:Key",
"value": "[listKeys(resourceId('Microsoft.DocumentDb/databaseAccounts', variables('cosmosAccountName')), '2020-04-01').primaryMasterKey]"
},
{
"name": "CosmosDb:DatabaseName",
"value": "[parameters('DatabaseName')]"
},
{
"name": "CosmosDb:ContainerName",
"value": "[parameters('ContainerName')]"
}
]
}
Expand All @@ -122,10 +154,12 @@
"apiVersion": "2019-08-01",
"name": "web",
"location": "[parameters('location')]",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', variables('webSiteName'))]" ],
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('webSiteName'))]"
],
"properties": {
"repoUrl": "[variables('repoUrl')]",
"branch": "[variables('branch')]",
"repoUrl": "[parameters('repositoryURL')]",
"branch": "[parameters('branch')]",
"isManualIntegration": true
}
}
Expand Down
6 changes: 3 additions & 3 deletions 101-cosmosdb-webapp/metadata.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
"type": "QuickStart",
"itemDisplayName": "Create an Azure Cosmos account and Azure Web App",
"description": "This template creates an Azure Cosmos account for Core (SQL) API and injects endpoint and keys into an Azure Web App and automatically deploys an ASP MVC web app.",
"summary": "This template creates an Azure Cosmos account for Core (SQL) API and injects endpoint and keys into an Azure Web App and automatically deploys an ASP MVC web app.",
"itemDisplayName": "Create a zero touch Azure Cosmos account and Azure Web App",
"description": "This template creates an Azure Cosmos account, injects the Cosmos DB endpoint and keys into Azure Web App settings, then deploys an ASP MVC web app from GitHub.",
"summary": "This template creates an Azure Cosmos account, injects the Cosmos DB endpoint and keys into Azure Web App settings, then deploys an ASP MVC web app from GitHub.",
"githubUsername": "markjbrown",
"dateUpdated": "2020-06-18"
}

0 comments on commit 56a462d

Please sign in to comment.