@@ -17,37 +17,37 @@ tier="Standard"
17
17
apiversion=" 2015-08-01"
18
18
resourceType=" Microsoft.Web/sites"
19
19
20
- azure group create --name " $groupName " --location " $location "
20
+ az group create --name " $groupName " --location " $location "
21
21
22
22
printf " \n1. Create a new app service plan %s " " $planName "
23
- azure app service plan create -n " $planName " -g " $groupName " -l " $location " --tier " $tier "
23
+ az app service plan create -n " $planName " -g " $groupName " -l " $location " --tier " $tier "
24
24
25
25
printf " \n2. Create a new web app %s " " $appName "
26
- webappInfo=` azure webapp create -g " $groupName " -n " $appName " -l " $location " --plan " $planName " `
26
+ webappInfo=` az webapp create -g " $groupName " -n " $appName " -l " $location " --plan " $planName " `
27
27
28
28
printf " \nValidating web app name %s " " $appName "
29
29
[ $( echo $webappInfo | jq ' .name' --raw-output) == " $appName " ]
30
30
31
31
printf " \n3. Create a web app slot %s " " $slotname1 "
32
- slot1=` azure webapp slot create -g " $groupName " --plan " $planName " -n " $appName " --slot " $slotname1 " `
32
+ slot1=` az webapp slot create -g " $groupName " --plan " $planName " -n " $appName " --slot " $slotname1 " `
33
33
appWithSlotName1=" $appName /$slotname1 "
34
34
35
35
printf " \nValidating web app slot %s " " $slotname1 "
36
36
[ $( echo $slot1 | jq ' .name' --raw-output) == " $appWithSlotName1 " ]
37
37
38
38
printf " \nValidating web app slot get for %s " " $slotname1 "
39
- slot1=` azure webapp slot get -g " $groupName " -n " $appName " --slot " $slotname1 " `
39
+ slot1=` az webapp slot get -g " $groupName " -n " $appName " --slot " $slotname1 " `
40
40
[ $( echo $slot1 | jq ' .name' --raw-output) == " $appWithSlotName1 " ]
41
41
42
42
printf " \nValidating web app slot via pipline obj for %s " " $slotname1 "
43
- slot1=` echo " $webappInfo " | azure webapp slot get --slot " $slotname1 " `
43
+ slot1=` echo " $webappInfo " | az webapp slot get --slot " $slotname1 " `
44
44
45
45
printf " \n4. Create another web app slot %s " " $slotname2 "
46
- slot2=` azure webapp slot create -g " $groupName " --plan " $planName " -n " $appName " --slot " $slotname2 " `
46
+ slot2=` az webapp slot create -g " $groupName " --plan " $planName " -n " $appName " --slot " $slotname2 " `
47
47
appWithSlotName2=" $appName /$slotname2 "
48
48
49
49
printf " \n5. Get the webapp slots:"
50
- slots=` azure webapp slot get -g " $groupName " -n " $appName " `
50
+ slots=` az webapp slot get -g " $groupName " -n " $appName " `
51
51
slotN1=` echo $slots | jq ' .[0].name' `
52
52
slotN2=` echo $slots | jq ' .[1].name' `
53
53
slotNames=` echo $slotN1 $slotN2 `
@@ -74,7 +74,7 @@ startTime=`date +"%A, %B %d, %Y %X" --date "3 hour ago"`
74
74
$metricsNames =" \" ('CPU', 'Requests')\" "
75
75
76
76
# !Not able to test since complex object issue.
77
- metrics=` azure webapp slot metrics get -g " $groupName " -n " $appName " --slot " $slotname1 " --granularity PT1M --starttime " $startTime " --endtime " $endTime " --metrics " $metricsNames " `
77
+ metrics=` az webapp slot metrics get -g " $groupName " -n " $appName " --slot " $slotname1 " --granularity PT1M --starttime " $startTime " --endtime " $endTime " --metrics " $metricsNames " `
78
78
79
79
printf " \nValidating web app slot metrics %s " " $slotname1 "
80
80
for i in $metricsNames
86
86
printf " \nValidating web app slot metrics via pipline obj %s " " $slotname1 "
87
87
88
88
printf " \n12. Stop web app slot: %s." " $slotname1 "
89
- slot1=` echo " $slot1 " | azure webapp slot stop`
89
+ slot1=` echo " $slot1 " | az webapp slot stop`
90
90
printf " \nValidating web app slot %s stopped " " $slotname1 "
91
91
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Stopped" ]
92
92
93
93
printf " \n13 Stop web app slot: %s." " $slotname1 "
94
- slot1=` echo " $slot1 " | azure webapp slot start`
94
+ slot1=` echo " $slot1 " | az webapp slot start`
95
95
printf " \nValidating web app slot %s running " " $slotname1 "
96
96
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Running" ]
97
97
98
98
printf " \n14 Stop web app slot: %s." " $slotname1 "
99
- slot1=` echo " $slot1 " | azure webapp slot stop`
99
+ slot1=` echo " $slot1 " | az webapp slot stop`
100
100
printf " \nValidating web app slot %s stopped " " $slotname1 "
101
101
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Stopped" ]
102
102
103
103
printf " \n15 Stop web app slot: %s." " $slotname1 "
104
- slot1=` echo " $slot1 " | azure webapp slot start`
104
+ slot1=` echo " $slot1 " | az webapp slot start`
105
105
printf " \nValidating web app slot %s running " " $slotname1 "
106
106
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Running" ]
107
107
108
108
printf " \n16 Restart web app slot: %s." " $slotname1 "
109
- slot1=` echo " $slot1 " | azure webapp slot restart`
109
+ slot1=` echo " $slot1 " | az webapp slot restart`
110
110
printf " \nValidating web app slot %s Running " " $slotname1 "
111
111
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Running" ]
112
112
113
113
printf " \n17 Restart web app slot: %s." " $slotname1 "
114
- slot1=` echo " $slot1 " | azure webapp slot restart`
114
+ slot1=` echo " $slot1 " | az webapp slot restart`
115
115
printf " \nValidating web app slot %s Running " " $slotname1 "
116
116
[ $( echo $slot1 | jq ' ."properties.state"' --raw-output) == " Running" ]
117
117
118
118
# Clone ------
119
119
# !Not able to test since complex object input issue.
120
120
# printf "\n10. Clone web app slot: %s." "$slotname1"
121
- # slotClone=`azure web app slot clone`
121
+ # slotClone=`az web app slot clone`
122
122
# appWithSlotNameClone="$appName/slotname1"
123
123
124
124
# printf "\nValidating cloned web app slot %s " "$slotname1"
125
125
# [ $(echo $slotClone | jq '.name' --raw-output) == "$appWithSlotNameClone" ]
126
126
127
127
# printf "\nValidating web app slot get for %s " "$slotname1"
128
- # slot1=`azure webapp slot get -g "$groupName" -n "$appName" --slot "$slotname1"`
128
+ # slot1=`az webapp slot get -g "$groupName" -n "$appName" --slot "$slotname1"`
129
129
# [ $(echo $slot1 | jq '.name' --raw-output) == "$appWithSlotNameClone" ]
130
130
# -------
131
131
132
132
# Cleanup
133
133
printf " \n20. Remove web app slot: %s." " $slotname1 "
134
- azure webapp slot remove -g " $groupName " -n " $appName " --slot " $slotname1 "
134
+ az webapp slot remove -g " $groupName " -n " $appName " --slot " $slotname1 "
135
135
136
136
printf " \n20. Remove web app: %s." " $appName "
137
- azure webapp remove -g " $groupName " -n " $appName "
137
+ az webapp remove -g " $groupName " -n " $appName "
138
138
139
139
printf " \n20. Remove app service plan: %s." " $planName "
140
- azure app service plan remove -g " $groupName " -n " $planName "
140
+ az app service plan remove -g " $groupName " -n " $planName "
141
141
142
142
printf " \n20. Remove resource group: %s." " $groupName "
0 commit comments