You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the New-AzureRMRoleAssignment command to grant access.
85
+
The **New-AzureRMRoleAssignment** cmdlet assigns the specified RBAC role to the specified principal, at the specified scope.
86
+
86
87
Access is granted by assigning the appropriate RBAC role to them at the right scope.
87
88
To grant access to the entire subscription, assign a role at the subscription scope.
88
89
To grant access to a specific resource group within a subscription, assign a role at the resource group scope.
89
90
90
91
The subject of the assignment must be specified.
91
-
To specify a user, use SignInName or Azure AD ObjectId parameters.
92
-
To specify a security group, use Azure AD ObjectId parameter.
93
-
And to specify an Azure AD application, use ServicePrincipalName or ObjectId parameters.
92
+
To specify a user, use the *SignInName* or *ObjectId* parameters.
93
+
To specify a security group, use the *ObjectId* parameter.
94
+
And to specify an Azure AD application, use the *ServicePrincipalName* or *ObjectId* parameters.
94
95
95
-
The role that is being assigned must be specified using the RoleDefinitionName parameter.
96
+
The role that is being assigned must be specified using the *RoleDefinitionName* parameter.
96
97
97
98
The scope at which access is being granted may be specified.
98
99
It defaults to the selected subscription.
99
-
The scope of the assignment can be specified using one of the following parameter combinations
100
-
a.
101
-
Scope - This is the fully qualified scope starting with /subscriptions/\<subscriptionId\>
102
-
b.
103
-
ResourceGroupName - to grant access to the specified resource group.
104
-
c.
105
-
ResourceName, ResourceType, ResourceGroupName and (optionally) ParentResource - to specify a particular resource within a resource group to grant access to.
100
+
The scope of the assignment can be specified using one of the following parameter combinations:
101
+
102
+
-*Scope* - This is the fully qualified scope starting with /subscriptions/\<subscriptionId\>
103
+
104
+
-*ResourceGroupName* - to grant access to the specified resource group.
105
+
106
+
-*ResourceName*, *ResourceType*, *ResourceGroupName*, and *ParentResource* - to specify a particular resource within a resource group to grant access to.
Creates an assignment that is effective at the specified resource group.
258
-
When used in conjunction with ResourceName, ResourceType and (optionally)ParentResource parameters, the command constructs a hierarchical scope in the form of a relative URI that identifies a resource.
260
+
When used in conjunction with the *ResourceName*, *ResourceType*, and *ParentResource* parameters, the command constructs a hierarchical scope in the form of a relative URI that identifies a resource.
Should only be used in conjunction with ResourceGroupName, ResourceType and (optionally)ParentResource parameters to construct a hierarchical scope in the form of a relative URI that identifies a resource.
275
+
Specifies the name of the resource.
276
+
277
+
This parameter should only be used in conjunction with the *ResourceGroupName*, *ResourceType*, and *ParentResource* parameters to construct a hierarchical scope in the form of a relative URI that identifies a resource.
Should only be used in conjunction with ResourceGroupName, ResourceName and (optionally)ParentResource parameters to construct a hierarchical scope in the form of a relative URI that identifies a resource.
292
+
Specifies the resource type.
293
+
294
+
This parameter should only be used in conjunction with the *ResourceGroupName*, *ResourceName*, and *ParentResource* parameters to construct a hierarchical scope in the form of a relative URI that identifies a resource.
The parent resource in the hierarchy(of the resource specified using ResourceName parameter).
310
-
Should only be used in conjunction with ResourceGroupName, ResourceType and ResourceName parameters to construct a hierarchical scope in the form of a relative URI that identifies a resource.
309
+
Specifies the parent resource in the hierarchy(of the resource specified using the *ResourceName* parameter).
310
+
This parameter should only be used in conjunction with the *ResourceGroupName*, *ResourceType*, and *ResourceName* parameters to construct a hierarchical scope in the form of a relative URI that identifies a resource.
The New-AzureRmRoleDefinition cmdlet creates a custom role in Azure Role-Based Access Control.
33
-
Provide a role definition as an input to the command as a JSON file or a PSRoleDefinition object.
29
+
The **New-AzureRmRoleDefinition** cmdlet creates a custom role in Azure Role-Based Access Control.
30
+
Provide a role definition as an input to the command as a JSON file or a **PSRoleDefinition** object.
34
31
35
32
The input role definition MUST contain the following properties:
36
33
37
-
1) DisplayName: the name of the custom role
34
+
- DisplayName: the name of the custom role
38
35
39
-
2) Description: a short description of the role that summarizes the access that the role grants.
36
+
- Description: a short description of the role that summarizes the access that the role grants.
40
37
41
-
3) Actions: the set of operations to which the custom role grants access.
38
+
- Actions: the set of operations to which the custom role grants access.
42
39
Use Get-AzureRmProviderOperations to get the operation for Azure resource providers that can be secured using Azure RBAC.
43
40
Following are some valid operation strings:
44
41
- "*/read" grants access to read operations of all Azure resource providers.
45
42
- "Microsoft.Network/*/read" grants access to read operations for all resource types in the Microsoft.Network resource provider of Azure.
46
43
- "Microsoft.Compute/virtualMachines/*" grants access to all operations of virtual machines and its child resource types.
47
44
48
-
4) AssignableScopes: the set of scopes (Azure subscriptions or resource groups) in which the custom role will be available for assignment.
49
-
Using AssignableScopes you can make the custom role available for assignment in only the subscriptions or resource groups that need it, and not clutter the user experience for the rest of the subscriptions or resource groups.
45
+
- AssignableScopes: the set of scopes (Azure subscriptions or resource groups) in which the custom role will be available for assignment.
46
+
Using the *AssignableScopes* parameter you can make the custom role available for assignment in only the subscriptions or resource groups that need it, and not clutter the user experience for the rest of the subscriptions or resource groups.
50
47
Following are some valid assignable scopes:
51
48
- "/subscriptions/c276fc76-9cd4-44c9-99a7-4fd71546436e", "/subscriptions/e91d47c4-76f3-4271-a796-21b4ecfe3624": makes the role available for assignment in two subscriptions.
52
49
- "/subscriptions/c276fc76-9cd4-44c9-99a7-4fd71546436e": makes the role available for assignment in a single subscription.
53
50
- "/subscriptions/c276fc76-9cd4-44c9-99a7-4fd71546436e/resourceGroups/Network": makes the role available for assignment only in the Network resource group.
54
51
55
52
The input role definition MAY contain the following properties:
56
53
57
-
1) NotActions: the set of operations that must be excluded from the Actions to determine the effective actions for the custom role.
54
+
- NotActions: the set of operations that must be excluded from the Actions to determine the effective actions for the custom role.
58
55
If there is a specific operation that you do not wish to grant access to in a custom role, it is convenient to use NotActions to exclude it, rather than specifying all operations other than that specific operation in Actions.
59
56
60
-
NOTE: If a user is assigned a role that specifies an operation in NotActions and also assigned another role grants access to the same operation - the user will be able to perform that operation.
57
+
If a user is assigned a role that specifies an operation in NotActions and also assigned another role grants access to the same operation - the user will be able to perform that operation.
61
58
NotActions is not a deny rule - it is simply a convenient way to create a set of allowed operations when specific operations need to be excluded.
62
59
63
60
Following is a sample json role definition that can be provided as input
@@ -79,36 +76,41 @@ Following is a sample json role definition that can be provided as input
0 commit comments