azureblog.co.uk
← 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 ID5e0bd9bd-7b93-4f28-af87-19fc36ad61bd
CategoryAi-machine-learning
Actions3
Data actions16

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

PermissionWhat it allows
Microsoft.CognitiveServices/*/readAny read operation on anything under Microsoft.CognitiveServices
Microsoft.Authorization/roleAssignments/readGet information about a role assignment.
Microsoft.Authorization/roleDefinitions/readGet information about a role definition.

Data actions

PermissionWhat it allows
Microsoft.CognitiveServices/accounts/OpenAI/*/readAny read operation on anything under Microsoft.CognitiveServices/accounts/OpenAI
Microsoft.CognitiveServices/accounts/OpenAI/engines/completions/actionCreate a completion from a chosen model
Microsoft.CognitiveServices/accounts/OpenAI/engines/search/actionSearch for the most relevant documents using the current engine.
Microsoft.CognitiveServices/accounts/OpenAI/engines/generate/actionSample from the model via POST request.
Microsoft.CognitiveServices/accounts/OpenAI/deployments/audio/actionReturn the transcript or translation for a given audio file.
Microsoft.CognitiveServices/accounts/OpenAI/deployments/search/actionSearch for the most relevant documents using the current engine.
Microsoft.CognitiveServices/accounts/OpenAI/deployments/completions/actionCreate a completion from a chosen model.
Microsoft.CognitiveServices/accounts/OpenAI/deployments/chat/completions/actionCreates a completion for the chat message
Microsoft.CognitiveServices/accounts/OpenAI/deployments/realtime/actionCreates a realtime connection to the deployment.
Microsoft.CognitiveServices/accounts/OpenAI/deployments/extensions/chat/completions/actionCreates a completion for the chat message with extensions
Microsoft.CognitiveServices/accounts/OpenAI/deployments/embeddings/actionReturn the embeddings for a given prompt.
Microsoft.CognitiveServices/accounts/OpenAI/images/generations/actionCreate image generations.
Microsoft.CognitiveServices/accounts/OpenAI/video/generations/*/actionAny action on anything under Microsoft.CognitiveServices/accounts/OpenAI/video/generations
Microsoft.CognitiveServices/accounts/OpenAI/video/generations/*/deleteAny 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

PermissionWhat it allows
Microsoft.CognitiveServices/accounts/OpenAI/stored-completions/readQuery 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.

azure cli
az role assignment create \
  --assignee "jane.doe@contoso.com" \
  --role "Cognitive Services OpenAI User" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Cognitive Services OpenAI User" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
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?

kql · azure resource graph
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

Find the smallest role for a task →