-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathresources.azrm.json
137 lines (137 loc) · 6.31 KB
/
resources.azrm.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": { "type": "string" },
"functionAppName": { "type": "string" },
"appInsightsName": { "type": "string" },
"sqlServerName": {"type": "string"},
"adminPassword": {"type": "secureString"},
"adminUsername": {"type": "string", "defaultValue": "mffAdmin"}
},
"variables": {
"transportsDatabaseName": "transports"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[parameters('storageAccountName')]",
"kind": "StorageV2",
"location": "[resourceGroup().location]",
"tags": {},
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"accessTier": "Hot",
"isHnsEnabled": false,
"allowBlobPublicAccess": false,
"supportsHttpsTrafficOnly": true,
"minimumTlsVersion": "TLS1_2"
}
},
{
"apiVersion": "2015-05-01",
"name": "[parameters('appInsightsName')]",
"type": "Microsoft.Insights/components",
"kind": "web",
"location": "[resourceGroup().location]",
"tags": {},
"properties": {
"Application_Type": "web",
"ApplicationId": "[parameters('appInsightsName')]"
}
},
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2022-05-01-preview",
"name": "[parameters('sqlServerName')]",
"location": "[resourceGroup().location]",
"properties": {
"administratorLogin": "[parameters('adminUsername')]",
"administratorLoginPassword": "[parameters('adminPassword')]",
"version": "12.0"
},
"resources": [
{
"type": "Microsoft.Sql/servers/firewallRules",
"apiVersion": "2022-05-01-preview",
"name": "[format('{0}/{1}', parameters('sqlServerName'), 'AllowAllWindowsAzureIps')]",
"properties": {
"endIpAddress": "0.0.0.0",
"startIpAddress": "0.0.0.0"
},
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
]
},
{
"type": "databases",
"name": "[variables('transportsDatabaseName')]",
"apiVersion": "2022-11-01-preview",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
],
"location": "[resourceGroup().location]",
"properties": {
"collation": "SQL_Latin1_General_CP1_CS_AS"
},
"sku": {
"name": "Basic",
"tier": "Basic"
}
}
]
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('functionAppName')]",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]",
"[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]",
"[resourceId('Microsoft.Insights/components', parameters('appInsightsName'))]"
],
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-06-01').keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-06-01').keys[0].value)]"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet-isolated"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~4"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components', parameters('appInsightsName')), '2020-02-02-preview').InstrumentationKey]"
},
{
"name": "TransportsDbConnectionString",
"value": "[concat('Server=tcp:', reference(parameters('sqlServerName'), '2022-05-01-preview').fullyQualifiedDomainName ,',1433;','Initial Catalog=',variables('transportsDatabaseName'),';', 'User ID=', parameters('adminUsername'), ';', 'Password=', parameters('adminPassword'), ';')]"
}
]
}
}
}
],
"outputs": {
"sqlConnectionString": {
"type": "string",
"value": "[concat('Server=tcp:', reference(parameters('sqlServerName'), '2022-05-01-preview').fullyQualifiedDomainName ,',1433;','Initial Catalog=',variables('transportsDatabaseName'),';', 'User ID=', parameters('adminUsername'), ';', 'Password=', parameters('adminPassword'), ';')]"
}
}
}