|
685 | 685 | helps['role assignment create'] = """ |
686 | 686 | type: command |
687 | 687 | short-summary: Create a new role assignment for a user, group, or service principal. |
| 688 | +long-summary: >- |
| 689 | + --scope argument will become required for creating a role assignment in the breaking change release of the fall |
| 690 | + of 2023. Please explicitly specify --scope. |
688 | 691 | examples: |
689 | | - - name: Create role assignment for an assignee. |
690 | | - text: az role assignment create --assignee sp_name --role a_role |
| 692 | + - name: Create role assignment to grant the specified assignee the Reader role on an Azure virtual machine. |
| 693 | + text: az role assignment create --assignee sp_name --role Reader --scope /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVm |
691 | 694 | - name: Create role assignment for an assignee with description and condition. |
692 | 695 | text: >- |
693 | | - az role assignment create --role "Owner" --assignee "John.Doe@Contoso.com" |
| 696 | + az role assignment create --role Owner |
| 697 | + --scope /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/MyStorageAccount |
| 698 | + --assignee "John.Doe@Contoso.com" |
694 | 699 | --description "Role assignment foo to check on bar" |
695 | 700 | --condition "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:Name] stringEquals 'foo'" |
696 | 701 | --condition-version "2.0" |
697 | 702 | supported-profiles: latest |
698 | | - - name: Create a new role assignment for a user, group, or service principal. (autogenerated) |
699 | | - text: | |
700 | | - az role assignment create --assignee 00000000-0000-0000-0000-000000000000 --role "Storage Account Key Operator Service Role" --scope $id |
701 | | - crafted: true |
702 | 703 | - name: Create role assignment with your own assignment name. |
703 | | - text: az role assignment create --assignee-object-id 00000000-0000-0000-0000-000000000000 --assignee-principal-type ServicePrincipal --role Reader --scope /subscriptions/00000000-0000-0000-0000-000000000000 --name 00000000-0000-0000-0000-000000000000 |
| 704 | + text: az role assignment create --assignee-object-id 00000000-0000-0000-0000-000000000000 --assignee-principal-type ServicePrincipal --role Reader --scope /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup --name 00000000-0000-0000-0000-000000000000 |
704 | 705 | """ |
705 | 706 |
|
706 | 707 |
|
|
0 commit comments