File tree Expand file tree Collapse file tree 2 files changed +78
-9
lines changed Expand file tree Collapse file tree 2 files changed +78
-9
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#" ,
3
+ "contentVersion" : " 1.0.0.0" ,
4
+ "parameters" : {
5
+ "name" : {
6
+ "type" : " string"
7
+ },
8
+ "location" : {
9
+ "type" : " string"
10
+ },
11
+ "repositoryUrl" : {
12
+ "type" : " string"
13
+ },
14
+ "branch" : {
15
+ "type" : " string"
16
+ },
17
+ "repositoryToken" : {
18
+ "type" : " securestring"
19
+ },
20
+ "appLocation" : {
21
+ "type" : " string"
22
+ },
23
+ "apiLocation" : {
24
+ "type" : " string"
25
+ },
26
+ "azureSQL" : {
27
+ "type" : " string"
28
+ }
29
+ },
30
+ "resources" : [
31
+ {
32
+ "apiVersion" : " 2021-01-15" ,
33
+ "name" : " [parameters('name')]" ,
34
+ "type" : " Microsoft.Web/staticSites" ,
35
+ "location" : " [parameters('location')]" ,
36
+ "properties" : {
37
+ "repositoryUrl" : " [parameters('repositoryUrl')]" ,
38
+ "branch" : " [parameters('branch')]" ,
39
+ "repositoryToken" : " [parameters('repositoryToken')]" ,
40
+ "buildProperties" : {
41
+ "appLocation" : " [parameters('appLocation')]" ,
42
+ "apiLocation" : " [parameters('apiLocation')]"
43
+ }
44
+ },
45
+ "sku" : {
46
+ "Tier" : " Free" ,
47
+ "Name" : " Free"
48
+ },
49
+ "resources" :[
50
+ {
51
+ "apiVersion" : " 2021-01-15" ,
52
+ "name" : " appsettings" ,
53
+ "type" : " config" ,
54
+ "location" : " [parameters('location')]" ,
55
+ "properties" : {
56
+ "DATABASE_URL" : " [parameters('azureSQL')]"
57
+ },
58
+ "dependsOn" : [
59
+ " [resourceId('Microsoft.Web/staticSites', parameters('name'))]"
60
+ ]
61
+ }
62
+ ]
63
+ }
64
+ ]
65
+ }
Original file line number Diff line number Diff line change @@ -32,15 +32,19 @@ az group create \
32
32
-l $location
33
33
34
34
echo " Deploying Static Web App..." ;
35
- az staticwebapp create \
36
- -n $appName \
37
- -g $resourceGroup \
38
- -s $gitSource \
39
- -l $location \
40
- -b main \
41
- --api-location " ./api" \
42
- --app-location " ./client" \
43
- --token $gitToken
35
+ az deployment group create \
36
+ --name ToDoMVC-SWA \
37
+ --resource-group $resourceGroup \
38
+ --template-file azure-deploy.arm.json \
39
+ --parameters \
40
+ name=$appName \
41
+ location=$location \
42
+ repositoryToken=$gitToken \
43
+ repositoryUrl=$gitSource \
44
+ branch=main \
45
+ appLocation=" ./client" \
46
+ apiLocation=" ./api" \
47
+ azureSQL=$DATABASE_URL
44
48
45
49
echo " Getting Static Web App..." ;
46
50
dhn=` az staticwebapp show -g $resourceGroup -n $appName --query " defaultHostname" `
You can’t perform that action at this time.
0 commit comments