Skip to content

Commit

Permalink
Missing formatting for code block (Azure#21130)
Browse files Browse the repository at this point in the history
* Missing formatting for code block

* Update Set-AzRoleDefinition.md

* Update Set-AzRoleDefinition.md

* Update Set-AzRoleDefinition.md

---------

Co-authored-by: Yabo Hu <[email protected]>
  • Loading branch information
thwpike and VeryEarly authored Mar 7, 2023
1 parent fa4b0eb commit b9d947b
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions src/Resources/Resources/help/Set-AzRoleDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,51 @@ Set-AzRoleDefinition -Role <PSRoleDefinition> [-DefaultProfile <IAzureContextCon
```

## DESCRIPTION
The Set-AzRoleDefinition cmdlet updates an existing custom role in Azure Role-Based Access Control.
Provide the updated role definition as an input to the command as a JSON file or a PSRoleDefinition object.
The role definition for the updated custom role MUST contain the Id and all other required properties of the role even if they are not updated: DisplayName, Description, Actions, AssignableScopes.
NotActions, DataActions, NotDataActions are optional.
Following is a sample updated role definition json for Set-AzRoleDefinition
The Set-AzRoleDefinition cmdlet updates an existing custom role in Azure Role-Based Access Control. Provide the updated role definition as an input to the command as a JSON file or a PSRoleDefinition object. The role definition for the updated custom role MUST contain the Id and all other required properties of the role even if they are not updated: DisplayName, Description, Actions, AssignableScopes. NotActions, DataActions, NotDataActions are optional.

## EXAMPLES

### Example 1: Update using PSRoleDefinitionObject
```powershell
$roleDef = Get-AzRoleDefinition "Contoso On-Call"
$roleDef.Actions.Add("Microsoft.ClassicCompute/virtualmachines/start/action")
$roleDef.Description = "Can monitor all resources and start and restart virtual machines"
$roleDef.AssignableScopes = @("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
Set-AzRoleDefinition -Role $roleDef
```

### Example 2: Create using JSON file
```powershell
Set-AzRoleDefinition -InputFile C:\Temp\roleDefinition.json
<#
Following is a sample updated role definition json for Set-AzRoleDefinition:
{
"Id": "52a6cc13-ff92-47a8-a39b-2a8205c3087e",
"Name": "Updated Role",
"Description": "Can monitor all resources and start and restart virtual machines",
"Actions":
\[
[
"*/read",
"Microsoft.ClassicCompute/virtualmachines/restart/action",
"Microsoft.ClassicCompute/virtualmachines/start/action"
\],
],
"NotActions":
\[
[
"*/write"
\],
],
"DataActions":
\[
[
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read"
\],
],
"NotDataActions":
\[
[
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
\],
"AssignableScopes": \["/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"\]
],
"AssignableScopes": ["/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
}

## EXAMPLES

### Example 1: Update using PSRoleDefinitionObject
```powershell
$roleDef = Get-AzRoleDefinition "Contoso On-Call"
$roleDef.Actions.Add("Microsoft.ClassicCompute/virtualmachines/start/action")
$roleDef.Description = "Can monitor all resources and start and restart virtual machines"
$roleDef.AssignableScopes = @("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
Set-AzRoleDefinition -Role $roleDef
#>
```

### Example 2: Create using JSON file
```powershell
Set-AzRoleDefinition -InputFile C:\Temp\roleDefinition.json
```

## PARAMETERS

Expand Down

0 comments on commit b9d947b

Please sign in to comment.