forked from chgeuer/spring_boot_aad_kv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazuredeploy-1.json
76 lines (76 loc) · 4.24 KB
/
azuredeploy-1.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"prefix": { "type": "string" },
"servicePrincipalApplicationID": { "type": "string" },
"servicePrincipalClientSecret": { "type": "securestring" },
"githubRepositoryUrl": { "type": "string", "defaultValue": "https://github.com/chgeuer/spring_boot_aad_kv.git" },
"githubPersonalAccessToken": { "type": "securestring" }
},
"variables": {
"prefix": "[parameters('prefix')]",
"githubRepositoryUrl": "[parameters('githubRepositoryUrl')]",
"aadGroups": "christian",
"names": {
"acr": "[concat(variables('prefix'), 'acr')]",
"aci": "[concat(variables('prefix'), 'aci')]",
"keyvault": "[concat(variables('prefix'), 'kv')]",
"identity": "[concat(variables('prefix'), 'identity')]"
},
"imagename": "springaad",
"apiVersion": {
"containerregistry_registries": "2017-10-01",
"containerregistry_registries_tasks": "2018-09-01",
"containerinstance_containergroups": "2018-10-01",
"managedidentity_userassignedidentities": "2018-11-30"
}
},
"resources": [
{
"type": "Microsoft.ContainerInstance/containerGroups",
"apiVersion": "[variables('apiVersion').containerinstance_containergroups]",
"name": "[variables('names').aci]",
"tags": { "displayName": "Container Instance Group" },
"location": "[resourceGroup().location]",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"[resourceId(resourceGroup().name, 'Microsoft.ManagedIdentity/userAssignedIdentities', variables('names').identity)]": { }
}
},
"properties":{
"osType": "Linux",
"imageRegistryCredentials": [
{
"server": "[reference(resourceId(resourceGroup().name, 'Microsoft.ContainerRegistry/registries', variables('names').acr), variables('apiVersion').containerregistry_registries).loginServer]",
"username": "[listCredentials(resourceId(resourceGroup().name, 'Microsoft.ContainerRegistry/registries', variables('names').acr), variables('apiVersion').containerregistry_registries).username]",
"password": "[listCredentials(resourceId(resourceGroup().name, 'Microsoft.ContainerRegistry/registries', variables('names').acr), variables('apiVersion').containerregistry_registries).passwords[0].value]"
}
],
"ipAddress": {
"type": "Public",
"ports": [ { "protocol": "TCP", "port": 8080 } ],
"dnsNameLabel": "[variables('names').aci]"
},
"containers": [
{
"name": "[variables('imagename')]",
"properties": {
"image": "[concat(reference(resourceId(resourceGroup().name, 'Microsoft.ContainerRegistry/registries', variables('names').acr), variables('apiVersion').containerregistry_registries).loginServer, '/', variables('imagename'), ':latest')]",
"resources": { "requests": { "memoryInGB": 1.5, "cpu": 1 } },
"ports": [ { "protocol": "TCP", "port": 8080 } ],
"environmentVariables": [
{ "name": "KEYVAULT_URI", "value": "[concat('https://', variables('names').keyvault, '.vault.azure.net/')]" },
{ "name": "AAD_TENANT_ID", "value": "[subscription().tenantId]" },
{ "name": "AAD_GROUP", "value": "[variables('aadGroups')]" },
{ "name": "AAD_CLIENT_ID", "value": "[parameters('servicePrincipalApplicationID')]" },
{ "name": "AAD_CLIENT_SECRET", "secureValue": "[parameters('servicePrincipalClientSecret')]" }
]
}
}
]
}
}
]
}