Skip to content

Instantly share code, notes, and snippets.

@suneetnangia
Created December 8, 2015 12:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save suneetnangia/b6180120a94e5cf711c8 to your computer and use it in GitHub Desktop.
{
"$schema": "http://schemas.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"externalUrl": {
"type": "string",
"metadata": {
"description": "External url of the service used to access the service and for auth redirections."
}
},
"AADAuthClientId": {
"type": "string",
"metadata": {
"description": "Client Id provided by Azure AD for this application authentication."
}
},
"openIdIssuer": {
"type": "string",
"metadata": {
"description": "Open ID issuer url."
}
},
"apiAppName": {
"type": "string",
"metadata": {
"description": "The name of the API app to create. The name must contain at least 8 characters and no more than 50 characters."
}
},
"hostingPlanName": {
"type": "string",
"metadata": {
"description": "The name of the name App Service plan."
}
},
"hostingPlanSettings": {
"type": "Object",
"defaultValue": {
"computeMode": "Dedicated",
"siteMode": "Limited",
"sku": "Free",
"workerSize": "0",
"hostingEnvironment": ""
},
"metadata": {
"description": "The settings of the existing hosting plan."
}
},
"apiLocation": {
"type": "string",
"metadata": {
"description": "The location for the new API app."
}
}
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2015-04-01",
"name": "[parameters('hostingPlanName')]",
"location": "[parameters('apiLocation')]",
"properties": {
"name": "[parameters('hostingPlanName')]",
"sku": "[parameters('hostingPlanSettings').sku]",
"workerSize": "[parameters('hostingPlanSettings').workerSize]",
"hostingEnvironment": "[parameters('hostingPlanSettings').hostingEnvironment]",
"numberOfWorkers": 1
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2015-08-01",
"name": "[parameters('apiAppName')]",
"location": "[parameters('apiLocation')]",
"kind": "api",
"properties": {
"name": "[parameters('apiAppName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]",
"hostingEnvironment": "[parameters('hostingPlanSettings').hostingEnvironment]"
},
"resources": [
{
"apiVersion": "2015-08-01",
"location": "North Europe",
"name": "[concat(parameters('apiAppName'), '/authsettings')]",
"properties": {
"enabled": true,
"httpApiPrefixPath": null,
"unauthenticatedClientAction": 0,
"tokenStoreEnabled": true,
"allowedExternalRedirectUrls": [
"[parameters('externalUrl')]"
],
"defaultProvider": 1,
"clientId": "[parameters('AADAuthClientId')]",
"clientSecret": null,
"issuer": "[parameters('openIdIssuer')]",
"allowedAudiences": [
"[parameters('externalUrl')]"
],
"isAadAutoProvisioned": true,
"aadClientId": "[parameters('AADAuthClientId')]",
"openIdIssuer": "[parameters('openIdIssuer')]"
},
"tags": null,
"type": "Microsoft.Web/sites/config",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('apiAppName'))]"
]
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment