@@ -24,37 +24,37 @@ tier2="Premium"
24
24
apiversion=" 2015-08-01"
25
25
resourceType=" Microsoft.Web/sites"
26
26
27
- azure group create --name " $groupName " --location " $location "
27
+ az group create --name " $groupName " --location " $location "
28
28
29
29
printf " \n1. Create a new app service plan %s " " $planName1 "
30
- azure app service plan create -n " $planName1 " -g " $groupName " -l " $location " --tier " $tier1 "
30
+ az app service plan create -n " $planName1 " -g " $groupName " -l " $location " --tier " $tier1 "
31
31
32
32
printf " \n2. Create a new web app %s " " $appName1 "
33
- webappInfo1=` azure webapp create -g " $groupName " -n " $appName1 " -l " $location " --plan " $planName1 " `
33
+ webappInfo1=` az webapp create -g " $groupName " -n " $appName1 " -l " $location " --plan " $planName1 " `
34
34
35
35
printf " \nValidating web app name %s " " $appName1 "
36
36
[ $( echo $webappInfo1 | jq ' .name' --raw-output) == " $appName1 " ]
37
37
38
38
printf " \n3. Create a web app slot %s " " $slotname1 "
39
- slot1=` azure webapp slot create -g " $groupName " --plan " $planName1 " -n " $appName1 " --slot " $slotname1 " `
39
+ slot1=` az webapp slot create -g " $groupName " --plan " $planName1 " -n " $appName1 " --slot " $slotname1 " `
40
40
appWithSlotName1=" $appName1 /$slotname1 "
41
41
42
42
printf " \nValidating web app slot %s " " $slotname1 "
43
43
[ $( echo $slot1 | jq ' .name' --raw-output) == " $appWithSlotName1 " ]
44
44
45
45
printf " \nValidating web app slot get for %s " " $slotname1 "
46
- slot1=` azure webapp slot get -g " $groupName " -n " $appName1 " --slot " $slotname1 " `
46
+ slot1=` az webapp slot get -g " $groupName " -n " $appName1 " --slot " $slotname1 " `
47
47
[ $( echo $slot1 | jq ' .name' --raw-output) == " $appWithSlotName1 " ]
48
48
49
49
printf " \nValidating web app slot via pipline obj for %s " " $slotname1 "
50
- slot1=` echo " $webappInfo1 " | azure webapp slot get --slot " $slotname1 " `
50
+ slot1=` echo " $webappInfo1 " | az webapp slot get --slot " $slotname1 " `
51
51
52
52
printf " \n4. Create another web app slot %s " " $slotname2 "
53
- slot2=` azure webapp slot create -g " $groupName " --plan " $planName1 " -n " $appName1 " --slot " $slotname2 " `
53
+ slot2=` az webapp slot create -g " $groupName " --plan " $planName1 " -n " $appName1 " --slot " $slotname2 " `
54
54
appWithSlotName2=" $appName1 /$slotname2 "
55
55
56
56
printf " \n5. Get the webapp slots:"
57
- slots=` azure webapp slot get -g " $groupName " -n " $appName1 " `
57
+ slots=` az webapp slot get -g " $groupName " -n " $appName1 " `
58
58
slotN1=` echo $slots | jq ' .[0].name' `
59
59
slotN2=` echo $slots | jq ' .[1].name' `
60
60
slotNames=` echo $slotN1 $slotN2 `
@@ -64,9 +64,9 @@ printf "\nValidating web app slots %s " "$slotname1 and $slotname2"
64
64
[[ $slotNames == * " $appWithSlotName2 " * ]]
65
65
66
66
printf " \n6. Change web app slot %s service plan" " $slotname2 "
67
- servicePlanInfo2=` azure app service plan create -n " $planName2 " -g " $groupName " -l " $location " --tier " $tier2 " `
68
- # slot3=`azure webapp slot create -g "$groupName" --plan "$planName3" -n "$appName" --slot "$slotname2"`
69
- slot1=` azure webapp slot set -g " $groupName " -n " $appName1 " --slot " $slotname1 " --plan " $planName2 " `
67
+ servicePlanInfo2=` az app service plan create -n " $planName2 " -g " $groupName " -l " $location " --tier " $tier2 " `
68
+ # slot3=`az webapp slot create -g "$groupName" --plan "$planName3" -n "$appName" --slot "$slotname2"`
69
+ slot1=` az webapp slot set -g " $groupName " -n " $appName1 " --slot " $slotname1 " --plan " $planName2 " `
70
70
71
71
printf " \nValidating web app slots %s " " $slotname1 "
72
72
[ $( echo $slot1 | jq ' .name' --raw-output) == " $appName1 /$slotname1 " ]
@@ -78,16 +78,16 @@ printf "\n7. Set web app slot %s config properties"
78
78
printf " \n8. Set web app slot settings and connection strings"
79
79
appsettings=" {\" setting1\" :\" valueA\" ,\" setting2\" :\" valueB\" }"
80
80
connectionstrings=" { \" connstring1\" : { \" Type\" : \" MySql\" , \" Value\" : \" string value 1\" }, \" connstring2\" : { \" Type\" : \" SqlAzure\" , \" Value\" : \" string value 2\" } }"
81
- slot1=` azure webapp slot set -g " $groupName " --plan " $planName1 " -n " $appName1 " --slot " $slotname1 " --connectionstrings " $connectionstrings " --appsettings " $appsettings " `
81
+ slot1=` az webapp slot set -g " $groupName " --plan " $planName1 " -n " $appName1 " --slot " $slotname1 " --connectionstrings " $connectionstrings " --appsettings " $appsettings " `
82
82
83
83
printf " \n9. Get web app slot %s publishing profile" " $slotname1 "
84
84
outputFile1=" webappslot-profile-1"
85
85
outputFile2=" webappslot-profile-2"
86
- azure webapp slot profile get -g " $groupName " -n " $appName1 " --slot " $slotname1 " --outputfile " $outputFile1 "
86
+ az webapp slot profile get -g " $groupName " -n " $appName1 " --slot " $slotname1 " --outputfile " $outputFile1 "
87
87
88
88
printf " \n10. Get web app slot %s publishing profile via pipline obj" " $slotname1 "
89
89
# Unable to test pipline. verity property name and value instead.
90
- # echo "$slot1" | azure webapp slot profile get --outputfile "$outputFile2"
90
+ # echo "$slot1" | az webapp slot profile get --outputfile "$outputFile2"
91
91
92
92
printf " \nValidating web app slot profile output file"
93
93
[ -s " $outputFile1 " ]
@@ -102,82 +102,82 @@ done
102
102
endTime=` date +" %A, %B %d, %Y %X" `
103
103
startTime=` date +" %A, %B %d, %Y %X" --date " 3 hour ago" `
104
104
metricsNames=" [\" CPU\" ,\" Request\" ]"
105
- metrics=` azure webapp slot metrics get -g " $groupName " -n " $appName1 " --slot " $slotname1 " --granularity PT1M --starttime " $startTime " --endtime " $endTime " --metrics " $metricsNames " `
105
+ metrics=` az webapp slot metrics get -g " $groupName " -n " $appName1 " --slot " $slotname1 " --granularity PT1M --starttime " $startTime " --endtime " $endTime " --metrics " $metricsNames " `
106
106
107
107
printf " \nValidating web app slot metrics via pipline obj %s " " $slotname1 "
108
108
# Unable to test pipline. verity property name and value instead.
109
- # echo "$slot1" | azure webapp slot metrics get --metrics "$metricsNames" --starttime "$startTime" --endtime "$endTime" --granularity PT1M
109
+ # echo "$slot1" | az webapp slot metrics get --metrics "$metricsNames" --starttime "$startTime" --endtime "$endTime" --granularity PT1M
110
110
111
111
printf " \n12. Stop web app slot: %s." " $slotname1 "
112
- slot1=` echo " $slot1 " | azure webapp slot stop`
112
+ slot1=` echo " $slot1 " | az webapp slot stop`
113
113
printf " \nValidating web app slot %s stopped " " $slotname1 "
114
114
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Stopped" ]
115
115
116
116
printf " \n13 Stop web app slot: %s." " $slotname1 "
117
- slot1=` echo " $slot1 " | azure webapp slot start`
117
+ slot1=` echo " $slot1 " | az webapp slot start`
118
118
printf " \nValidating web app slot %s running " " $slotname1 "
119
119
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Running" ]
120
120
121
121
printf " \n14 Stop web app slot: %s." " $slotname1 "
122
- slot1=` echo " $slot1 " | azure webapp slot stop`
122
+ slot1=` echo " $slot1 " | az webapp slot stop`
123
123
printf " \nValidating web app slot %s stopped " " $slotname1 "
124
124
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Stopped" ]
125
125
126
126
printf " \n15 Stop web app slot: %s." " $slotname1 "
127
- slot1=` echo " $slot1 " | azure webapp slot start`
127
+ slot1=` echo " $slot1 " | az webapp slot start`
128
128
printf " \nValidating web app slot %s running " " $slotname1 "
129
129
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Running" ]
130
130
131
131
printf " \n16 Restart web app slot: %s." " $slotname1 "
132
- slot1=` azure webapp slot restart -g " $groupName " -n " $appName1 " --slot " $slotname1 " `
132
+ slot1=` az webapp slot restart -g " $groupName " -n " $appName1 " --slot " $slotname1 " `
133
133
printf " \nValidating web app slot %s Running " " $slotname1 "
134
134
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Running" ]
135
135
136
136
printf " \n17 Restart web app slot: %s with pipline object." " $slotname1 "
137
- slot1=` echo " $slot1 " | azure webapp slot restart`
137
+ slot1=` echo " $slot1 " | az webapp slot restart`
138
138
printf " \nValidating web app slot %s Running " " $slotname1 "
139
139
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Running" ]
140
140
141
141
# Need to create a 'Premium' plan for clone test
142
142
printf " \n18. Create a new web app for clone testing"
143
143
location1=" eastus"
144
144
145
- azure app service plan set -n " $planName1 " -g " $groupName " --tier " $tier2 "
146
- webappInfo2=` azure webapp create -g " $groupName " -n " $appName2 " -l " $location " --plan " $planName2 " `
145
+ az app service plan set -n " $planName1 " -g " $groupName " --tier " $tier2 "
146
+ webappInfo2=` az webapp create -g " $groupName " -n " $appName2 " -l " $location " --plan " $planName2 " `
147
147
148
148
printf " \n19. Clone web app slot to a slot."
149
- slotClone=` azure webapp slot create -g " $groupName " -n " $appName2 " --slot " $slotname3 " --sourcewebapp " $webappInfo2 " `
149
+ slotClone=` az webapp slot create -g " $groupName " -n " $appName2 " --slot " $slotname3 " --sourcewebapp " $webappInfo2 " `
150
150
appWithSlotNameClone=" $appName2 /$slotname3 "
151
151
152
152
printf " \nValidating cloned web app slot %s " " $slotname3 "
153
153
[ $( echo $slotClone | jq ' .name' --raw-output) == " $appWithSlotNameClone " ]
154
154
155
155
printf " \nValidating web app slot get for %s " " $slotname3 "
156
- slotClone=` azure webapp slot get -g " $groupName " -n " $appName2 " --slot " $slotname3 " `
156
+ slotClone=` az webapp slot get -g " $groupName " -n " $appName2 " --slot " $slotname3 " `
157
157
[ $( echo $slotClone | jq ' .name' --raw-output) == " $appWithSlotNameClone " ]
158
158
159
159
printf " \n20. Create a new web app for clone testing"
160
- slot2=` azure webapp slot create -g " $groupName " --plan " $planName2 " -n " $appName2 " --slot " $slotname3 " `
160
+ slot2=` az webapp slot create -g " $groupName " --plan " $planName2 " -n " $appName2 " --slot " $slotname3 " `
161
161
slotN1=" $appName2 /$slotname3 "
162
162
163
163
printf " \n21. Create a new web app for clone testing"
164
- servicePlan=` azure app service plan create -n " $planName3 " -g " $groupName " -l " $location1 " --tier " $tier2 " `
165
- webappInfo3=` azure webapp create -g " $groupName " -n " $appName3 " -l " $location1 " --plan " $planName3 " `
166
- slot3=` azure webapp slot create -g " $groupName " -n " $appName3 " --slot " $slotname3 " --sourcewebapp " $webappInfo3 " `
164
+ servicePlan=` az app service plan create -n " $planName3 " -g " $groupName " -l " $location1 " --tier " $tier2 " `
165
+ webappInfo3=` az webapp create -g " $groupName " -n " $appName3 " -l " $location1 " --plan " $planName3 " `
166
+ slot3=` az webapp slot create -g " $groupName " -n " $appName3 " --slot " $slotname3 " --sourcewebapp " $webappInfo3 " `
167
167
168
168
printf " \nValidating web app slot get for %s " " $slotname3 "
169
169
appWithSlotName3=" $appName3 /$slotname3 "
170
170
[ $( echo $slot3 | jq ' .name' --raw-output) == " $appWithSlotName3 " ]
171
171
172
172
# Cleanup
173
173
printf " \n22. Remove web app slot: %s." " $slotname1 "
174
- azure webapp slot remove -g " $groupName " -n " $appName1 " --slot " $slotname1 " --force
174
+ az webapp slot remove -g " $groupName " -n " $appName1 " --slot " $slotname1 " --force
175
175
176
176
printf " \n23. Remove web app: %s." " $appName1 "
177
- azure webapp remove -g " $groupName " -n " $appName1 " --force
177
+ az webapp remove -g " $groupName " -n " $appName1 " --force
178
178
179
179
printf " \n24. Remove app service plan: %s." " $planName1 "
180
- azure app service plan remove -g " $groupName " -n " $planName1 " --force
180
+ az app service plan remove -g " $groupName " -n " $planName1 " --force
181
181
182
182
printf " \n25. Remove resource group: %s." " $groupName "
183
- azure group remove --name " $groupName " --force
183
+ az group remove --name " $groupName " --force
0 commit comments