Skip to content

Commit 68d6d9c

Browse files
committed
merge + rename test usages to new forms
1 parent 6a644b1 commit 68d6d9c

File tree

5 files changed

+65
-65
lines changed

5 files changed

+65
-65
lines changed

examples/compute-management/02-VirtualMachineCreation.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ printf "\n2. Creating a new storage account '%s' in type '%s'.\n" "$storageAccou
99
az storage account new --resourcegroupname "$groupName" --name "$storageAccountName" --location "$location" --type "$storageAccountType"
1010

1111
printf "\n3. Create virtual network.\n"
12-
result=`az network vnet new --resourcegroupname "$groupName" --name test --location "$location" --addressprefix "[\"10.0.0.0/16\"]" --subnet "[{\"Name\":\"test\",\"AddressPrefix\":\"10.0.0.0/24\"}]" --force`
12+
result=`az vnet new --resourcegroupname "$groupName" --name test --location "$location" --addressprefix "[\"10.0.0.0/16\"]" --subnet "[{\"Name\":\"test\",\"AddressPrefix\":\"10.0.0.0/24\"}]" --force`
1313

1414
contextResult=`az context ls`
1515

@@ -19,7 +19,7 @@ subnetId="/subscriptions/$subId/resourceGroups/$groupName/providers/Microsoft.Ne
1919

2020
printf "\n4. Create network interface with:\r\nsubId='%s' \r\n& \r\nsubnetId='$subnetId'.\n" "$subId"
2121
export MSYS_NO_PATHCONV=1
22-
az network interface new --name test --resourcegroupname "$groupName" --location "$location" --subnetid "$subnetId"
22+
az networkinterface new --name test --resourcegroupname "$groupName" --location "$location" --subnetid "$subnetId"
2323
export MSYS_NO_PATHCONV=
2424

2525
nicId="/subscriptions/$subId/resourceGroups/$groupName/providers/Microsoft.Network/networkInterfaces/test"

examples/resource-management/04-RoleAssignments.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ export MSYS_NO_PATHCONV=1
1010
users=$(az activedirectory users ls)
1111
userId=$(echo $users | cat | jq '.[0].Id' -s --raw-output)
1212
echo "UserID: $userId"
13-
roleDefinitions=$(az security role definition ls)
13+
roleDefinitions=$(az networksecurityrole definition ls)
1414
roleDefinitionId=$(echo $roleDefinitions | cat | jq '.[0].Id' -s --raw-output)
1515
echo "RoleDefinitionId: $roleDefinitionId"
1616
subsciptions=$(az subscription ls)
1717
subscriptionId=$(echo $subsciptions | cat | jq '.[0].SubscriptionId' -s --raw-output)
1818
scope="/subscriptions/$subscriptionId/resourceGroups/$groupName"
1919
echo "Scope: $scope"
20-
az security role assignment create --ObjectId "$userId" --RoleDefinitionId "$roleDefinitionId" --Scope "$scope"
20+
az networksecurityrole assignment create --ObjectId "$userId" --RoleDefinitionId "$roleDefinitionId" --Scope "$scope"
2121

2222
printf "\n3. Delete last created Role Assignment.\n"
23-
assignments=$(az security role assignment ls)
23+
assignments=$(az networksecurityrole assignment ls)
2424
assignmentId=$(echo $assignments | cat | jq '.[-1:][0].ObjectId' -s --raw-output)
2525
echo "Deleting assignment: $assignmentId"
26-
az security role assignment rm --ObjectId "$assignmentId" --Scope "$scope" --RoleDefinitionId "$roleDefinitionId" -f
26+
az networksecurityrole assignment rm --ObjectId "$assignmentId" --Scope "$scope" --RoleDefinitionId "$roleDefinitionId" -f
2727
export MSYS_NO_PATHCONV=

examples/resource-management/05-RoleDefinitions.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ printf "\n1. Creating a new resource group: %s and location: %s.\n" "$groupName"
66
az resourcemanager group create --name "$groupName" --location "$location"
77

88
printf "\n2. Creating a new Role Definition.\n"
9-
roleDefinition=$(az security role definition create --inputfile $BASEDIR/roleDefinition.json)
9+
roleDefinition=$(az networksecurityrole definition create --inputfile $BASEDIR/roleDefinition.json)
1010

1111
printf "\n3. Get information about Role Definitions.\n"
1212
roleDefinitionName=$(echo $roleDefinition | jq '.Name' --raw-output)
13-
az security role definition ls -n $roleDefinitionName
13+
az networksecurityrole definition ls -n $roleDefinitionName
1414

1515
printf "\n4. Update Role Definition.\n"
1616
export MSYS_NO_PATHCONV=1
1717
updatedRoleDefinition=$(echo $roleDefinition | jq '.Actions |= .+ ["Microsoft.Authorization/*/write"]')
18-
az security role definition set --Role "$updatedRoleDefinition"
18+
az networksecurityrole definition set --Role "$updatedRoleDefinition"
1919

2020
printf "\n5. Delete Role Definition.\n"
2121
roleDefinitionId=$(echo $roleDefinition | jq '.Id' --raw-output)
22-
az security role definition rm --Id $roleDefinitionId --PassThru -f
22+
az networksecurityrole definition rm --Id $roleDefinitionId --PassThru -f
2323
export MSYS_NO_PATHCONV=

examples/webapp-management/02-WebAppSlot.sh

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,31 @@ printf "\n1. Create a new app service plan %s " "$planName1"
2424
az appservice plan create -n "$planName1" -g "$groupName" -l "$location" --tier "$tier1"
2525

2626
printf "\n2. Create a new web app %s " "$appName1"
27-
webappInfo1=`az webapp create -g "$groupName" -n "$appName1" -l "$location" --plan "$planName1"`
27+
webappInfo1=`az appservice create -g "$groupName" -n "$appName1" -l "$location" --plan "$planName1"`
2828

2929
printf "\nValidating web app name %s " "$appName1"
3030
[ $(echo $webappInfo1 | jq '.name' --raw-output) == "$appName1" ]
3131

3232
printf "\n3. Create a web app slot %s " "$slotname1"
33-
slot1=`az webapp slot create -g "$groupName" --plan "$planName1" -n "$appName1" --slot "$slotname1"`
33+
slot1=`az appservice slot create -g "$groupName" --plan "$planName1" -n "$appName1" --slot "$slotname1"`
3434
appWithSlotName1="$appName1/$slotname1"
3535

3636
printf "\nValidating web app slot %s " "$slotname1"
3737
[ $(echo $slot1 | jq '.name' --raw-output) == "$appWithSlotName1" ]
3838

3939
printf "\nValidating web app slot get for %s " "$slotname1"
40-
slot1=`az webapp slot ls -g "$groupName" -n "$appName1" --slot "$slotname1"`
40+
slot1=`az appservice slot ls -g "$groupName" -n "$appName1" --slot "$slotname1"`
4141
[ $(echo $slot1 | jq '.name' --raw-output) == "$appWithSlotName1" ]
4242

4343
printf "\nValidating web app slot via pipline obj for %s " "$slotname1"
44-
slot1=`echo "$webappInfo1" | az webapp slot ls --slot "$slotname1"`
44+
slot1=`echo "$webappInfo1" | az appservice slot ls --slot "$slotname1"`
4545

4646
printf "\n4. Create another web app slot %s " "$slotname2"
47-
slot2=`az webapp slot create -g "$groupName" --plan "$planName1" -n "$appName1" --slot "$slotname2"`
47+
slot2=`az appservice slot create -g "$groupName" --plan "$planName1" -n "$appName1" --slot "$slotname2"`
4848
appWithSlotName2="$appName1/$slotname2"
4949

5050
printf "\n5. Get the webapp slots:"
51-
slots=`az webapp slot ls -g "$groupName" -n "$appName1"`
51+
slots=`az appservice slot ls -g "$groupName" -n "$appName1"`
5252
slotN1=`echo $slots | jq '.[0].name'`
5353
slotN2=`echo $slots | jq '.[1].name'`
5454
slotNames=`echo $slotN1 $slotN2`
@@ -59,8 +59,8 @@ printf "\nValidating web app slots %s " "$slotname1 and $slotname2"
5959

6060
printf "\n6. Change web app slot %s service plan" "$slotname2"
6161
servicePlanInfo2=`az app service plan create -n "$planName2" -g "$groupName" -l "$location" --tier "$tier2"`
62-
# slot3=`az webapp slot create -g "$groupName" --plan "$planName3" -n "$appName" --slot "$slotname2"`
63-
slot1=`az webapp slot set -g "$groupName" -n "$appName1" --slot "$slotname1" --plan "$planName2"`
62+
# slot3=`az appservice slot create -g "$groupName" --plan "$planName3" -n "$appName" --slot "$slotname2"`
63+
slot1=`az appservice slot set -g "$groupName" -n "$appName1" --slot "$slotname1" --plan "$planName2"`
6464

6565
printf "\nValidating web app slots %s " "$slotname1"
6666
[ $(echo $slot1 | jq '.name' --raw-output) == "$appName1/$slotname1" ]
@@ -72,16 +72,16 @@ printf "\n7. Set web app slot %s config properties"
7272
printf "\n8. Set web app slot settings and connection strings"
7373
appsettings="{\"setting1\":\"valueA\",\"setting2\":\"valueB\"}"
7474
connectionstrings="{ \"connstring1\": { \"Type\": \"MySql\", \"Value\": \"string value 1\" }, \"connstring2\": { \"Type\": \"SqlAzure\", \"Value\": \"string value 2\" } }"
75-
slot1=`az webapp slot set -g "$groupName" --plan "$planName1" -n "$appName1" --slot "$slotname1" --connectionstrings "$connectionstrings" --appsettings "$appsettings"`
75+
slot1=`az appservice slot set -g "$groupName" --plan "$planName1" -n "$appName1" --slot "$slotname1" --connectionstrings "$connectionstrings" --appsettings "$appsettings"`
7676

7777
printf "\n9. Get web app slot %s publishing profile" "$slotname1"
7878
outputFile1="webappslot-profile-1"
7979
outputFile2="webappslot-profile-2"
80-
az webapp slot profile get -g "$groupName" -n "$appName1" --slot "$slotname1" --outputfile "$outputFile1"
80+
az appservice slot profile get -g "$groupName" -n "$appName1" --slot "$slotname1" --outputfile "$outputFile1"
8181

8282
printf "\n10. Get web app slot %s publishing profile via pipline obj" "$slotname1"
8383
# Unable to test pipline. verity property name and value instead.
84-
# echo "$slot1" | az webapp slot profile get --outputfile "$outputFile2"
84+
# echo "$slot1" | az appservice slot profile get --outputfile "$outputFile2"
8585

8686
printf "\nValidating web app slot profile output file"
8787
[ -s "$outputFile1" ]
@@ -96,39 +96,39 @@ done
9696
endTime=`date +"%A, %B %d, %Y %X"`
9797
startTime=`date +"%A, %B %d, %Y %X" --date "3 hour ago"`
9898
metricsNames="[\"CPU\",\"Request\"]"
99-
metrics=`az webapp slot metrics ls -g "$groupName" -n "$appName1" --slot "$slotname1" --granularity PT1M --starttime "$startTime" --endtime "$endTime" --metrics "$metricsNames"`
99+
metrics=`az appservice slot metrics ls -g "$groupName" -n "$appName1" --slot "$slotname1" --granularity PT1M --starttime "$startTime" --endtime "$endTime" --metrics "$metricsNames"`
100100

101101
printf "\nValidating web app slot metrics via pipline obj %s " "$slotname1"
102102
# Unable to test pipline. verity property name and value instead.
103-
# echo "$slot1" | az webapp slot metrics get --metrics "$metricsNames" --starttime "$startTime" --endtime "$endTime" --granularity PT1M
103+
# echo "$slot1" | az appservice slot metrics get --metrics "$metricsNames" --starttime "$startTime" --endtime "$endTime" --granularity PT1M
104104

105105
printf "\n12. Stop web app slot: %s." "$slotname1"
106-
slot1=`echo "$slot1" | az webapp slot stop`
106+
slot1=`echo "$slot1" | az appservice slot stop`
107107
printf "\nValidating web app slot %s stopped " "$slotname1"
108108
[ $(echo $slot1 | jq '."properties.state"' --raw-output) == "Stopped" ]
109109

110110
printf "\n13 Stop web app slot: %s." "$slotname1"
111-
slot1=`echo "$slot1" | az webapp slot start`
111+
slot1=`echo "$slot1" | az appservice slot start`
112112
printf "\nValidating web app slot %s running " "$slotname1"
113113
[ $(echo $slot1 | jq '."properties.state"' --raw-output) == "Running" ]
114114

115115
printf "\n14 Stop web app slot: %s." "$slotname1"
116-
slot1=`echo "$slot1" | az webapp slot stop`
116+
slot1=`echo "$slot1" | az appservice slot stop`
117117
printf "\nValidating web app slot %s stopped " "$slotname1"
118118
[ $(echo $slot1 | jq '."properties.state"' --raw-output) == "Stopped" ]
119119

120120
printf "\n15 Stop web app slot: %s." "$slotname1"
121-
slot1=`echo "$slot1" | az webapp slot start`
121+
slot1=`echo "$slot1" | az appservice slot start`
122122
printf "\nValidating web app slot %s running " "$slotname1"
123123
[ $(echo $slot1 | jq '."properties.state"' --raw-output) == "Running" ]
124124

125125
printf "\n16 Restart web app slot: %s." "$slotname1"
126-
slot1=`az webapp slot restart -g "$groupName" -n "$appName1" --slot "$slotname1"`
126+
slot1=`az appservice slot restart -g "$groupName" -n "$appName1" --slot "$slotname1"`
127127
printf "\nValidating web app slot %s Running " "$slotname1"
128128
[ $(echo $slot1 | jq '."properties.state"' --raw-output) == "Running" ]
129129

130130
printf "\n17 Restart web app slot: %s with pipline object." "$slotname1"
131-
slot1=`echo "$slot1" | az webapp slot restart`
131+
slot1=`echo "$slot1" | az appservice slot restart`
132132
printf "\nValidating web app slot %s Running " "$slotname1"
133133
[ $(echo $slot1 | jq '."properties.state"' --raw-output) == "Running" ]
134134

@@ -137,35 +137,35 @@ printf "\n18. Create a new web app for clone testing"
137137
location1="eastus"
138138

139139
az app service plan set -n "$planName1" -g "$groupName" --tier "$tier2"
140-
webappInfo2=`az webapp create -g "$groupName" -n "$appName3" -l "$location" --plan "$planName1"`
140+
webappInfo2=`az appservice create -g "$groupName" -n "$appName3" -l "$location" --plan "$planName1"`
141141

142142
printf "\n19. Clone web app slot to a slot."
143-
slotClone=`az webapp slot create -g "$groupName" -n "$appName3" --slot "$slotname3" --sourcewebapp "$webappInfo2"`
143+
slotClone=`az appservice slot create -g "$groupName" -n "$appName3" --slot "$slotname3" --sourcewebapp "$webappInfo2"`
144144
appWithSlotNameClone="$appName3/$slotname3"
145145

146146
printf "\nValidating cloned web app slot %s " "$slotname3"
147147
[ $(echo $slotClone | jq '.name' --raw-output) == "$appWithSlotNameClone" ]
148148

149149
printf "\nValidating web app slot get for %s " "$slotname3"
150-
slotClone=`az webapp slot get -g "$groupName" -n "$appName3" --slot "$slotname3"`
150+
slotClone=`az appservice slot get -g "$groupName" -n "$appName3" --slot "$slotname3"`
151151
[ $(echo $slotClone | jq '.name' --raw-output) == "$appWithSlotNameClone" ]
152152

153153
printf "\n20. Create a new web app for clone testing"
154-
slot2=`az webapp slot create -g "$groupName" --plan "$planName1" -n "$appName3" --slot "$slotname3"`
154+
slot2=`az appservice slot create -g "$groupName" --plan "$planName1" -n "$appName3" --slot "$slotname3"`
155155

156156
printf "\n21. Create a new web app for clone testing"
157157
servicePlan=`az app service plan create -n "$planName3" -g "$groupName" -l "$location1" --tier "$tier2"`
158-
webappInfo3=`az webapp create -g "$groupName" -n "$appName4" -l "$location1" --plan "$planName3"`
159-
slot3=`az webapp slot create -g "$groupName" --plan "$planName3" -n "$appName4" --slot "$slotname3" --sourcewebapp "$slot2"`
158+
webappInfo3=`az appservice create -g "$groupName" -n "$appName4" -l "$location1" --plan "$planName3"`
159+
slot3=`az appservice slot create -g "$groupName" --plan "$planName3" -n "$appName4" --slot "$slotname3" --sourcewebapp "$slot2"`
160160

161161
printf "\nValidating web app slot get for %s " "$slotname3"
162162
appWithSlotName3="$appName4/$slotname3"
163163
[ $(echo $slot3 | jq '.name' --raw-output) == "$appWithSlotName3" ]
164164

165165
# Cleanup
166166
printf "\n22. Remove web app slot: %s." "$slotname1"
167-
az webapp slot rm -g "$groupName" -n "$appName1" --slot "$slotname1" --force
168-
az webapp slot rm -g "$groupName" -n "$appName1" --slot "$slotname2" --force
167+
az appservice slot rm -g "$groupName" -n "$appName1" --slot "$slotname1" --force
168+
az appservice slot rm -g "$groupName" -n "$appName1" --slot "$slotname2" --force
169169

170170
printf "\n23. Remove resource group: %s." "$groupName"
171171
az group rm --name "$groupName" --force

0 commit comments

Comments
 (0)