Creating a Custom Role

In the next example, we are creating a custom role that can only restart virtual machines in Azure. We are assigning that role to my user account inside the JSON file as well:

  1. You can define the custom role using the following JSON code. You should set the Id to null because the custom roles gets an ID assigned at creation. We will add the custom role to two Azure Subscriptions:
{  "Name": "Packt Custom Role",  "Id": null,  "IsCustom": true,  "Description": "Allows for read access to Azure Storage, Network and Compute resources and access to support",  "Actions": [    "Microsoft.Compute/*/read",    "Microsoft.Storage/*/read",  "Microsoft.Network/*/read",  "Microsoft.Resources/subscriptions/resourceGroups/read", "Microsoft.Support/*" ...

Get Architecting Microsoft Azure Solutions - Exam Guide 70-535 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.