File tree Expand file tree Collapse file tree 2 files changed +79
-12
lines changed
Expand file tree Collapse file tree 2 files changed +79
-12
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,6 @@ This can be used on the download page:
1515In every [ release] ( https://github.com/codez-one/CZ.Azure.FileExchange/releases/latest ) of this repository you will find a ` azuredeploy.json ` .
1616Just take this json and deploy it [ here] ( https://portal.azure.com/#create/Microsoft.Template ) .
1717After this you have in your resource group an storage account and a static web app.
18- Find out the URL of your static website add the CORS rule for it:
19-
20- ![ Configure Cors] ( docs/.assets/ce554abc-df88-45ae-8348-6c97f8e8dbef.png )
2118
2219After this download the two ZIPs of the release (API.zip & Frontend.zip) and extract them.
2320
Original file line number Diff line number Diff line change 11param name string
2-
2+ param location string = resourceGroup (). location
33resource storage 'Microsoft.Storage/storageAccounts@2021-06-01' = {
4- name : uniqueString (resourceGroup ().id ,'7f358957-c1be-48ad-8902-808564e0556f' )
5- location : resourceGroup (). location
4+ name : uniqueString (resourceGroup ().id , '7f358957-c1be-48ad-8902-808564e0556f' )
5+ location : location
66 kind : 'StorageV2'
77 sku : {
88 name : 'Standard_LRS'
99 }
10- properties : {
11-
12- }
10+ properties : {}
1311}
1412
13+
1514resource website 'Microsoft.Web/staticSites@2021-02-01' = {
1615 name : name
17- location : resourceGroup (). location
16+ location : location
1817 sku : {
1918 name : 'Free'
2019 tier : 'Free'
2120 }
22- properties :{}
21+ properties : {}
2322}
2423
25- resource websiteconfig 'Microsoft.Web/staticSites/config@2021-02-01' ={
24+ resource websiteconfig 'Microsoft.Web/staticSites/config@2021-02-01' = {
2625 dependsOn : [
2726 storage
2827 ]
@@ -32,3 +31,74 @@ resource websiteconfig 'Microsoft.Web/staticSites/config@2021-02-01' ={
3231 StorageConnectionString : 'DefaultEndpointsProtocol=https;AccountName=${storage .name };AccountKey=${storage .listKeys ().keys [0 ].value };EndpointSuffix=${environment ().suffixes .storage }'
3332 }
3433}
34+
35+ resource storageBlobServiceConfig 'Microsoft.Storage/storageAccounts/blobServices@2021-08-01' = {
36+ parent : storage
37+ name : 'default'
38+ properties : {
39+ lastAccessTimeTrackingPolicy :{
40+ enable : true
41+ }
42+ cors : {
43+ corsRules : [
44+ {
45+ allowedOrigins : [
46+ website .properties .defaultHostname
47+ 'https://*.${location }.azurestaticapps.net'
48+ ]
49+ exposedHeaders : [
50+ '*'
51+ ]
52+ maxAgeInSeconds : 0
53+ allowedMethods : [
54+ 'GET'
55+ 'PUT'
56+ 'OPTIONS'
57+ ]
58+ allowedHeaders : [
59+ '*'
60+ ]
61+ }
62+ ]
63+ }
64+ }
65+ }
66+
67+ resource storageSaveMonyPolicy 'Microsoft.Storage/storageAccounts/managementPolicies@2021-08-01' = {
68+ parent : storage
69+ name : 'default'
70+ dependsOn : [
71+ storageBlobServiceConfig
72+ ]
73+ properties : {
74+ policy : {
75+ rules : [
76+ {
77+ type : 'Lifecycle'
78+ name : 'save money'
79+ definition : {
80+ actions : {
81+ baseBlob : {
82+ tierToCool : {
83+ daysAfterLastAccessTimeGreaterThan : 10
84+ }
85+ tierToArchive : {
86+ daysAfterLastAccessTimeGreaterThan : 30
87+ }
88+ enableAutoTierToHotFromCool : true
89+ delete : {
90+ daysAfterLastAccessTimeGreaterThan : 365
91+ }
92+ }
93+ }
94+ filters :{
95+ blobTypes : [
96+ 'blockBlob'
97+ ]
98+ }
99+ }
100+ }
101+ ]
102+ }
103+ }
104+ }
You can’t perform that action at this time.
0 commit comments