Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing formatting for code block #21130

Merged
merged 4 commits into from
Mar 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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