gpt4 book ai didi

azure - 资源所有者的行动组

转载 作者:行者123 更新时间:2023-12-03 01:40:34 25 4
gpt4 key购买 nike

在 Azure 门户上创建操作组时,您可以选择在操作组上创建操作,以通过电子邮件发送 Azure 资源管理器角色(例如所有者)。

尝试自动化每个订阅/资源组的操作组,我找不到任何有关如何通过 Powershell 或 CLI 创建此类接收器的文档。有标准的 EmailReceiver 和其他,但没有任何特定于特定资源组的角色。

目的是创建一个操作组,向所有者组中的每个人发送电子邮件。查看模板,对于所有接收者来说它也是空白的,没有指示它实际上在哪里定义了需要发送到的“角色”。

任何帮助将不胜感激。

enter image description here

最佳答案

如果我正确理解你的话。您可以尝试使用 armRoleReceivers 参数创建电子邮件 ARM 角色。执行此操作时,您可以将 name 值设置为与 emailReceivers 的名称以及操作组中的特定 roleId 相同。例如,如果要设置此内置所有者角色,则应设置 roleId 8e3af657-a8ff-443c-a75c-2fe8c4bcb635

应该是这样的:

"armRoleReceivers": [
{
"name": "string",
"roleId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635"
}
]

您可以找到microsoft.insights actionGroups template reference ,这是我这边工作的模板。

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"actionGroupName": {
"type": "string",
"metadata": {
"description": "Unique name (within the Resource Group) for the Action group."
}
},
"actionGroupShortName": {
"type": "string",
"metadata": {
"description": "Short name (maximum 12 characters) for the Action group."
}
}
},
"resources": [
{
"name": "[parameters('actionGroupName')]",
"type": "microsoft.insights/actionGroups",
"apiVersion": "2018-09-01",
"location": "Global",
"properties": {
"groupShortName": "[parameters('actionGroupShortName')]",
"enabled": true,
"emailReceivers": [
{
"name": "contosoEmail",
"emailAddress": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="610504170e111221020e0f150e120e4f020e0c" rel="noreferrer noopener nofollow">[email protected]</a>"
}
],
"smsReceivers": [
{
"name": "contosoSMS",
"countryCode": "1",
"phoneNumber": "555555"
}
],
"armRoleReceivers": [
{
"name": "contosoEmail",
"roleId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635"
}
]
}
}
]
}

enter image description here

关于azure - 资源所有者的行动组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54086890/

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