azureblog.co.uk
← cd ~/roles
// roles/azure · internet-of-things

Azure Device Registry ContributorAzure built-in role

Allows for full access to IoT devices within Azure Device Registry Namespace.

Role IDa5c3590a-3a1a-4cd4-9648-ea0a32b15137
CategoryInternet-of-things
Actions7
Data actions2

Before you assign it

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

What it can do

PermissionWhat it allows
microsoft.deviceregistry/namespaces/readList Namespace resources by subscription ID
microsoft.deviceregistry/namespaces/devices/*Every operation under microsoft.deviceregistry/namespaces/devices
microsoft.deviceregistry/namespaces/discovereddevices/*Every operation under microsoft.deviceregistry/namespaces/discovereddevices
microsoft.deviceregistry/namespaces/credentials/readList Credential resources by Namespace
microsoft.deviceregistry/namespaces/credentials/policies/readGet a Policy
microsoft.devices/iothubs/certificates/*Every operation under microsoft.devices/iothubs/certificates
microsoft.devices/iothubs/readGets the IotHub resource(s)

Data actions

PermissionWhat it allows
microsoft.deviceregistry/namespaces/credentials/policies/issueCertificate/actionAllows certificate issuance using certificate based policies.
microsoft.devices/iothubs/devices/*Every operation under microsoft.devices/iothubs/devices

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 "Azure Device Registry Contributor" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Azure Device Registry Contributor" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, 'a5c3590a-3a1a-4cd4-9648-ea0a32b15137')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a5c3590a-3a1a-4cd4-9648-ea0a32b15137')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "a5c3590a-3a1a-4cd4-9648-ea0a32b15137"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other internet-of-things roles

Find the smallest role for a task →