Skip to content

Instantly share code, notes, and snippets.

@noelbundick
Created February 4, 2019 16:52
Show Gist options
  • Save noelbundick/9b40aa88d8e7e5c54ceb2cd2a3d4eb56 to your computer and use it in GitHub Desktop.
Save noelbundick/9b40aa88d8e7e5c54ceb2cd2a3d4eb56 to your computer and use it in GitHub Desktop.
Subscription role assignment
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"utilityIdentityId": {
"type": "string"
}
},
"variables": {
"contributorRoleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"utilityRoleAssignmentId": "[guid(concat(subscription().id, 'contributor'))]"
},
"resources": [
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2015-07-01",
"name": "[variables('utilityRoleAssignmentId')]",
"properties": {
"roleDefinitionId": "[variables('contributorRoleDefinitionId')]",
"principalId": "[reference(parameters('utilityIdentityId'), '2015-08-31-preview').principalId]",
"scope": "[subscription().id]"
}
}
],
"outputs": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment