-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit-identity-deploy.json
56 lines (56 loc) · 2.17 KB
/
init-identity-deploy.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clusterName": {
"type": "string",
"metadata": {
"description": "AKS cluster name"
}
},
"location": {
"type": "string",
"metadata": {
"description": "AKS cluster location"
}
},
"managedIdentityName": {
"type": "string",
"metadata": {
"description": "ACI managed identity name"
}
},
"aksRoleAssignmentName": {
"defaultValue": "[concat(parameters('clusterName'), '/Microsoft.Authorization/', newGuid())]",
"type": "string",
"metadata": {
"description": "GUID for managed identity role assignment"
}
}
},
"variables": {
"aksId": "[resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))]"
},
"resources": [
{
"type": "Microsoft.ManagedIdentity/userAssignedIdentities",
"apiVersion": "2018-11-30",
"name": "[parameters('managedIdentityName')]",
"location": "[parameters('location')]"
},
{
"type": "Microsoft.ContainerService/managedClusters/providers/roleAssignments",
"apiVersion": "2020-04-01-preview",
"name": "[parameters('aksRoleAssignmentName')]",
"dependsOn": [
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('managedIdentityName'))]"
],
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', '4abbcc35-e782-43d8-92c5-2d3f1bd2253f')]",
"principalId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('managedIdentityName'))).principalId]",
"scope": "[variables('aksId')]",
"principalType": "ServicePrincipal"
}
}
]
}