gpt4 book ai didi

azure - API 连接 - ARM 模板中的用户名和密码

转载 作者:行者123 更新时间:2023-12-03 05:44:22 24 4
gpt4 key购买 nike

我想在 ARM 模板中提供用户名和密码,以便在 Azure 中部署和填充该模板,并可以在 Azure 门户中的“编辑 API 连接”下查看。

enter image description here

这是 ARM 模板的一部分:

"resources": [
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_sql_name')]",
"location": "westeurope",
"properties": {
"displayName": "Test Connection Name",
"parameterValues": {
"server": "[parameters('sql_server')]",
"database": "[parameters('sql_database')]",
"authType": "[parameters('sql_authType')]",
"userName": "[parameters('username')",
"password": "[parameters('password')]"
},
"customParameterValues": {},
"api": {
"id": "[concat('/subscriptions/', subscription().subscriptionID, '/providers/Microsoft.Web/locations/westeurope/managedApis/sql')]"
}
}
}

服务器、数据库和 AuthType 已填充,但我无法获取要在部署中填充的用户名和密码参数。

最佳答案

“编辑 API 连接”页面不会显示用户名密码,因为它们的类型为securestring

引用:https://learn.microsoft.com/en-us/connectors/sql/#creating-a-connection enter image description here

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"connections_sql_name": {
"type": "string",
"defaultValue": "connections_sql_name"
},
"sql_server": {
"type": "string",
"defaultValue": "server201-dev-sql.database.windows.net"
},
"sql_database": {
"type": "string",
"defaultValue": "Incidents"
},
"sql_authType": {
"type": "string",
"defaultValue": "Windows"
},
"username": {
"type": "securestring",
},
"password": {
"type": "securestring"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_sql_name')]",
"location": "westeurope",
"properties": {
"displayName": "Test Connection Name",
"parameterValues": {
"server": "[parameters('sql_server')]",
"database": "[parameters('sql_database')]",
"authType": "[parameters('sql_authType')]",
"userName": "[parameters('username')]",
"password": "[parameters('password')]"
},
"customParameterValues": {},
"api": {
"id": "[concat('/subscriptions/', subscription().subscriptionID, '/providers/Microsoft.Web/locations/westeurope/managedApis/sql')]"
}
}
}
]
}

关于azure - API 连接 - ARM 模板中的用户名和密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55924101/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com