如何使用Azure Resource Manager模板获取Azure Maps帐户的主键

问题描述 投票:1回答:1

对于我的部署,我需要将Azure地图帐户的主键提供给我的前端。部署使用azure资源管理器模板完成。

密钥应写在ARM模板的输出中。

azure azure-resource-manager arm-template azure-maps
1个回答
2
投票

这可以通过以下代码实现:

"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"
        }
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.