← cd ~/roles
// roles/azure · ai-machine-learning
Cognitive Services OpenAI UserAzure built-in role
Ability to view files, models, deployments. Readers can't make any changes They can inference and create images
| Role ID | 5e0bd9bd-7b93-4f28-af87-19fc36ad61bd |
|---|---|
| Category | Ai-machine-learning |
| Actions | 3 |
| Data actions | 16 |
Before you assign it
- It reaches the data, not just the resource. It has 16 data actions, such as reading blobs, secrets or messages.
What it can do
| Permission | What it allows |
|---|---|
Microsoft.CognitiveServices/*/read | Any read operation on anything under Microsoft.CognitiveServices |
Microsoft.Authorization/roleAssignments/read | Get information about a role assignment. |
Microsoft.Authorization/roleDefinitions/read | Get information about a role definition. |
Data actions
| Permission | What it allows |
|---|---|
Microsoft.CognitiveServices/accounts/OpenAI/*/read | Any read operation on anything under Microsoft.CognitiveServices/accounts/OpenAI |
Microsoft.CognitiveServices/accounts/OpenAI/engines/completions/action | Create a completion from a chosen model |
Microsoft.CognitiveServices/accounts/OpenAI/engines/search/action | Search for the most relevant documents using the current engine. |
Microsoft.CognitiveServices/accounts/OpenAI/engines/generate/action | Sample from the model via POST request. |
Microsoft.CognitiveServices/accounts/OpenAI/deployments/audio/action | Return the transcript or translation for a given audio file. |
Microsoft.CognitiveServices/accounts/OpenAI/deployments/search/action | Search for the most relevant documents using the current engine. |
Microsoft.CognitiveServices/accounts/OpenAI/deployments/completions/action | Create a completion from a chosen model. |
Microsoft.CognitiveServices/accounts/OpenAI/deployments/chat/completions/action | Creates a completion for the chat message |
Microsoft.CognitiveServices/accounts/OpenAI/deployments/realtime/action | Creates a realtime connection to the deployment. |
Microsoft.CognitiveServices/accounts/OpenAI/deployments/extensions/chat/completions/action | Creates a completion for the chat message with extensions |
Microsoft.CognitiveServices/accounts/OpenAI/deployments/embeddings/action | Return the embeddings for a given prompt. |
Microsoft.CognitiveServices/accounts/OpenAI/images/generations/action | Create image generations. |
Microsoft.CognitiveServices/accounts/OpenAI/video/generations/*/action | Any action on anything under Microsoft.CognitiveServices/accounts/OpenAI/video/generations |
Microsoft.CognitiveServices/accounts/OpenAI/video/generations/*/delete | Any delete operation on anything under Microsoft.CognitiveServices/accounts/OpenAI/video/generations |
Microsoft.CognitiveServices/accounts/OpenAI/assistants/* | Every operation under Microsoft.CognitiveServices/accounts/OpenAI/assistants |
Microsoft.CognitiveServices/accounts/OpenAI/responses/* | Every operation under Microsoft.CognitiveServices/accounts/OpenAI/responses |
Data actions it can't do
| Permission | What it allows |
|---|---|
Microsoft.CognitiveServices/accounts/OpenAI/stored-completions/read | Query completions data using filters or Get single completion data using completion Id or Get metadata for the given account |
Assign it
Scope it as tightly as you can: a resource or resource group rather than the whole subscription.
az role assignment create \
--assignee "jane.doe@contoso.com" \
--role "Cognitive Services OpenAI User" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Cognitive Services OpenAI User" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd')
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd')
principalId: principalId
}
}Who already has it?
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)Other ai-machine-learning roles
- AzureML Metrics Writer (preview) · 1 permission
- Cognitive Services Data Reader · 1 permission
- Cognitive Services Immersive Reader User · 1 permission
- Cognitive Services Usages Reader · 1 permission
- Search Index Data Reader · 1 permission
- AzureML Compute Operator · 2 permissions
- AzureML Registry User · 2 permissions
- Cognitive Services Custom Vision Contributor · 2 permissions