我正在使用ARM模板创建EventGrid API连接。它创建成功,但是,我仍然必须通过Azure门户手动对其进行身份验证。
这是我的ARM模板:
"resources": [
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('azureEventGridConnectionAPIName')]",
"location": "[resourceGroup().location]",
"properties": {
"api": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/', 'azureeventgrid')]"
},
"displayName": "[parameters('azureEventGridConnectionAPIName')]"
},
"dependsOn": []
}
]
我是否缺少模板中负责立即验证连接的某些内容?
是否可以使用例如Azure PowerShell对连接进行身份验证,以便我可以使该过程自动化?
答案 0 :(得分:2)
我是否缺少模板中负责立即验证连接的某些内容?
是的,我们可以在部署期间创建服务主体身份验证。以下是演示代码。
do $$
declare
var_A numeric;
begin
var_A := 14.141244804178488;
var_A := trunc(var_A ,2);
raise notice '%', var_A;
end;
$$ language plpgsql
Parameters.json
"resources": [
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('azureEventGridConnectionAPIName')]",
"location": "[resourceGroup().location]",
"properties": {
"api": {
"id": "[concat('/subscriptions/subscriptionId', '/providers/Microsoft.Web/locations/', 'eastasia', '/managedApis/', 'azureeventgrid')]"
},
"parameterValues": {
"token:clientId": "[parameters('clientId')]",
"token:clientSecret": "[parameters('clientSecret')]",
"token:TenantId": "[parameters('TenantId')]",
"token:grantType": "[parameters('grantType')]"
},
"displayName": "[parameters('azureEventGridConnectionAPIName')]"
},
"dependsOn": []
}
]