你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
注释
另一篇以 Foundry 项目为中心的 RBAC 文章可用: 适用于 Azure AI Foundry 的基于角色的访问控制。
本文介绍如何在 Azure AI Foundry 的中心和项目级别管理访问权限。 使用 Azure 基于角色的访问控制(Azure RBAC)管理对 Azure 资源的访问。 Azure 提供内置角色,并允许创建自定义角色。
Azure AI Foundry 中心与项目
在 Azure AI Foundry 门户中,有两个访问级别:中心和项目。 中心托管基础结构(包括虚拟网络设置、客户管理的密钥、托管标识和策略)。 可在其中配置 Azure AI 服务。 通过中心访问权限,可以修改基础结构、创建中心和创建项目。 项目是中心子集,充当用于生成和部署 AI 系统的工作区。 在项目中,可以开发流、部署模型和管理项目资产。 通过项目访问权限,可以在使用中心基础设施的同时端到端地构建和部署 AI。
这种中心与项目的关系的一个重要优势在于,开发人员能够创建继承中心安全设置的项目。 某些开发人员是项目的参与者,无法创建新项目。
中心的默认角色
Azure AI Foundry 中心具有默认可用的内置角色。
| 角色 | Description |
|---|---|
| 所有者 | 对中心的完全访问权限,包括管理中心、创建新中心以及分配权限的能力。 此角色会自动分配给中心创建者。 |
| 贡献者 | 用户对中心具有完全访问权限,包括创建新中心的能力,但无法管理现有资源中的中心权限。 |
| Azure AI 管理员 | 自动分配给中心的系统分配托管标识。 授予托管标识执行任务所需的最低权限。 |
| Azure AI 开发人员 | 执行除创建新中心或管理中心权限之外的所有操作。 用户可以在其项目中分配权限。 |
| Azure AI 推理部署操作员 | 执行在资源组内创建资源部署所需的所有操作。 |
| 读取者 | 对中心的只读访问权限。 此角色自动分配给中心中的所有项目成员。 |
“参与者”与“Azure AI 开发人员”之间的主要区别在于是否能够创建新的中心。 只有“所有者”和“参与者”角色才能创建中心。 自定义角色无法授予中心创建权限。
Azure AI 管理员角色
2024 年 11 月 19 日之后创建的中心将系统分配的托管标识分配给 Azure AI 管理员 角色,而不是 参与者。
{
"permissions": [
{
"actions": [
"Microsoft.Authorization/*/read",
"Microsoft.CognitiveServices/*",
"Microsoft.ContainerRegistry/registries/*",
"Microsoft.DocumentDb/databaseAccounts/*",
"Microsoft.Features/features/read",
"Microsoft.Features/providers/features/read",
"Microsoft.Features/providers/features/register/action",
"Microsoft.Insights/alertRules/*",
"Microsoft.Insights/components/*",
"Microsoft.Insights/diagnosticSettings/*",
"Microsoft.Insights/generateLiveToken/read",
"Microsoft.Insights/logDefinitions/read",
"Microsoft.Insights/metricAlerts/*",
"Microsoft.Insights/metricdefinitions/read",
"Microsoft.Insights/metrics/read",
"Microsoft.Insights/scheduledqueryrules/*",
"Microsoft.Insights/topology/read",
"Microsoft.Insights/transactions/read",
"Microsoft.Insights/webtests/*",
"Microsoft.KeyVault/*",
"Microsoft.MachineLearningServices/workspaces/*",
"Microsoft.Network/virtualNetworks/subnets/joinViaServiceEndpoint/action",
"Microsoft.ResourceHealth/availabilityStatuses/read",
"Microsoft.Resources/deployments/*",
"Microsoft.Resources/deployments/operations/read",
"Microsoft.Resources/subscriptions/operationresults/read",
"Microsoft.Resources/subscriptions/read",
"Microsoft.Resources/subscriptions/resourcegroups/deployments/*",
"Microsoft.Resources/subscriptions/resourceGroups/read",
"Microsoft.Resources/subscriptions/resourceGroups/write",
"Microsoft.Storage/storageAccounts/*",
"Microsoft.Support/*",
"Microsoft.Search/searchServices/write",
"Microsoft.Search/searchServices/read",
"Microsoft.Search/searchServices/delete",
"Microsoft.Search/searchServices/indexes/*",
"Microsoft.DataFactory/factories/*"
],
"notActions": [],
"dataActions": [],
"notDataActions": []
}
]
}
Azure AI 开发人员角色
{
"permissions": [
{
"actions": [
"Microsoft.MachineLearningServices/workspaces/*/read",
"Microsoft.MachineLearningServices/workspaces/*/action",
"Microsoft.MachineLearningServices/workspaces/*/delete",
"Microsoft.MachineLearningServices/workspaces/*/write",
"Microsoft.MachineLearningServices/locations/*/read",
"Microsoft.Authorization/*/read",
"Microsoft.Resources/deployments/*"
],
"notActions": [
"Microsoft.MachineLearningServices/workspaces/delete",
"Microsoft.MachineLearningServices/workspaces/write",
"Microsoft.MachineLearningServices/workspaces/listKeys/action",
"Microsoft.MachineLearningServices/workspaces/hubs/write",
"Microsoft.MachineLearningServices/workspaces/hubs/delete",
"Microsoft.MachineLearningServices/workspaces/featurestores/write",
"Microsoft.MachineLearningServices/workspaces/featurestores/delete"
],
"dataActions": [
"Microsoft.CognitiveServices/accounts/OpenAI/*",
"Microsoft.CognitiveServices/accounts/SpeechServices/*",
"Microsoft.CognitiveServices/accounts/ContentSafety/*"
],
"notDataActions": []
}
]
}
项目的默认角色
在授予用户访问项目权限时,系统还会在中心分配读者角色,并在资源组中分配推理部署操作员角色以允许进行部署。
| 角色 | Description |
|---|---|
| 所有者 | 对项目的完全访问权限,包括向项目用户分配权限的能力。 |
| 贡献者 | 完全访问权限,但无法分配权限。 |
| Azure AI 管理员 | 自动分配给中心托管标识。 |
| Azure AI 开发人员 | 创建部署;无法分配权限。 |
| Azure AI 推理部署操作员 | 创建资源部署所需的操作。 |
| 读取者 | 只读访问。 |
若要创建项目,角色必须包含在中心的 Microsoft.MachineLearningServices/workspaces/hubs/join 中(包含在 Azure AI 开发人员中)。
依赖项服务权限
| 许可 | 目的 |
|---|---|
Microsoft.Storage/storageAccounts/write |
创建/更新存储帐户。 |
Microsoft.KeyVault/vaults/write |
创建/更新密钥保管库。 |
Microsoft.CognitiveServices/accounts/write |
写入 API 帐户。 |
Microsoft.MachineLearningServices/workspaces/write |
创建/更新工作区。 |
中心的企业 RBAC 设置示例
| Persona | 角色 | 目的 |
|---|---|---|
| IT 管理员 | 所有者 | 确保集线器标准。 分配管理者角色。 |
| Managers | 参与者或 Azure AI 开发人员 | 管理中心、审核共享资源。 |
| 团队主管 | Azure AI 开发人员 | 创建项目和共享资源。 |
| Developers | 参与者或 Azure AI 开发人员(项目) | 生成和部署模型。 |
访问外部资源
在使用前,请确保在外部服务(例如存储、搜索)上向中心托管标识授予所需的角色。
管理访问权限
使用 Azure AI Foundry 门户(用户面板)或 Azure 门户中的 IAM / CLI 分配角色。
示例命令行界面 (CLI):
az role assignment create --role "Azure AI Developer" --assignee "user@contoso.com" --scope /subscriptions/<sub-id>/resourceGroups/<rg-name>
自定义角色
当内置角色不满足需求时定义自定义角色。 示例订阅级自定义角色摘录:
{
"properties": {
"roleName": "Azure AI Foundry Developer",
"description": "Custom role for Azure AI Foundry. At subscription level",
"assignableScopes": ["/subscriptions/<your-subscription-id>"],
"permissions": [ { "actions": ["Microsoft.MachineLearningServices/workspaces/write", "Microsoft.MachineLearningServices/workspaces/endpoints/write"], "notActions": [], "dataActions": ["Microsoft.CognitiveServices/accounts/OpenAI/*/read"], "notDataActions": [] } ]
}
}
在门户中分配角色
在管理中心中,选择中心或项目级别的 “用户 ”,然后选择 “新建用户”。
方案亮点
- 客户管理的密钥:授予工作区创建者对 Key Vault 的访问权限;如果使用用户分配的标识,请授予所需的数据平面权限。
- 具有 Microsoft Entra ID 的连接:分配所需的 Azure RBAC 角色(例如存储 Blob 数据参与者、搜索索引数据参与者)。
- Azure 容器注册表:使用系统分配的托管标识或将
ACRPull分配给用户分配的标识。 - Application Insights:在创建中心期间需要
Microsoft.Insights/Components/Write和Microsoft.OperationalInsights/workspaces/write。
Troubleshooting
如果使用 Azure AI 管理员身份角色的新中心遇到问题,可以暂时还原为参与者(有关详细步骤,请参阅原始文章)。