Azure resource manager 使用ARM检索存储帐户连接字符串

Azure resource manager 使用ARM检索存储帐户连接字符串,azure-resource-manager,Azure Resource Manager,我不熟悉编写Azure资源管理器模板;我需要检索Azure存储帐户连接字符串。我可以使用[listKeys(variables('storageAccountId'),'2019-04-01').keys[0].value]检索它的访问密钥,其中storageAccountId是[resourceId('Microsoft.Storage/storageAccounts',parameters('storageAccountName'))],但我无法对连接字符串(主)进行检索 现在,我的问题是,

我不熟悉编写Azure资源管理器模板;我需要检索Azure存储帐户连接字符串。我可以使用
[listKeys(variables('storageAccountId'),'2019-04-01').keys[0].value]
检索它的访问密钥,其中
storageAccountId
[resourceId('Microsoft.Storage/storageAccounts',parameters('storageAccountName'))]
,但我无法对连接字符串(主)进行检索


现在,我的问题是,我们有
listKeys
函数来检索访问键,我们是否也有一些系统函数来检索连接字符串?或者我们需要连接并创建连接字符串吗?我有存储帐户名和资源组名的值。如何使用ARM实现这一点?

根据我的研究,Azure ARM模板不提供用于列出存储帐户连接字符串的功能。我们只需配置模板函数来列出访问密钥(
listkeys
)列表帐户SAS令牌(
listAccountSas
)或列表服务SAS令牌(
listServiceSas
)。有关更多详细信息,请参阅

因此,如果您想要获取存储帐户连接字符串,我建议您使用Azure ARM模板函数来组合连接字符串。比如说

"outputs": {  
        "storageAccountConnectionString": {  
            "type": "string",  
            "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(resourceId(parameters('resourceGroupName'),'Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-04-01').keys[0].value,';EndpointSuffix=core.windows.net')]"  
        },

        }  
    }