Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Create (or update, or delete) role based on template:
  2.  
  3. ```sh
  4. az role definition create --role-definition "~/CustomRoles/ReaderSupportRole.json"
  5. az role definition update --role-definition "~/CustomRoles/ReaderSupportRole.json"
  6. az role definition delete --name "Reader Support Tickets"
  7. ```
  8.  
  9. template:
  10.  
  11. ```json
  12. {
  13. "Name": "Reader Support Tickets",
  14. "IsCustom": true,
  15. "Description": "View everything in the subscription and also open support tickets.",
  16. "Actions": [
  17. "*/read",
  18. "Microsoft.Support/*"
  19. ],
  20. "NotActions": [],
  21. "DataActions": [],
  22. "NotDataActions": [],
  23. "AssignableScopes": [
  24. "/subscriptions/00000000-0000-0000-0000-000000000000"
  25. ]
  26. }
  27. ```
  28.  
  29. List cutom roles:
  30.  
  31. ```sh
  32. az role definition list --custom-role-only true
  33. ```
  34.  
  35. What roles does a user have:
  36.  
  37. ```sh
  38. az role assignment list --all --assignee richard.cowin@hansard.com
  39. ```
  40.  
  41. Grant access to user / group:
  42.  
  43. ```sh
  44. az role assignment create --role "Virtual Machine Contributor" --assignee patlong@contoso.com --resource-group pharma-sales --include-groups
  45. az role assignment create --role "Virtual Machine Contributor" \
  46. --assignee-object-id xxx-yyy-zzz \
  47. --scope /subscriptions/00000000-000000-000000-000000
  48. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement