← 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 ID | a5c3590a-3a1a-4cd4-9648-ea0a32b15137 |
|---|---|
| Category | Internet-of-things |
| Actions | 7 |
| Data actions | 2 |
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
| Permission | What it allows |
|---|---|
microsoft.deviceregistry/namespaces/read | List 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/read | List Credential resources by Namespace |
microsoft.deviceregistry/namespaces/credentials/policies/read | Get a Policy |
microsoft.devices/iothubs/certificates/* | Every operation under microsoft.devices/iothubs/certificates |
microsoft.devices/iothubs/read | Gets the IotHub resource(s) |
Data actions
| Permission | What it allows |
|---|---|
microsoft.deviceregistry/namespaces/credentials/policies/issueCertificate/action | Allows 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.
az role assignment create \
--assignee "jane.doe@contoso.com" \
--role "Azure Device Registry Contributor" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Azure Device Registry Contributor" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"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?
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
- Azure Device Registry Administrator · 1 permission
- Device Provisioning Service Data Contributor · 1 permission
- Device Provisioning Service Data Reader · 1 permission
- IoT Hub Data Contributor · 1 permission
- IoT Hub Registry Contributor · 1 permission
- IoT Hub Twin Contributor · 1 permission
- IoT Hub Data Reader · 2 permissions
- Azure Device Registry Credentials Contributor · 3 permissions