你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Azure OpenAI 支持 Azure 基于角色的访问控制(Azure RBAC),这是用于管理对 Azure 资源的单独访问的授权系统。 使用 Azure RBAC,可以根据不同团队成员对指定项目的需求,为其分配不同级别的权限。 有关详细信息,请参阅 Azure RBAC 文档。
将角色分配添加到 Azure OpenAI 资源
Azure RBAC 可以分配给 Azure OpenAI 资源。 若要授予对 Azure 资源的访问权限,可以添加角色分配。
In the Azure portal, search for Azure OpenAI.
Select Azure OpenAI, and navigate to your specific resource.
Note
你还可以为整个资源组、订阅或管理组设置 Azure RBAC。 要执行此操作,请选择所需的作用域级别,然后导航到所需的项目。 For example, selecting Resource groups and then navigating to a specific resource group.
在左窗格中选择 “访问控制”(IAM )。
Select Add, then select Add role assignment.
On the Role tab on the next screen, select a role you want to add.
On the Members tab, select a user, group, service principal, or managed identity.
在“审核 + 指派”选项卡上,选择“审核 + 指派”以进行角色分配。
几分钟后,将向目标分配所选作用域中的选定角色。 有关这些步骤的帮助,请参阅使用 Azure 门户分配 Azure 角色。
Azure OpenAI 角色
- 认知服务 OpenAI 用户
- 认知服务 OpenAI 参与者
- 认知服务参与者
- 认知服务使用情况读取者
Note
Subscription level Owner and Contributor roles are inherited and take priority over the custom Azure OpenAI roles applied at the Resource Group level.
本节介绍不同帐户和帐户组合能够为 Azure OpenAI 资源执行的常见任务。 To view the full list of available Actions and DataActions, an individual role is granted from your Azure OpenAI resource go Access control (IAM)>Roles> Under the Details column for the role you're interested in select View. By default the Actions radial button is selected. You need to examine both Actions and DataActions to understand the full scope of capabilities assigned to a role.
认知服务 OpenAI 用户
如果用户获授予对 Azure OpenAI 资源仅此角色的基于角色的访问权限,则其将能够执行以下常见任务:
✅ View the resource in Azure portal
✅ 在“密钥和终结点”下查看资源终结点
✅ 能够在 Azure AI Foundry 门户中查看资源和关联的模型部署。
✅ 能够查看可在 Azure AI Foundry 门户中部署的模型。
✅ 使用聊天、完成和 DALL-E(预览)操场体验,使用已部署到此 Azure OpenAI 资源的任何模型生成文本和图像。
✅ 使用 Microsoft Entra ID 执行推理 API 调用。
仅分配了此角色的用户无法:
❌ 创建新的 Azure OpenAI 资源
❌ 在“密钥和终结点”下查看/复制/再生成密钥
❌ 创建新的模型部署或编辑现有模型部署
❌ 创建/部署自定义微调模型
❌ 上传数据集进行微调
❌ 查看、查询、筛选存储的完成数据
❌ 访问配额
❌ 创建自定义内容筛选器
认知服务 OpenAI 贡献者
此角色拥有认知服务 OpenAI 用户的所有权限,还可以执行其他任务,如:
✅ 创建自定义微调模型
✅ 上传数据集进行微调
✅ 查看、查询、筛选存储的完成数据
✅ 创建新的模型部署或编辑现有模型部署 [于 2023 年秋季添加]
✅ 授予对助手 API 的访问权限
✅将数据源添加到 Azure OpenAI On Your Data。
仅分配了此角色的用户无法:
❌ 创建新的 Azure OpenAI 资源
❌ 在“密钥和终结点”下查看/复制/再生成密钥
❌ 访问配额
❌ 创建自定义内容筛选器
认知服务贡献者
此角色通常与其他角色一起在资源组级别获授予用户访问权限。 此角色本身将允许用户执行以下任务。
✅ 在分配的资源组中创建新 Azure OpenAI 资源。
✅ View resources in the assigned resource group in the Azure portal.
✅ 在“密钥和终结点”下查看资源终结点
✅ 在“密钥和终结点”下查看/复制/再生成密钥
✅能够在 Azure AI Foundry 门户中查看可用于部署的模型
✅ 使用聊天、完成和 DALL-E(预览)操场体验,使用已部署到此 Azure OpenAI 资源的任何模型生成文本和图像
✅ 创建自定义内容筛选器
✅将数据源添加到 Azure OpenAI On Your Data。
✅ 创建新的模型部署或编辑现有模型部署(通过 API)
✅ 创建自定义微调模型 [于 2023 年秋季添加]
✅ 上传数据集进行微调 [于 2023 年秋季添加]
✅(通过 Azure AI Foundry)创建新的模型部署或编辑现有模型部署[2023 年秋季添加]
✅ 查看、查询、筛选存储的完成数据
仅分配了此角色的用户无法:
❌ 访问配额
❌ 使用 Microsoft Entra ID 执行推理 API 调用。
认知服务使用情况读取者
查看配额需要“认知服务使用情况读取者”角色。 此角色提供查看 Azure 订阅中的配额使用情况所需的最小访问权限。
This role can be found in the Azure portal under Subscriptions> *Access control (IAM)>Add role assignment> search for Cognitive Services Usages Reader. 角色必须在订阅级别应用,但在资源级别不存在。
If you don't wish to use this role, the subscription Reader role provides equivalent access, but it also grants read access beyond the scope of what is needed for viewing quota. 通过 Azure AI Foundry 门户 进行模型部署也部分依赖于此角色的存在。
此角色本身几乎没有价值,而是通常与前面描述的一个或多个角色组合分配。
认知服务使用情况读取者 + 认知服务 OpenAI 用户
认知服务 OpenAI 用户的所有功能加上以下能力:
✅在 Azure AI Foundry 门户中查看配额分配
认知服务使用情况读取者 + 认知服务 OpenAI 参与者
认知服务 OpenAI 参与者的所有功能加上以下能力:
✅在 Azure AI Foundry 门户中查看配额分配
认知服务使用情况读取者 + 认知服务参与者
认知服务参与者的所有功能加上以下能力:
✅在 Azure AI Foundry 门户中查看和编辑配额分配
✅(通过 Azure AI Foundry)创建新的模型部署或编辑现有模型部署
Summary
Permissions | 认知服务 OpenAI 用户 | 认知服务 OpenAI 贡献者 | 认知服务贡献者 | 认知服务使用情况读取者 |
---|---|---|---|---|
在 Azure 门户中查看资源 | ✅ | ✅ | ✅ | ➖ |
在“密钥和终结点”下查看资源终结点 | ✅ | ✅ | ✅ | ➖ |
在 Azure AI Foundry 门户中查看资源和关联的模型部署 | ✅ | ✅ | ✅ | ➖ |
查看可在 Azure AI Foundry 门户中部署的模型 | ✅ | ✅ | ✅ | ➖ |
使用聊天、完成和 DALL-E(预览版)操场体验,使用已部署到此 Azure OpenAI 资源的任何模型。 | ✅ | ✅ | ✅ | ➖ |
创建或编辑模型部署 | ❌ | ✅ | ✅ | ➖ |
创建或部署自定义微调模型 | ❌ | ✅ | ✅ | ➖ |
上传数据集进行微调 | ❌ | ✅ | ✅ | ➖ |
查看、查询、筛选存储的完成数据 | ❌ | ✅ | ✅ | ➖ |
创建新的 Azure OpenAI 资源 | ❌ | ❌ | ✅ | ➖ |
在“密钥和终结点”下查看/复制/再生成密钥 | ❌ | ❌ | ✅ | ➖ |
创建自定义内容筛选器 | ❌ | ❌ | ✅ | ➖ |
为“关于您的数据”功能添加数据源 | ✅ | ✅ | ✅ | ➖ |
Access quota | ❌ | ❌ | ❌ | ✅ |
使用 Microsoft Entra ID 执行推理 API 调用 | ✅ | ✅ | ❌ | ➖ |
Common Issues
无法在 Azure AI Foundry 门户中查看 Azure 认知搜索选项
Issue:
当选择现有的 Azure 认知搜索资源时,搜索索引不会加载,加载轮会持续旋转。 在 Azure AI Foundry 门户中,转到助手设置下的“操场聊天”“添加数据(预览)”>。 选择“添加数据源”将打开允许通过 Azure 认知搜索或 Blob 存储添加数据源的模式。 选择 Azure 认知搜索选项和现有 Azure 认知搜索资源应加载可用的 Azure 认知搜索索引以从中进行选择。
Root cause
若要进行列出 Azure 认知搜索服务的通用 API 调用,请进行以下调用:
https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices?api-version=2021-04-01-Preview
将 {subscriptionId} 替换为实际订阅 ID。
For this API call, you need a subscription-level scope role. You can use the Reader role for read-only access or the Contributor role for read-write access. 如果只需要访问 Azure 认知搜索服务,则可以使用 Azure 认知搜索服务参与者或 Azure 认知搜索服务读取者角色。
Solution options
联系订阅管理员或所有者:联系管理 Azure 订阅的人员,请求适当的访问权限。 解释要求和需要的特定角色(例如,读取者、参与者、Azure 认知搜索服务参与者或 Azure 认知搜索服务读取者)。
请求订阅级别或资源组级别的访问权限:如果需要访问特定资源,则请求订阅所有者授予适当级别(订阅或资源组)的访问权限。 这样能够执行所需任务,而无需访问不相关的资源。
将 API 密钥用于 Azure 认知搜索:如果只需要与 Azure 认知搜索服务交互,则可以向订阅所有者请求管理密钥或查询密钥。 这些密钥允许直接对搜索服务进行 API 调用,而无需 Azure RBAC 角色。 Keep in mind that using API keys will bypass the Azure RBAC access control, so use them cautiously and follow security best practices.
无法在 Azure AI Foundry 门户中上传文件以使用基于你的数据功能
Symptom: Unable to access storage for the on your data feature using Azure AI Foundry.
Root cause:
尝试在 Azure AI Foundry 门户中访问 blob 存储的用户的订阅级访问权限不足。 The user may not have the necessary permissions to call the Azure Management API endpoint: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listAccountSas?api-version=2022-09-01
Azure 订阅的所有者出于安全原因禁用了对 blob 存储的公共访问。
API 调用所需的权限:**Microsoft.Storage/storageAccounts/listAccountSas/action:**
此权限允许用户列出指定存储帐户的共享访问签名 (SAS) 令牌。
Possible reasons why the user may not have permissions:
- 在 Azure 订阅中为用户分配了有限的角色,其不包括 API 调用所需的权限。
- 由于安全问题或组织策略,订阅所有者或管理员限制了用户的角色。
- 用户的角色最近已更改,新角色不授予所需权限。
Solution options
- 验证和更新访问权限:确保用户具有适当的订阅级访问权限,包括 API 调用所需的权限 (Microsoft.Storage/storageAccounts/listAccountSas/action)。 如果需要,请求订阅所有者或管理员授予必要的访问权限。
- 向所有者或管理员请求帮助:如果上述解决方案不可行,请考虑要求订阅所有者或管理员代表你上传数据文件。 This approach can help import the data into Azure AI Foundry without user requiring subscription-level access or public access to the blob storage.