For my deployment I need to provide the primary key of the Azure Maps Account to my Frontend. The deployment is done with an azure resource manager template.
The key should be written in the output of the ARM template.
This can be achieved with the following code:
"outputs": {
"mapKey": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.Maps/accounts', variables('mapName')), providers('Microsoft.Maps', 'accounts').apiVersions[0]).primaryKey]",
"metadata": {
"description": "primary key for azure map"
}
}
}