Instantly share code, notes, and snippets.

Embed
What would you like to do?
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