-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.json
134 lines (134 loc) · 3.56 KB
/
template.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
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Web/staticSites",
"apiVersion": "2022-09-01",
"name": "[parameters('staticWebAppName')]",
"location": "[resourceGroup().location]",
"properties": {
"repositoryUrl": "[parameters('repositoryUrl')]",
"branch": "[parameters('branch')]",
"buildProperties": {
"appLocation": "[parameters('appLocation')]",
"apiLocation": "[parameters('apiLocation')]",
"outputLocation": "[parameters('outputLocation')]"
}
},
"sku": {
"name": "Free"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2022-09-01",
"name": "[parameters('storageAccountName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "Standard_LRS"
},
"kind": "StorageV2",
"properties": {
"accessTier": "Hot"
}
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2022-09-01",
"name": "[concat(parameters('storageAccountName'), '/default/', parameters('containerName'))]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
],
"properties": {}
},
{
"type": "Microsoft.Storage/storageAccounts/managementPolicies",
"apiVersion": "2022-09-01",
"name": "[concat(parameters('storageAccountName'), '/default')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
],
"properties": {
"policy": {
"rules": [
{
"enabled": true,
"name": "DeleteBlobsOlderThan24Hours",
"type": "Lifecycle",
"definition": {
"filters": {
"blobTypes": ["blockBlob"],
"prefixMatch": [""]
},
"actions": {
"baseBlob": {
"delete": {
"daysAfterModificationGreaterThan": "[parameters('containerLifecycleAge')]"
}
}
}
}
}
]
}
}
}
],
"parameters": {
"staticWebAppName": {
"type": "string",
"metadata": {
"description": "Name of the Static Web App"
}
},
"repositoryUrl": {
"type": "string",
"metadata": {
"description": "URL of the GitHub repository"
}
},
"branch": {
"type": "string",
"metadata": {
"description": "Branch to deploy from"
}
},
"appLocation": {
"type": "string",
"metadata": {
"description": "Location of the app"
}
},
"apiLocation": {
"type": "string",
"metadata": {
"description": "Location of the API"
}
},
"outputLocation": {
"type": "string",
"metadata": {
"description": "Location of the output"
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"description": "Name of the Storage Account"
}
},
"containerName": {
"type": "string",
"metadata": {
"description": "Name of the Blob Container"
}
},
"containerLifecycleAge": {
"type": "int",
"metadata": {
"description": "Number of days before blob deletion"
}
}
}
}