Skip to content

Instantly share code, notes, and snippets.

@jessebarocio
Created December 10, 2018 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessebarocio/3f61830bb06cd483ef7911fb02f5aaaf to your computer and use it in GitHub Desktop.
Save jessebarocio/3f61830bb06cd483ef7911fb02f5aaaf to your computer and use it in GitHub Desktop.
Sample ARM template with outputs
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"cosmosAccountName": {
"type": "string"
}
},
"variables": {
"cosmosDbApiVersion": "2015-04-08"
},
"resources": [
{
"apiVersion": "[variables('cosmosDbApiVersion')]",
"type": "Microsoft.DocumentDB/databaseAccounts",
"kind": "GlobalDocumentDB",
"name": "[parameters('cosmosAccountName')]",
"location": "[resourceGroup().location]",
"properties": {
"databaseAccountOfferType": "Standard",
"locations": [
{
"locationName": "[resourceGroup().location]",
"failoverPriority": 0
}
]
}
}
],
"outputs": {
"cosmosAccountEndpoint": {
"type": "string",
"value": "[reference(concat('Microsoft.DocumentDB/databaseAccounts/', parameters('cosmosAccountName'))).documentEndpoint]"
},
"cosmosAccountKey": {
"type": "string",
"value": "[listKeys(concat('Microsoft.DocumentDB/databaseAccounts/', parameters('cosmosAccountName')), variables('cosmosDbApiVersion')).primaryMasterKey]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment