简体   繁体   English

ARM部署:获取Azure Function API密钥

[英]ARM Deployment: Get Azure Function API Key

As part of a Stream Analytics deployment solution I want to retrieve the API key for a Azure Function App in an ARM template via eg the listkeys() function. 作为Stream Analytics部署解决方案的一部分,我想通过例如listkeys()函数在ARM模板中检索Azure Function App的API密钥。 Is there a way to retrieve this key via an ARM template respectively during an ARM deployment and if yes, how? 有没有一种方法可以在ARM部署期间分别通过ARM模板检索此密钥,如果可以,如何?

Thanks 谢谢

This question has already been answered here: 这个问题已经在这里回答:

What is important in this context is to set the 'Minimum TLS Version' to '1.0' before deploying the job. 在这种情况下,重要的是在部署作业之前将“最低TLS版本”设置为“ 1.0”。 Otherwise you will get failures when testing the connection health. 否则,在测试连接状况时会失败。

The new Key Management API of Azure Functions has gone live. Azure Functions的新密钥管理API已启用。 Its possible via the following ARM Script. 通过以下ARM脚本可以实现。 Also check this Github issue 另请检查此Github问题

"variables": {
    "functionAppId": "[concat(parameters('functionAppResourceGroup'),'/providers/Microsoft.Web/sites/', parameters('functionAppName'))]"
},
"resources": [
    {
        "type": "Microsoft.KeyVault/vaults/secrets",
        "name": "[concat(parameters('keyVaultName'),'/', parameters('functionAppName'))]",
        "apiVersion": "2015-06-01",
        "properties": {
        "contentType": "text/plain",
        "value": "[listkeys(concat(variables('functionAppId'), '/host/default/'),'2016-08-01').functionKeys.default]"
        },
        "dependsOn": []
    }
]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM