管理對 Azure Machine Learning 工作區的存取

本文說明如何管理 Azure Machine Learning 工作區的存取權 (授權)。 您可以使用 Azure 角色型存取控制 (Azure RBAC) 管理 Azure 資源的存取權,例如是否能夠建立新資源或使用現有資源。 Microsoft Entra ID 中的使用者會獲派特定角色,以便向其授與資源的存取權。 Azure 會同時提供內建角色以及可以建立自訂角色的能力。

提示

雖然本文著重在 Azure Machine Learning,但個別服務會提供自己的 RBAC 設定。 例如,使用本文中的資訊可讓您設定誰可以提交評分要求給在 Azure Kubernetes Service 上部署為 Web 服務的模型。 但 Azure Kubernetes Service 會提供一組自己的 Azure 角色。 如需可能會對 Azure Machine Learning 有用的服務特定 RBAC 資訊,請參閱下列連結:

警告

套用某些角色可能會限制其他使用者在 Azure Machine Learning 工作室中的 UI 功能。 例如,如果使用者的角色沒有建立計算執行個體的能力,則無法在工作室中使用建立計算執行個體的選項。 這是預期的行為,可防止使用者嘗試執行會傳回拒絕存取錯誤的作業。

預設角色

Azure Machine Learning 工作區有預設可用的內建角色。 將使用者新增至工作區時,可為其指派下列任一角色。

角色 存取層級
AzureML 資料科學家 可以在 Azure Machine Learning 工作區內執行所有動作,但建立或删除計算資源以及修改工作區本身除外。
AzureML 計算運算子 可以建立、管理、刪除和存取工作區內的計算資源。
讀取者 工作區中的唯讀動作。 讀者可以列出和檢視資產,包括工作區中的資料存放區認證。 讀者無法刪除或更新這些資產。
參與者 在工作區中檢視、建立、編輯或刪除 (如果適用) 資產。 例如,參與者可以建立實驗、建立或連結計算叢集、提交執行,以及部署 Web 服務。
擁有者 可完整存取工作區,包括能夠在工作區中檢視、建立、編輯或刪除 (如果適用) 資產。 此外,您可以變更角色指派。

此外,Azure Machine Learning 登錄有 AzureML 登錄使用者角色,可指派給登錄資源,以授與資料科學家使用者等級權限。 若要讓管理員等級的權限建立或刪除登錄,請使用參與者或擁有者角色。

角色 存取層級
AzureML 登錄使用者 可以取得登錄,以及讀取、寫入和刪除其中的資產。 無法建立新的登錄資源或加以刪除。

您可以結合角色來授與不同等級的存取權。 例如,您可以同時授與工作區使用者 AzureML 資料科學家和 Azure ML 計算操作員角色,以允許使用者在以自助式方式建立計算時執行實驗。

重要

您可以將角色存取權的範圍限制在 Azure 中的多個層級。 例如,具有工作區擁有者存取權的人員,可能沒有該工作區所屬資源群組的擁有者存取權。 如需詳細資訊,請參閱 Azure RBAC 的運作方式

管理工作區存取

如果您是工作區的擁有者,您可以新增和移除工作區的角色。 您也可以將角色指派給使用者。 請使用下列連結來探索如何管理存取:

例如,使用 Azure CLI 透過以下指令將資源群組 this-rg參與者角色指派給 joe@contoso.com

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

使用 Microsoft Entra 安全性群組管理工作區存取

您可以使用 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 Machine Learning 服務所建議的一些自訂角色

此自訂角色可以在工作區中執行所有作業,但下列動作除外:

  • 其無法刪除工作區。
  • 其無法建立或更新工作區。
  • 其無法建立或更新計算資源。
  • 其無法刪除計算資源。
  • 其無法新增、刪除或改變角色指派。

若要部署此自訂角色,請使用下列 Azure CLI 命令:

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

部署之後,此角色便會在指定的工作區中變為可用狀態。 現在您可以在 Azure 入口網站中新增和指派此角色。

如需自訂角色的詳細資訊,請參閱 Azure 自訂角色

Azure Machine Learning 作業

如需自訂角色可用作業 (動作和非動作) 的詳細資訊,請參閱資源提供者作業。 您也可以使用下列 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 Resource Manager 範本來實現重複使用的目的

如果您預期會有重新建立複雜角色指派的必要,Azure Resource Manager 範本會極為有用。 machine-learning-dependencies-role-assignment template 會說明如何在原始程式碼中指定角色指派以供重複使用。

常見案例

下表摘要列出了 Azure Machine Learning 活動,以及在最少的範圍內執行這些活動所需的權限。 例如,如果可以使用工作區範圍 (資料行 4) 執行活動,則所有具有該權限的較高範圍也會自動運作。 對於特定活動,權限在 V1 和 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 Machine Learning 資源提供者。

  2. 連結 AKS 叢集時,您也需要叢集上的 Azure Kubernetes Service 叢集管理員角色

部署至虛擬網路或子網路中

  • 若要將資源部署到虛擬網路或子網路,在 Azure 角色型存取控制 (Azure RBAC) 中,您的使用者帳戶必須具有下列動作的權限:

    • 虛擬網路資源上的 "Microsoft.Network/*/read"。 Azure Resource Manager (ARM) 範本部署不需要此權限。
    • 虛擬網路資源上的 "Microsoft.Network/virtualNetworks/join/action"。
    • 子網路資源上的 "Microsoft.Network/virtualNetworks/subnets/join/action"。

    如需 Azure RBAC 搭配網路的詳細資訊,請參閱網路內建角色

V1 和 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

您可以同時包含這兩個動作或使用包含這兩個動作的萬用字元,讓自訂角色與 V1 和 V2 API 相容,例如 Microsoft.MachineLearningServices/workspaces/datasets/*/read

使用客戶自控金鑰建立工作區

使用客戶自控金鑰 (CMK) 時,會使用 Azure Key Vault 來儲存金鑰。 用來建立工作區的使用者或服務主體必須擁有金鑰保存庫的擁有者或參與者存取權。

如果您的工作區已設定為 使用者指派的受控識別,則必須將身分識別授與下列角色。 這些角色可讓受控識別建立使用客戶管理密鑰時所使用的 Azure 儲存體、Azure Cosmos DB 和 Azure 搜尋服務資源:

  • Microsoft.Storage/storageAccounts/write
  • Microsoft.Search/searchServices/write
  • Microsoft.DocumentDB/databaseAccounts/write

在金鑰保存庫中,使用者或服務主體必須透過金鑰保存庫存取原則建立、取得、刪除和清除金鑰的存取權。 如需詳細資訊,請參閱 Azure Key Vault 安全性

Azure Machine Learning 計算叢集的使用者指派受控識別

若要將使用者指派的身分識別指派給 Azure Machine Learning 計算叢集,您需要有寫入權限以便建立計算和受控識別操作員角色。 如需 Azure RBAC 與受控識別的詳細資訊,請參閱如何管理使用者指派的身分識別

MLflow 作業

若要使用 Azure Machine Learning 工作區來執行 MLflow 作業,請為您的自訂角色使用下列範圍:

MLflow 作業 範圍
(V1) 清單、讀取、建立、更新或刪除實驗 Microsoft.MachineLearningServices/workspaces/experiments/*
(V2) 清單、讀取、建立、更新或刪除作業 Microsoft.MachineLearningServices/workspaces/jobs/*
依名稱取得已註冊的模型、擷取登錄中所有已註冊模型的清單、搜尋已註冊的模型、每個要求階段的最新版本模型、取得已註冊模型的版本、搜尋模型版本、取得模型版本成品存放所在的 URI、依實驗識別碼來搜尋執行 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/connections/listsecrets/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 Machine Learning 所支援的所有作業,但下列作業除外

  • 建立計算
  • 將模型部署到生產 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>"
    ]
}

資料標記

數據標籤標有內建角色,僅限於標記數據。 下列自定義角色為數據標記專案提供其他層級的存取權。

卷標小組負責人可讓您檢閱和拒絕已標記的數據集,以及檢視標籤的資料集,以及檢視標籤標籤解析。 除此之外,此角色也可讓您執行標記者的角色。

labeling_team_lead_custom_role.json

{
    "Name": "Labeling Team Lead",
    "IsCustom": true,
    "Description": "Team lead for Labeling Projects",
    "Actions": [
        "Microsoft.MachineLearningServices/workspaces/read",
        "Microsoft.MachineLearningServices/workspaces/labeling/labels/read",
        "Microsoft.MachineLearningServices/workspaces/labeling/labels/write",
        "Microsoft.MachineLearningServices/workspaces/labeling/labels/reject/action",
        "Microsoft.MachineLearningServices/workspaces/labeling/labels/update/action",
        "Microsoft.MachineLearningServices/workspaces/labeling/projects/read",
        "Microsoft.MachineLearningServices/workspaces/labeling/projects/summary/read"
    ],
    "NotActions": [
        "Microsoft.MachineLearningServices/workspaces/labeling/projects/write",
        "Microsoft.MachineLearningServices/workspaces/labeling/projects/delete",
        "Microsoft.MachineLearningServices/workspaces/labeling/export/action"
    ],
    "AssignableScopes": [
        "/subscriptions/<subscriptionId>"
    ]
}

疑難排解

以下是使用 Azure RBAC 時應注意的事項:

  • 在 Azure 中建立資源時 (例如工作區),您不會直接成為資源的擁有者。 您的角色繼承自您在該訂用帳戶中被授權的最高範圍角色。 舉例來說,如果您是網路管理員,並且擁有建立 Machine Learning 工作區的權限,系統就會將該工作區的網路管理員角色指派給您,而非擁有者角色。

  • 若要在工作區中執行配額作業,您需要訂用帳戶層級權限。 這表示,您必須擁有訂用帳戶範圍的寫入權限,系統才會為您的受控計算資源設定訂用帳戶層級配額或工作區層級配額。

  • 若要在工作室部署,您需要 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 如何判斷使用者是否有權存取資源

  • 有時可能需要一小時的時間,新的角色指派才會對整個堆疊的快取權限生效。

下一步