Use Roles To Control Resource Access: Built-In Roles For Azure Resources (Uses Powershell)
Use Roles To Control Resource Access: Built-In Roles For Azure Resources (Uses Powershell)
Docs / Learn / Browse / Manage users and groups in Azure Active Directory / Use roles to control resource access
200 XP
Role definitions
Each role is a set of properties defined in a JavaScript Object Notation (JSON) file. This role definition includes a Name, ID, and Description. It
also includes the allowable permissions (Actions), denied permissions (NotActions), and scope (for example, read access) for the role.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
For the Owner role, that means all actions, indicated by an asterisk (*); no denied actions; and all scopes, indicated by a forward slash (/).
You can get this information using the PowerShell Get-AzRmRoleDefinition cmdlet.
PowerShell = Copy
Get-AzRoleDefinition
Output = Copy
Name : Owner
Id : 8e3af657-a8ff-443c-a75c-2fe8c4bcb635
IsCustom : False
Description : Lets you manage everything, including access to resources.
Actions : {*}
NotActions : {}
DataActions : {}
NotDataActions : {}
AssignableScopes : {/}
Try the same for the Contributor and Reader roles to see the actions allowed and denied.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
. Select Resource groups from the left nav bar.
. Select the resource group.
. Select the Access control (IAM) item from the sidebar menu.
. Select the Roles tab as shown below to see the list of available roles.
AssignableScopes Scopes where this role applies. / indicates global, but can reach into a hierarchical tree.
[]
This structure is represented as JSON when used in role-based access control (RBAC) or from the underlying API. For example, here's the
Contributor role definition in JSON format.
JSON = Copy
{
"Name": "Contributor",
"Id": "b24988ac-6180-42a0-ab88-20f7382dd24c",
"IsCustom": false,
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
"Description": "Lets you manage everything except access to resources.",
"Actions": [
"*"
],
"NotActions": [
"Microsoft.Authorization/*/Delete",
"Microsoft.Authorization/*/Write",
"Microsoft.Authorization/elevateAccess/Action"
],
"DataActions": [],
"NotDataActions": [],
"AssignableScopes": [
"/"
]
}
As an example, here are the actions for the three roles we looked at previously.
Built-in Role Actions NotActions
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Built-in Role Actions NotActions
The wildcard ( * ) operation under Actions indicates that the principal assigned to this role can perform all actions, or in other words, it can
manage everything. Including actions defined in the future, as Azure adds new resource types. With the Reader role, only the read action is
allowed.
The operations under NotActions are subtracted from Actions . With the Contributor role, NotActions removes this role's ability to
manage access to resources and also assign access to resources.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
These actions work exactly like their management cousins. You specify actions you want to allow (or * for all) and then provide a list of
specific actions to remove in the NotDataActions collection. Here are some examples, you can find the full list of actions and data actions in
the resource provider documentation:
Data operation Description
Assignable Scopes
Defining the Actions and NotActions properties is not enough to fully implement a role. You also need to properly scope your role.
The AssignableScopes property of the role specifies the scopes (subscriptions, resource groups, or resources) within which the role is
available for assignment. You can make the custom role available for assignment just in the subscriptions or resource groups that need it,
thus avoiding cluttering the user experience for the rest of the subscriptions or resource groups.
Here are some examples.
To Use Scope
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
To Use Scope
Creating roles
Azure AD comes with built-in roles that are likely to cover 99% of what you'll ever want to do. It is preferable to use a built-in role if possible.
However, you can create custom roles if you find it necessary.
7 Note
Custom role creation requires Azure AD Premium P1 or P2 and cannot be done in the free tier.
Azure Graph API. You can use a REST call to the Graph API to programmatically create a new role.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
The summary includes a link to the documentation for all three approaches.
2. Which of the following sets the scope of a role to be the resource group myResourceGroup ?
/subscriptions/de324015-0284-4582-9d9c-6f1e52a30471
/subscriptions/{ef67bd4f-d0f2-4845-b6dd-6cba225b4f10}/resourceGroups/myResourceGroup/backupvm1
/subscriptions/{ef67bd4f-d0f2-4845-b6dd-6cba225b4f10}/resourceGroups/myResourceGroup
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Need help? See our troubleshooting guide or provide specific feedback by reporting an issue.
Previous Version Docs Blog Contribute Privacy & Cookies Terms of Use Trademarks © Microsoft 2021
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD