管理对 Azure 机器学习工作区的访问权限

本文介绍如何管理对 Azure 机器学习工作区的访问权限(授权)。 可以使用 Azure 基于角色的访问控制 (Azure RBAC) 来管理对 Azure 资源的访问权限,让用户能够创建新资源或使用现有资源。 Microsoft Entra ID 中的用户可获得特定角色,从而拥有资源访问权限。 Azure 提供内置角色和创建自定义角色的功能。

提示

虽然本文着重介绍的是 Azure 机器学习,但单独的服务也提供了它们自己的 RBAC 设置。 例如,使用本文中的信息,可以配置谁能向 Azure Kubernetes 服务上部署为 Web 服务的模型提交评分请求。 但 Azure Kubernetes 服务具有它自己的一组 Azure 角色。 有关对于 Azure 机器学习可能有用的服务特定的 RBAC 信息,请参阅以下链接:

警告

应用某些角色可能会限制 Azure 机器学习工作室中针对其他用户的 UI 功能。 例如,如果用户的角色无法创建计算实例,工作室中就不会提供创建计算实例的选项。 此行为是正常的,可以防止用户尝试会返回“拒绝访问”错误的操作。

默认角色

Azure 机器学习工作区具有默认可用的内置角色。 将用户添加到工作区时,可以为其分配以下角色之一。

角色 访问级别
AzureML 数据科学家 可以在 Azure 机器学习工作区中执行所有操作,但创建或删除计算资源及修改工作区本身除外。
AzureML 计算操作员 可以在工作区中创建、管理、删除和访问计算资源。
读者 工作区中的只读操作。 读取者可以在工作区中列出和查看资产,包括数据存储凭据。 读取者不能创建或更新这些资产。
参与者 在工作区中查看、创建、编辑或删除(如果适用)资产。 例如,参与者可以创建试验、创建或附加计算群集、提交运行和部署 Web 服务。
所有者 对工作区的完全访问权限,包括能够在工作区中查看、创建、编辑或删除(如果适用)资产。 此外,还可以更改角色分配。

此外,Azure 机器学习注册表具有 AzureML 注册表用户角色,该角色可以分配给注册表资源,以向数据科学家授予用户级权限。 若要获得管理员级权限来创建或删除注册表,请使用“参与者”或“所有者”角色。

角色 访问级别
AzureML 注册表用户 可以获取注册表并在其中读取、写入和删除资产。 无法创建新的注册表资源或删除它们。

可以组合角色以授予不同级别的访问权限。 例如,你可以授予工作区用户“AzureML 数据科学家”和“AzureML 计算操作员”的角色,使用户能够在以自助服务方式创建计算的同时执行实验。

重要

在 Azure 中,角色访问的作用域可以限定为多个级别。 例如,对工作区具有所有者访问权限的人可能没有对包含工作区的资源组的所有者访问权限。 有关详细信息,请参阅 Azure RBAC 工作原理

管理工作区访问权限

如果你是工作区的所有者,则可以为工作区添加和删除角色。 还可以将角色分配给用户。 使用以下链接了解如何管理访问权限:

例如,使用 Azure CLI 通过以下命令将参与者角色分配给资源组this-rgjoe@contoso.com

az role assignment create --role "Contributor" --assignee "joe@contoso.com" --resource-group this-rg

使用 Microsoft Entra 安全组管理工作区访问权限

可以使用 Microsoft Entra 安全组来管理对工作区的访问权限。 此方法提供以下优势:

  • 团队或项目主管能够以安全组所有者的身份管理用户对工作区的访问权限,而无需直接拥有工作区资源的所有者角色。
  • 能够以组的形式组织、管理和撤销用户对工作区和其他资源的权限,而无需管理每个用户的权限。

若要使用 Microsoft Entra 安全组,请执行以下操作:

  1. 创建一个安全组
  2. 添加组所有者。 此用户有权添加或删除组成员。 组所有者不必是组成员,也不必在工作区中拥有直接 RBAC 角色。
  3. 为该组分配工作区中的 RBAC 角色,例如 AzureML 数据科学家、读取者或参与者。
  4. 添加组成员。 成员可取得工作区的访问权限。

创建自定义角色

如果内置角色不够,可以创建自定义角色。 自定义角色可能具有该工作区中的读取、写入、删除和计算资源权限。 可以使角色在特定工作区级别、特定资源组级别或特定订阅级别可用。

注意

必须是该级别资源的所有者,才能在该资源中创建自定义角色。

要创建自定义角色,请首先构造角色定义 JSON 文件,指定角色的权限和作用域。 以下示例定义了“Data Scientist Custom”自定义角色,其作用域为特定工作区级别:

data_scientist_custom_role.json :

{
    "Name": "Data Scientist Custom",
    "IsCustom": true,
    "Description": "Can run experiment but can't create or delete compute.",
    "Actions": ["*"],
    "NotActions": [
        "Microsoft.MachineLearningServices/workspaces/*/delete",
        "Microsoft.MachineLearningServices/workspaces/write",
        "Microsoft.MachineLearningServices/workspaces/computes/*/write",
        "Microsoft.MachineLearningServices/workspaces/computes/*/delete", 
        "Microsoft.Authorization/*/write"
    ],
    "AssignableScopes": [
        "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.MachineLearningServices/workspaces/<workspaceName>"
    ]
}

提示

可以更改 AssignableScopes 字段,以在订阅级别、资源组级别或特定工作区级别设置此自定义角色的作用域。 上述自定义角色只是一个示例,请参阅我们建议的一些 Azure 机器学习服务自定义角色

此自定义角色可以在工作区中执行除以下操作之外的所有操作:

  • 删除工作区。
  • 它无法创建或更新工作区。
  • 它无法创建或更新计算资源。
  • 它无法删除计算资源。
  • 添加、删除或更改角色分配。

要部署此自定义角色,请使用以下 Azure CLI 命令:

az role definition create --role-definition data_scientist_custom_role.json

部署后,此角色在指定工作区中可用。 现在,可以在 Azure 门户中添加和分配此角色。

有关自定义角色的详细信息,请参阅 Azure 自定义角色

Azure 机器学习操作

有关可用于自定义角色的操作(Actions 和 NotActions)的详细信息,请参阅资源提供程序操作。 还可以使用以下 Azure CLI 命令来列出操作:

az provider operation show –n Microsoft.MachineLearningServices

列出自定义角色

在 Azure CLI 中运行以下命令:

az role definition list --subscription <subscriptionId> --custom-role-only true

若要查看特定自定义角色的角色定义,请使用以下 Azure CLI 命令。 <roleName> 的格式应与上一命令返回的格式相同:

az role definition list -n <roleName> --subscription <subscriptionId>

更新自定义角色

在 Azure CLI 中运行以下命令:

az role definition update --role-definition update_def.json --subscription <subscriptionId>

你需要对新角色定义的整个作用域具有权限。 例如,如果此新角色的作用域跨三个订阅,则你需要对所有三个订阅都具有权限。

注意

角色更新可能需要花费 15 分钟到一小时才能应用于该作用域中的所有角色分配。

使用 Azure 资源管理器模板实现可重复性

如果预计需要重新创建复杂的角色分配,则使用 Azure 资源管理器模板可能会很有帮助。 machine-learning-dependencies-role-assignment 模板显示了如何在源代码中指定角色分配以供重用。

常见方案

下表汇总了 Azure 机器学习活动以及在最小作用域内执行它们所需的权限。 例如,如果可以使用某个工作区作用域(第 4 列)执行某个活动,自然也可以使用具有该权限的所有更高的作用域。 对于某些活动,权限在 V1 API 和 V2 API 之间有所不同。

重要

此表中以 / 开头的所有路径都是相对于 Microsoft.MachineLearningServices/相对路径

活动 订阅级作用域 资源组级作用域 工作区级作用域
创建新工作区 1 不是必需 所有者或参与者 不适用(在创建后成为所有者或继承更高作用域角色)
请求订阅级别 Amlcompute 配额或设置工作区级别配额 所有者、参与者或自定义角色
允许 /locations/updateQuotas/action
(在订阅范围内)
未授权 未授权
新建计算群集 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/computes/write
新建计算实例 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/computes/write
提交任何类型的运行 (V1) 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/*/read/workspaces/environments/write/workspaces/experiments/runs/write/workspaces/metadata/artifacts/write/workspaces/metadata/snapshots/write/workspaces/environments/build/action/workspaces/experiments/runs/submit/action/workspaces/environments/readSecrets/action
提交任何类型的运行 (V2) 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/*/read/workspaces/environments/write/workspaces/jobs/*/workspaces/metadata/artifacts/write/workspaces/metadata/codes/*/write/workspaces/environments/build/action/workspaces/environments/readSecrets/action
发布管道和终结点 (V1) 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/endpoints/pipelines/*/workspaces/pipelinedrafts/*/workspaces/modules/*
发布管道和终结点 (V2) 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/endpoints/pipelines/*/workspaces/pipelinedrafts/*/workspaces/components/*
附加 AKS 资源 2 不是必需 包含 AKS 的资源组的所有者或参与者
在 AKS/ACI 资源上部署已注册的模型 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/services/aks/write/workspaces/services/aci/write
针对已部署的 AKS 终结点进行评分 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/services/aks/score/action/workspaces/services/aks/listkeys/action(未使用 Microsoft Entra 身份验证时)或 /workspaces/read(使用令牌身份验证时)
使用交互式笔记本访问存储 不是必需 不是必需 所有者、参与者或自定义角色允许:/workspaces/computes/read/workspaces/notebooks/samples/read/workspaces/notebooks/storage/*/workspaces/listStorageAccountKeys/action/workspaces/listNotebookAccessToken/read
创建新的自定义角色 所有者、参与者或自定义角色允许 Microsoft.Authorization/roleDefinitions/write 不是必需 所有者、参与者或自定义角色允许:/workspaces/computes/write
创建/管理联机终结点和部署 不是必需 若要在工作室上部署,Microsoft.Resources/deployments/write 所有者、参与者或自定义角色允许 Microsoft.MachineLearningServices/workspaces/onlineEndpoints/*
检索联机终结点的身份验证凭据 不是必需 不是必需 所有者、参与者或自定义角色允许:Microsoft.MachineLearningServices/workspaces/onlineEndpoints/token/actionMicrosoft.MachineLearningServices/workspaces/onlineEndpoints/listkeys/action
  1. 如果第一次尝试创建工作区时遇到失败,请确保角色允许 Microsoft.MachineLearningServices/register/action。 可以通过此操作将 Azure 机器学习资源提供程序注册到 Azure 订阅。

  2. 附加 AKS 群集时,还需要在群集上有 Azure Kubernetes 服务群集管理员角色

部署到虚拟网络或子网

  • 若要将资源部署到虚拟网络或子网中,你的用户帐户必须在 Azure 基于角色的访问控制 (Azure RBAC) 中具有以下操作的权限:

    • 虚拟网络资源上的“Microsoft.Network/*/read”。 对于 Azure 资源管理器 (ARM) 模板部署,不需要此权限。
    • “Microsoft.Network/virtualNetworks/join/action”(在虚拟网络资源上)。
    • "Microsoft.Network/virtualNetworks/subnets/join/action"(在子网资源上)。

    若要详细了解如何将 Azure RBAC 与网络配合使用,请参阅网络内置角色

V1 API 和 V2 API 的操作之间的差异

V1 API 和 V2 API 的操作之间存在一定差异。

资产 V1 API 的操作路径 V2 API 的操作路径
数据集 Microsoft.MachineLearningServices/workspaces/datasets Microsoft.MachineLearningServices/workspaces/datasets/versions
试验运行和作业 Microsoft.MachineLearningServices/workspaces/experiments Microsoft.MachineLearningServices/workspaces/jobs
模型 Microsoft.MachineLearningServices/workspaces/models Microsoft.MachineLearningServices/workspaces/models/versions
快照和代码 Microsoft.MachineLearningServices/workspaces/snapshots Microsoft.MachineLearningServices/workspaces/codes/versions
模块和组件 Microsoft.MachineLearningServices/workspaces/modules Microsoft.MachineLearningServices/workspaces/components

可以通过包括这两个操作或使用包含这两个操作的通配符(例如 Microsoft.MachineLearningServices/workspaces/datasets/*/read)使自定义角色与 V1 API 和 V2 API 兼容。

创建使用客户管理的密钥的工作区

使用客户管理的密钥 (CMK) 时,将使用 Azure Key Vault 来存储密钥。 用户或用于创建工作区的服务主体必须具有对密钥保管库的所有者或参与者访问权限。

在密钥保管库中,用户或服务主体必须具有通过密钥保管库访问策略创建、获取、删除和清除对密钥的访问权限。 有关详细信息,请参阅 Azure Key Vault 安全性

用户分配的托管标识与 Azure 机器学习计算群集

若要为 Azure 机器学习计算群集分配用户分配的标识,需要有写入权限来创建该计算,并且需要托管标识操作员角色。 若要详细了解如何将 Azure RBAC 与托管标识配合使用,请阅读如何管理用户分配的标识

MLflow 操作

若要在 Azure 机器学习工作区中执行 MLflow 操作,请使用自定义角色的以下范围:

MLflow 操作 范围
(V1) 列出、读取、创建、更新或删除试验 Microsoft.MachineLearningServices/workspaces/experiments/*
(V2) 列出、读取、创建、更新或删除作业 Microsoft.MachineLearningServices/workspaces/jobs/*
按名称获取已注册的模型,获取注册表中所有已注册模型的列表,搜索每个请求阶段的已注册模型、最新版模型,获取已注册模型的版本,搜索模型版本,获取 URI(其中存储了模型版本的项目),按试验 ID 搜索运行 Microsoft.MachineLearningServices/workspaces/models/*/read
创建新的已注册模型,更新已注册模型的名称/说明,重命名现有的已注册模型,创建新版本的模型,更新模型版本的说明,将已注册模型转换到其中一个阶段 Microsoft.MachineLearningServices/workspaces/models/*/write
删除已注册模型及其所有版本,删除已注册模型的特定版本 Microsoft.MachineLearningServices/workspaces/models/*/delete

自定义角色示例

数据科学家

允许数据科学家在工作区中执行所有操作,但以下操作除外

  • 创建计算
  • 将模型部署到生产 AKS 群集
  • 在生产环境中部署管道终结点

data_scientist_custom_role.json :

{
    "Name": "Data Scientist Custom",
    "IsCustom": true,
    "Description": "Can run experiment but can't create or delete compute or deploy production endpoints.",
    "Actions": [
        "Microsoft.MachineLearningServices/workspaces/*/read",
        "Microsoft.MachineLearningServices/workspaces/*/action",
        "Microsoft.MachineLearningServices/workspaces/*/delete",
        "Microsoft.MachineLearningServices/workspaces/*/write"
    ],
    "NotActions": [
        "Microsoft.MachineLearningServices/workspaces/delete",
        "Microsoft.MachineLearningServices/workspaces/write",
        "Microsoft.MachineLearningServices/workspaces/computes/*/write",
        "Microsoft.MachineLearningServices/workspaces/computes/*/delete", 
        "Microsoft.Authorization/*",
        "Microsoft.MachineLearningServices/workspaces/computes/listKeys/action",
        "Microsoft.MachineLearningServices/workspaces/listKeys/action",
        "Microsoft.MachineLearningServices/workspaces/services/aks/write",
        "Microsoft.MachineLearningServices/workspaces/services/aks/delete",
        "Microsoft.MachineLearningServices/workspaces/endpoints/pipelines/write"
    ],
    "AssignableScopes": [
        "/subscriptions/<subscriptionId>"
    ]
}

受限制的数据科学家

一个限制性更强的角色定义,允许的操作中不包含通配符。 它可以在工作区中执行所有操作,但以下操作除外

  • 创建计算
  • 将模型部署到生产 AKS 群集
  • 在生产环境中部署管道终结点

data_scientist_restricted_custom_role.json

{
    "Name": "Data Scientist Restricted Custom",
    "IsCustom": true,
    "Description": "Can run experiment but can't create or delete compute or deploy production endpoints",
    "Actions": [
        "Microsoft.MachineLearningServices/workspaces/*/read",
        "Microsoft.MachineLearningServices/workspaces/computes/start/action",
        "Microsoft.MachineLearningServices/workspaces/computes/stop/action",
        "Microsoft.MachineLearningServices/workspaces/computes/restart/action",
        "Microsoft.MachineLearningServices/workspaces/computes/applicationaccess/action",
        "Microsoft.MachineLearningServices/workspaces/notebooks/storage/write",
        "Microsoft.MachineLearningServices/workspaces/notebooks/storage/delete",
        "Microsoft.MachineLearningServices/workspaces/experiments/runs/write",
        "Microsoft.MachineLearningServices/workspaces/experiments/write",
        "Microsoft.MachineLearningServices/workspaces/experiments/runs/submit/action",
        "Microsoft.MachineLearningServices/workspaces/pipelinedrafts/write",
        "Microsoft.MachineLearningServices/workspaces/metadata/snapshots/write",
        "Microsoft.MachineLearningServices/workspaces/metadata/artifacts/write",
        "Microsoft.MachineLearningServices/workspaces/environments/write",
        "Microsoft.MachineLearningServices/workspaces/models/*/write",
        "Microsoft.MachineLearningServices/workspaces/modules/write",
        "Microsoft.MachineLearningServices/workspaces/components/*/write",
        "Microsoft.MachineLearningServices/workspaces/datasets/*/write", 
        "Microsoft.MachineLearningServices/workspaces/datasets/*/delete",
        "Microsoft.MachineLearningServices/workspaces/computes/listNodes/action",
        "Microsoft.MachineLearningServices/workspaces/environments/build/action"
    ],
    "NotActions": [
        "Microsoft.MachineLearningServices/workspaces/computes/write",
        "Microsoft.MachineLearningServices/workspaces/write",
        "Microsoft.MachineLearningServices/workspaces/computes/delete",
        "Microsoft.MachineLearningServices/workspaces/delete",
        "Microsoft.MachineLearningServices/workspaces/computes/listKeys/action",
        "Microsoft.MachineLearningServices/workspaces/listKeys/action",
        "Microsoft.Authorization/*",
        "Microsoft.MachineLearningServices/workspaces/datasets/registered/profile/read",
        "Microsoft.MachineLearningServices/workspaces/datasets/registered/preview/read",
        "Microsoft.MachineLearningServices/workspaces/datasets/unregistered/profile/read",
        "Microsoft.MachineLearningServices/workspaces/datasets/unregistered/preview/read",
        "Microsoft.MachineLearningServices/workspaces/datasets/registered/schema/read",    
        "Microsoft.MachineLearningServices/workspaces/datasets/unregistered/schema/read",
        "Microsoft.MachineLearningServices/workspaces/datastores/write",
        "Microsoft.MachineLearningServices/workspaces/datastores/delete"
    ],
    "AssignableScopes": [
        "/subscriptions/<subscriptionId>"
    ]
}

MLflow 数据科学家

允许数据科学家执行所有 MLflow Azure 机器学习支持的操作,但以下操作除外:

  • 创建计算
  • 将模型部署到生产 AKS 群集
  • 在生产环境中部署管道终结点

mlflow_data_scientist_custom_role.json :

{
    "Name": "MLFlow Data Scientist Custom",
    "IsCustom": true,
    "Description": "Can perform azureml mlflow integrated functionalities that includes mlflow tracking, projects, model registry",
    "Actions": [
        "Microsoft.MachineLearningServices/workspaces/experiments/*",
        "Microsoft.MachineLearningServices/workspaces/jobs/*",
        "Microsoft.MachineLearningServices/workspaces/models/*"
    ],
    "NotActions": [
        "Microsoft.MachineLearningServices/workspaces/delete",
        "Microsoft.MachineLearningServices/workspaces/write",
        "Microsoft.MachineLearningServices/workspaces/computes/*/write",
        "Microsoft.MachineLearningServices/workspaces/computes/*/delete", 
        "Microsoft.Authorization/*",
        "Microsoft.MachineLearningServices/workspaces/computes/listKeys/action",
        "Microsoft.MachineLearningServices/workspaces/listKeys/action",
        "Microsoft.MachineLearningServices/workspaces/services/aks/write",
        "Microsoft.MachineLearningServices/workspaces/services/aks/delete",
        "Microsoft.MachineLearningServices/workspaces/endpoints/pipelines/write"
    ],
    "AssignableScopes": [
        "/subscriptions/<subscriptionId>"
    ]
}

MLOps

允许将角色分配给服务主体,并使用该角色自动执行 MLOps 管道。 例如,若要针对已发布的管道提交运行,可使用以下代码:

mlops_custom_role.json :

{
    "Name": "MLOps Custom",
    "IsCustom": true,
    "Description": "Can run pipelines against a published pipeline endpoint",
    "Actions": [
        "Microsoft.MachineLearningServices/workspaces/read",
        "Microsoft.MachineLearningServices/workspaces/endpoints/pipelines/read",
        "Microsoft.MachineLearningServices/workspaces/metadata/artifacts/read",
        "Microsoft.MachineLearningServices/workspaces/metadata/snapshots/read",
        "Microsoft.MachineLearningServices/workspaces/environments/read",    
        "Microsoft.MachineLearningServices/workspaces/metadata/secrets/read",
        "Microsoft.MachineLearningServices/workspaces/modules/read",
        "Microsoft.MachineLearningServices/workspaces/components/read",       
        "Microsoft.MachineLearningServices/workspaces/datasets/*/read",
        "Microsoft.MachineLearningServices/workspaces/datastores/read",
        "Microsoft.MachineLearningServices/workspaces/environments/write",
        "Microsoft.MachineLearningServices/workspaces/experiments/runs/read",       
        "Microsoft.MachineLearningServices/workspaces/experiments/runs/write",
        "Microsoft.MachineLearningServices/workspaces/experiments/runs/submit/action",
        "Microsoft.MachineLearningServices/workspaces/experiments/jobs/read",       
        "Microsoft.MachineLearningServices/workspaces/experiments/jobs/write",
        "Microsoft.MachineLearningServices/workspaces/metadata/artifacts/write",
        "Microsoft.MachineLearningServices/workspaces/metadata/snapshots/write",
        "Microsoft.MachineLearningServices/workspaces/metadata/codes/*/write",       
        "Microsoft.MachineLearningServices/workspaces/environments/build/action",
    ],
    "NotActions": [
        "Microsoft.MachineLearningServices/workspaces/computes/write",
        "Microsoft.MachineLearningServices/workspaces/write",
        "Microsoft.MachineLearningServices/workspaces/computes/delete",
        "Microsoft.MachineLearningServices/workspaces/delete",
        "Microsoft.MachineLearningServices/workspaces/computes/listKeys/action",
        "Microsoft.MachineLearningServices/workspaces/listKeys/action",
        "Microsoft.Authorization/*"
    ],
    "AssignableScopes": [
        "/subscriptions/<subscriptionId>"
    ]
}

工作区管理员

允许在工作区范围中执行所有操作,但以下操作除外

  • 创建一个新工作区
  • 分配订阅或工作区级别配额

工作区管理员也无法创建新的角色, 而只能在其工作区的作用域内分配现有内置角色或自定义角色:

workspace_admin_custom_role.json :

{
    "Name": "Workspace Admin Custom",
    "IsCustom": true,
    "Description": "Can perform all operations except quota management and upgrades",
    "Actions": [
        "Microsoft.MachineLearningServices/workspaces/*/read",
        "Microsoft.MachineLearningServices/workspaces/*/action",
        "Microsoft.MachineLearningServices/workspaces/*/write",
        "Microsoft.MachineLearningServices/workspaces/*/delete",
        "Microsoft.Authorization/roleAssignments/*"
    ],
    "NotActions": [
        "Microsoft.MachineLearningServices/workspaces/write"
    ],
    "AssignableScopes": [
        "/subscriptions/<subscriptionId>"
    ]
}

数据标记

允许你定义一个只能在作用域内标记数据的角色:

labeler_custom_role.json :

{
    "Name": "Labeler Custom",
    "IsCustom": true,
    "Description": "Can label data for Labeling",
    "Actions": [
        "Microsoft.MachineLearningServices/workspaces/read",
        "Microsoft.MachineLearningServices/workspaces/labeling/projects/read",
        "Microsoft.MachineLearningServices/workspaces/labeling/projects/summary/read",
        "Microsoft.MachineLearningServices/workspaces/labeling/labels/read",
        "Microsoft.MachineLearningServices/workspaces/labeling/labels/write"   
    ],
    "NotActions": [        
    ],
    "AssignableScopes": [
        "/subscriptions/<subscriptionId>"
    ]
}

疑难解答

以下是使用 Azure RBAC 时需要注意的一些事项:

  • 你在 Azure 中创建资源(例如工作区)时,并不会直接成为该资源的所有者。 你的角色继承自你在该订阅中获得相应授权的最高范围角色。 例如,如果你是网络管理员,有权创建机器学习工作区,则会为你分配该工作区的网络管理员角色,而不是所有者角色。

  • 若要在工作区中执行配额操作,需要订阅级别的权限。 这意味着,只有当你在订阅作用域具有写入权限时,才能为你的托管计算资源设置订阅级配额或工作区级配额。

  • 若要在工作室上进行部署,需要 Microsoft.Resources/deployments/writeMicrosoft.MachineLearningServices/workspaces/onlineEndpoints/deployments/write。 对于 SDK/CLI 部署,需要 Microsoft.MachineLearningServices/workspaces/onlineEndpoints/deployments/write。 请联系工作区/资源组的所有者以获取其他权限。

  • 针对同一 Microsoft Entra 用户的两个角色分配具有冲突的 Actions/NotActions 部分时,如果操作在某个角色的 NotActions 中列出,但也在另一个角色中作为 Actions 列出,则此类操作可能不会生效。 若要详细了解 Azure 如何分析角色分配,请参阅 Azure RBAC 如何确定用户是否有权访问资源

  • 新的角色分配最多可能需要一小时才能在整个堆栈的缓存权限中生效。

后续步骤