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:
- 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/*" ...