azureblog.co.uk
← cd ~/roles
// roles/azure · containers

Container Apps OperatorAzure built-in role

Read, logstream and exec into Container Apps.

Role IDf3bd1b5c-91fa-40e7-afe7-0c11d331232c
CategoryContainers
Actions12
Data actions3

Before you assign it

  • It reaches the data, not just the resource. It has 3 data actions, such as reading blobs, secrets or messages.

What it can do

PermissionWhat it allows
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.Insights/alertRules/*Every operation under Microsoft.Insights/alertRules
Microsoft.App/containerApps/*/readAny read operation on anything under Microsoft.App/containerApps
Microsoft.App/containerApps/*/actionAny action on anything under Microsoft.App/containerApps
Microsoft.App/managedEnvironments/readGet a Managed Environment
Microsoft.App/managedEnvironments/*/readAny read operation on anything under Microsoft.App/managedEnvironments
Microsoft.App/managedEnvironments/join/actionAllows to create a Container App in a Managed Environment
Microsoft.App/managedEnvironments/checknameavailability/actionCheck reource name availability for a Managed Environment
Microsoft.App/connectedEnvironments/readGet a Connected Environment
Microsoft.App/connectedEnvironments/*/readAny read operation on anything under Microsoft.App/connectedEnvironments
Microsoft.App/connectedEnvironments/join/actionAllows to create a Container App or Container Apps Job in a Connected Environment
Microsoft.App/connectedEnvironments/checknameavailability/actionCheck reource name availability for a Connected Environment

Data actions

PermissionWhat it allows
Microsoft.App/containerApps/logstream/actionView log stream of a container app
Microsoft.App/containerApps/exec/actionConnect to console of a container app
Microsoft.App/containerApps/debug/actionConnect to debug console of a container app

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 "Container Apps Operator" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Container Apps Operator" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, 'f3bd1b5c-91fa-40e7-afe7-0c11d331232c')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f3bd1b5c-91fa-40e7-afe7-0c11d331232c')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "f3bd1b5c-91fa-40e7-afe7-0c11d331232c"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other containers roles

Find the smallest role for a task →