Skip to content

Commit c56a9fd

Browse files
author
Graham Priestley
authored
Merge pull request MicrosoftDocs#257 from Azure/Graham71046
Bug 71046 ver3.7
2 parents 8d85bae + 7895060 commit c56a9fd

File tree

5 files changed

+95
-109
lines changed

5 files changed

+95
-109
lines changed

azureps-cmdlets-docs/ResourceManager/AzureRM.Resources/v3.7.0/New-AzureRmRoleAssignment.md

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -82,76 +82,77 @@ New-AzureRmRoleAssignment -ServicePrincipalName <String> [-Scope <String>] -Role
8282
```
8383

8484
## DESCRIPTION
85-
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+
8687
Access is granted by assigning the appropriate RBAC role to them at the right scope.
8788
To grant access to the entire subscription, assign a role at the subscription scope.
8889
To grant access to a specific resource group within a subscription, assign a role at the resource group scope.
8990

9091
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.
9495

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.
9697

9798
The scope at which access is being granted may be specified.
9899
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.
106107

107108
## EXAMPLES
108109

109-
### Example 1:
110+
### Example 1: Grant reader role access to a user
110111

111112

112113
```
113-
PS C:\> New-AzureRmRoleAssignment -ResourceGroupName rg1 -SignInName allen.young@live.com -RoleDefinitionName Reader
114+
PS C:\> New-AzureRmRoleAssignment -ResourceGroupName rg1 -SignInName "patti.fuller@contoso.com" -RoleDefinitionName Reader
114115
```
115116

116-
Grant Reader role access to a user at a resource group scope
117+
This command grants reader role access to a user at a resource group scope.
117118

118-
### Example 2:
119+
### Example 2: Grant access to a security group
119120

120121

121122
```
122-
PS C:\> Get-AzureRMADGroup -SearchString "Christine Koch Team"
123+
PS C:\> Get-AzureRMADGroup -SearchString "PattiFuller"
123124
124125
DisplayName Type ObjectId
125126
----------- ---- --------
126-
Christine Koch Team 2f9d4375-cbf1-48e8-83c9-2a0be4cb33fb
127+
PattiFuller 2f9d4375-cbf1-48e8-83c9-2a0be4cb33fb
127128
128129
PS C:\> New-AzureRmRoleAssignment -ObjectId 2f9d4375-cbf1-48e8-83c9-2a0be4cb33fb -RoleDefinitionName Contributor -ResourceGroupName rg1
129130
```
130131

131-
Grant access to a security group
132+
This command grants access to a security group.
132133

133-
### -------------------------- Example 3 --------------------------
134+
### Example 3: Grant access to a resource
134135

135136

136137
```
137138
PS C:\> New-AzureRmRoleAssignment -SignInName john.doe@contoso.com -RoleDefinitionName Owner -Scope "/subscription/86f81fc3-b00f-48cd-8218-3879f51ff362/resourcegroups/rg1/providers/Microsoft.Web/sites/site1"
138139
```
139140

140-
Grant access to a user at a resource (website)
141+
This command grants access to a user at a website resource.
141142

142-
### -------------------------- Example 4 --------------------------
143+
### Example 4: Grant access to a nested resource
143144

144145

145146
```
146147
PS C:\> New-AzureRMRoleAssignment -ObjectId 5ac84765-1c8c-4994-94b2-629461bd191b -RoleDefinitionName "Virtual Machine Contributor" -ResourceName Devices-Engineering-ProjectRND -ResourceType Microsoft.Network/virtualNetworks/subnets -ParentResource virtualNetworks/VNET-EASTUS-01 -ResourceGroupName Network
147148
```
148149

149-
Grant access to a group at a nested resource (subnet)
150+
This command grants access to a group at a nested subnet resource.
150151

151152
## PARAMETERS
152153

153154
### -ObjectId
154-
Azure AD Objectid of the user, group or service principal.
155+
Specifies an Azure Active Directory object ID of the user, group or service principal.
155156

156157
```yaml
157158
Type: Guid
@@ -166,10 +167,11 @@ Accept wildcard characters: False
166167
```
167168
168169
### -Scope
169-
The Scope of the role assignment.
170+
Specifies the scope of the role assignment.
170171
In the format of relative URI.
171-
For e.g.
172+
For instance,
172173
"/subscriptions/9004a9fd-d58e-48dc-aeb2-4a4aec58606f/resourceGroups/TestRG".
174+
173175
If not specified, will create the role assignment at subscription level.
174176
If specified, it should start with "/subscriptions/{id}".
175177
@@ -198,8 +200,8 @@ Accept wildcard characters: False
198200
```
199201
200202
### -RoleDefinitionName
201-
Name of the RBAC role that needs to be assigned to the principal i.e.
202-
Reader, Contributor, Virtual Network Administrator, etc.
203+
Specifies the name of the RBAC role that needs to be assigned to the principal.
204+
For instance: Reader, Contributor, Virtual Network Administrator.
203205
204206
```yaml
205207
Type: String
@@ -253,9 +255,9 @@ Accept wildcard characters: False
253255
```
254256
255257
### -ResourceGroupName
256-
The resource group name.
258+
Specifies the name of the resource group.
257259
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.
259261
260262
```yaml
261263
Type: String
@@ -270,10 +272,9 @@ Accept wildcard characters: False
270272
```
271273
272274
### -ResourceName
273-
The resource name.
274-
For e.g.
275-
storageaccountprod.
276-
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.
277278
278279
```yaml
279280
Type: String
@@ -288,10 +289,9 @@ Accept wildcard characters: False
288289
```
289290
290291
### -ResourceType
291-
The resource type.
292-
For e.g.
293-
Microsoft.Network/virtualNetworks.
294-
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.
295295
296296
```yaml
297297
Type: String
@@ -306,8 +306,8 @@ Accept wildcard characters: False
306306
```
307307
308308
### -ParentResource
309-
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.
311311
312312
```yaml
313313
Type: String
@@ -322,7 +322,7 @@ Accept wildcard characters: False
322322
```
323323
324324
### -RoleDefinitionId
325-
Id of the RBAC role that needs to be assigned to the principal.
325+
Specifies the ID of the RBAC role that needs to be assigned to the principal.
326326
327327
```yaml
328328
Type: Guid
@@ -337,7 +337,7 @@ Accept wildcard characters: False
337337
```
338338
339339
### -SignInName
340-
The email address or the user principal name of the user.
340+
Specifies the email address or the user principal name of the user.
341341
342342
```yaml
343343
Type: String
@@ -352,7 +352,7 @@ Accept wildcard characters: False
352352
```
353353
354354
### -ServicePrincipalName
355-
The ServicePrincipalName of the Azure AD application
355+
Specifies the ServicePrincipalName of the Azure Active Directory application.
356356
357357
```yaml
358358
Type: String
@@ -375,9 +375,8 @@ Keywords: azure, azurerm, arm, resource, management, manager, resource, group, t
375375
376376
## RELATED LINKS
377377
378-
[Get-AzureRmRoleAssignment]()
379-
380-
[Remove-AzureRmRoleAssignment]()
378+
[Get-AzureRmRoleAssignment](./Get-AzureRmRoleAssignment.md)
381379
382-
[Get-AzureRmRoleDefinition]()
380+
[Remove-AzureRmRoleAssignment](./Remove-AzureRmRoleAssignment.md)
383381
382+
[Get-AzureRmRoleDefinition](./Get-AzureRmRoleDefinition.md)

azureps-cmdlets-docs/ResourceManager/AzureRM.Resources/v3.7.0/New-AzureRmRoleDefinition.md

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111
Creates a custom role in Azure RBAC.
12-
Provide either a JSON role definition file or a PSRoleDefinition object as input.
13-
First, use the Get-AzureRmRoleDefinition command to generate a baseline role definition object.
14-
Then, modify its properties as required.
15-
Finally, use this command to create a custom role using role definition.
12+
1613

1714
## SYNTAX
1815

@@ -29,35 +26,35 @@ New-AzureRmRoleDefinition [-Role] <PSRoleDefinition> [-InformationAction <Action
2926
```
3027

3128
## DESCRIPTION
32-
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.
3431

3532
The input role definition MUST contain the following properties:
3633

37-
1) DisplayName: the name of the custom role
34+
- DisplayName: the name of the custom role
3835

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.
4037

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.
4239
Use Get-AzureRmProviderOperations to get the operation for Azure resource providers that can be secured using Azure RBAC.
4340
Following are some valid operation strings:
4441
- "*/read" grants access to read operations of all Azure resource providers.
4542
- "Microsoft.Network/*/read" grants access to read operations for all resource types in the Microsoft.Network resource provider of Azure.
4643
- "Microsoft.Compute/virtualMachines/*" grants access to all operations of virtual machines and its child resource types.
4744

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.
5047
Following are some valid assignable scopes:
5148
- "/subscriptions/c276fc76-9cd4-44c9-99a7-4fd71546436e", "/subscriptions/e91d47c4-76f3-4271-a796-21b4ecfe3624": makes the role available for assignment in two subscriptions.
5249
- "/subscriptions/c276fc76-9cd4-44c9-99a7-4fd71546436e": makes the role available for assignment in a single subscription.
5350
- "/subscriptions/c276fc76-9cd4-44c9-99a7-4fd71546436e/resourceGroups/Network": makes the role available for assignment only in the Network resource group.
5451

5552
The input role definition MAY contain the following properties:
5653

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.
5855
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.
5956

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.
6158
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.
6259

6360
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
7976
\],
8077
"AssignableScopes": \["/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","/subscriptions/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"\]
8178
}
79+
80+
You must provide either a JSON role definition file or a **PSRoleDefinition** object as input.
81+
First, use the [Get-AzureRmRoleDefinition](./Get-AzureRmRoleDefinition.md) command to generate a baseline role definition object.
82+
Then, modify its properties as required.
83+
Finally, use this command to create a custom role using role definition.
8284

8385
## EXAMPLES
8486

85-
### -------------------------- Create using PSRoleDefinitionObject --------------------------
87+
### Example 1: Create a role definition file using PSRoleDefinitionObject
8688

8789

8890
```
89-
PS C:\> $role = Get-AzureRmRoleDefinition -Name "Virtual Machine Contributor"
90-
PS C:\> $role.Id = $null
91-
PS C:\> $role.Name = "Virtual Machine Operator"
92-
PS C:\> $role.Description = "Can monitor, start, and restart virtual machines."
93-
PS C:\> $role.Actions.RemoveRange(0,$role.Actions.Count)
94-
PS C:\> $role.Actions.Add("Microsoft.Compute/*/read")
95-
PS C:\> $role.Actions.Add("Microsoft.Compute/virtualMachines/start/action")
96-
PS C:\> $role.Actions.Add("Microsoft.Compute/virtualMachines/restart/action")
97-
PS C:\> $role.Actions.Add("Microsoft.Compute/virtualMachines/downloadRemoteDesktopConnectionFile/action")
98-
PS C:\> $role.Actions.Add("Microsoft.Network/*/read")
99-
PS C:\> $role.Actions.Add("Microsoft.Storage/*/read")
100-
PS C:\> $role.Actions.Add("Microsoft.Authorization/*/read")
101-
PS C:\> $role.Actions.Add("Microsoft.Resources/subscriptions/resourceGroups/read")
102-
PS C:\> $role.Actions.Add("Microsoft.Resources/subscriptions/resourceGroups/resources/read")
103-
PS C:\> $role.Actions.Add("Microsoft.Insights/alertRules/*")
104-
PS C:\> $role.Actions.Add("Microsoft.Support/*")
105-
PS C:\> $role.AssignableScopes.Remove("/") | Out-Null
106-
PS C:\> $role.AssignableScopes.Add("/subscriptions/c276fc76-9cd4-44c9-99a7-4fd71546436e")
107-
108-
PS C:\> New-AzureRmRoleDefinition -Role $role
91+
PS C:\> $Role = Get-AzureRmRoleDefinition -Name "Virtual Machine Contributor"
92+
PS C:\> $Role.Id = $null
93+
PS C:\> $Role.Name = "Virtual Machine Operator"
94+
PS C:\> $Role.Description = "Can monitor, start, and restart virtual machines."
95+
PS C:\> $Role.Actions.RemoveRange(0,$Role.Actions.Count)
96+
PS C:\> $Role.Actions.Add("Microsoft.Compute/*/read")
97+
PS C:\> $Role.Actions.Add("Microsoft.Compute/virtualMachines/start/action")
98+
PS C:\> $Role.Actions.Add("Microsoft.Compute/virtualMachines/restart/action")
99+
PS C:\> $Role.Actions.Add("Microsoft.Compute/virtualMachines/downloadRemoteDesktopConnectionFile/action")
100+
PS C:\> $Role.Actions.Add("Microsoft.Network/*/read")
101+
PS C:\> $Role.Actions.Add("Microsoft.Storage/*/read")
102+
PS C:\> $Role.Actions.Add("Microsoft.Authorization/*/read")
103+
PS C:\> $Role.Actions.Add("Microsoft.Resources/subscriptions/resourceGroups/read")
104+
PS C:\> $Role.Actions.Add("Microsoft.Resources/subscriptions/resourceGroups/resources/read")
105+
PS C:\> $Role.Actions.Add("Microsoft.Insights/alertRules/*")
106+
PS C:\> $Role.Actions.Add("Microsoft.Support/*")
107+
PS C:\> $Role.AssignableScopes.Remove("/") | Out-Null
108+
PS C:\> $Role.AssignableScopes.Add("/subscriptions/c276fc76-9cd4-44c9-99a7-4fd71546436e")
109+
110+
PS C:\> New-AzureRmRoleDefinition -Role $Role
109111
```
110112

111-
### -------------------------- Create using JSON file --------------------------
113+
### Example 2: Create a role definition using JSON file
112114

113115

114116
```
@@ -118,7 +120,7 @@ PS C:\> New-AzureRmRoleDefinition -InputFile C:\Temp\roleDefinition.json
118120
## PARAMETERS
119121

120122
### -InputFile
121-
File name containing a single json role definition.
123+
File name containing a single JSON role definition.
122124

123125
```yaml
124126
Type: String
@@ -172,7 +174,7 @@ Accept wildcard characters: False
172174
```
173175
174176
### -Role
175-
Role definition object.
177+
Specifies a role definition object.
176178
177179
```yaml
178180
Type: PSRoleDefinition
@@ -195,11 +197,10 @@ Keywords: azure, azurerm, arm, resource, management, manager, resource, group, t
195197
196198
## RELATED LINKS
197199
198-
[Get-AzureRmProviderOperation]()
199-
200-
[Get-AzureRmRoleDefinition]()
200+
[Get-AzureRmRoleDefinition](./Get-AzureRmRoleDefinition.md)
201201
202-
[Set-AzureRmRoleDefinition]()
202+
[Remove-AzureRmRoleDefinition](./Remove-AzureRmRoleDefinition.md)
203203
204-
[Remove-AzureRmRoleDefinition]()
204+
[Set-AzureRmRoleDefinition](./Set-AzureRmRoleDefinition.md)
205205
206+
[Get-AzureRmProviderOperation](./Get-AzureRmProviderOperation.md)

azureps-cmdlets-docs/ResourceManager/AzureRM.Resources/v3.7.0/Register-AzureRmProviderFeature.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ The **Register-AzureRmProviderFeature** cmdlet registers an Azure provider featu
2222

2323
## EXAMPLES
2424

25-
### 1:
26-
```
27-
28-
```
29-
3025
## PARAMETERS
3126

3227
### -FeatureName
@@ -102,5 +97,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
10297
## RELATED LINKS
10398
10499
[Get-AzureRmProviderFeature](./Get-AzureRmProviderFeature.md)
105-
106-

0 commit comments

Comments
 (0)