Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created January 4, 2018 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save justinyoo/90addf3243a1368133cf5c56f5e42c5b to your computer and use it in GitHub Desktop.
Save justinyoo/90addf3243a1368133cf5c56f5e42c5b to your computer and use it in GitHub Desktop.
List of Access Keys from Output Values after ARM Template Deployment
{
"variables": {
"cosmosDbAccount": {
"name": "my-cosmos-db"
},
"resourceId": "[resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosDbAccount').name)]",
"apiVersion": "[providers('Microsoft.DocumentDB', 'databaseAccounts').apiVersions[0]]"
},
"resources": [],
"outputs": {
"documentEndpoint": {
"type": "string",
"value": "[reference(variables('resourceId'), variables('apiVersion')).documentEndpoint]"
},
"accountKey": {
"type": "string",
"value": "[listKeys(variables('resourceId'), variables('apiVersion')).primaryMasterKey]"
},
"connectionString": {
"type": "string",
"value": "[concat('AccountEndpoint=https://', variables('cosmosDbAccount').name, '.documents.azure.com:443/;AccountKey=', listKeys(variables('resourceId'), variables('apiVersion')).primaryMasterKey, ';')]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment