-
Notifications
You must be signed in to change notification settings - Fork 4k
Clu #1620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clu #1620
Changes from all commits
5887150
8ee674f
7198df7
b420237
1cc94cb
0558bd6
a1729c5
7e0da4c
6703cf7
6a644b1
68d6d9c
a3b2e12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,44 +3,44 @@ set -e | |
printf "\n=== Managing Resources in Azure ===\n" | ||
|
||
printf "\n1. Creating a new resource group: %s and location: %s.\n" "$groupName" "$location" | ||
az group create --name "$groupName" --location "$location" | ||
az resourcemanager group create --name "$groupName" --location "$location" | ||
destinationGroupName=$groupName"Destination" | ||
|
||
printf "\n2. Registering Resource Provider Namespace.\n" | ||
providerNamespace="Providers.Test" | ||
az resource provider register --ProviderNamespace $providerNamespace --Force | ||
az resourcemanager resource resourcemanager provider register --ProviderNamespace $providerNamespace --Force | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, seems like 'resourcemanager' is wordy and unnecessary to disambiguate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Joe or Jason may be able to comment on this further There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @BurtBiel so this is clearly incorrect - even if we keep resourceManager, it should not appear twice. |
||
|
||
printf "\n3. Creating a new Resource: %s.\n" "$resourceName" | ||
resourceType="$providerNamespace/statefulResources" | ||
tags='[{"Name": "testtag", "Value": "testvalue"}]' | ||
properties='{"administratorLogin": "adminuser", "administratorLoginPassword": "P@ssword1"}' | ||
apiversion="2014-04-01" | ||
az resource create --Name $resourceName --Location $location --Tags "$tags" --ResourceGroupName $groupName --ResourceType $resourceType --PropertyObject "$properties" --ApiVersion $apiversion --Force | ||
az resourcemanager resource create --Name $resourceName --Location $location --Tags "$tags" --ResourceGroupName $groupName --ResourceType $resourceType --PropertyObject "$properties" --ApiVersion $apiversion --Force | ||
|
||
printf "\n4. Get information about Resource : %s.\n" "$resourceName" | ||
resourceInfo=$(az resource get -n $resourceName) | ||
resourceInfo=$(az resourcemanager resource ls -n $resourceName) | ||
printf "\nValidating Resource name is: %s\n" "$resourceName" | ||
[ $(echo $resourceInfo | jq '.Name' --raw-output) == "$resourceName" ] | ||
|
||
printf "\n5. Find Resource with name '%s' and type '%s'.\n" "$resourceName" "$resourceType" | ||
foundResource=$(az resource find -n "$resourceName" -t $resourceType) | ||
foundResource=$(az resourcemanager resource find -n "$resourceName" -t $resourceType) | ||
printf "\nValidating Resource name is: %s.\n" "$resourceName" | ||
[ $(echo $foundResource | jq '.Name' --raw-output) == "$resourceName" ] | ||
|
||
printf "\n6. Update Resource.\n" | ||
tagsUpdate='[{"Name": "testtagUpdated", "Value": "testvalueUpdated"}]' | ||
az resource set --ResourceGroupName $groupName --ResourceName $resourceName --ResourceType $resourceType --Tags "$tagsUpdate" -f | ||
az resourcemanager resource set --ResourceGroupName $groupName --ResourceName $resourceName --ResourceType $resourceType --Tags "$tagsUpdate" -f | ||
|
||
printf "\n7. Move Resource to resource group: %s.\n" "$destinationGroupName" | ||
az group create --name "$destinationGroupName" --location "$location" | ||
az resourcemanager group create --name "$destinationGroupName" --location "$location" | ||
resourceId=$(echo $resourceInfo | jq '.Id') | ||
arrayId="[$resourceId]" | ||
az resource move -g "$destinationGroupName" --ResourceId "$arrayId" -f | ||
az resourcemanager resource move -g "$destinationGroupName" --ResourceId "$arrayId" -f | ||
|
||
printf "\n8. Removing resource: %s.\n" "$resourceName" | ||
foundResource=$(az resource find -n "$resourceName" -t $resourceType) | ||
foundResource=$(az resourcemanager resource find -n "$resourceName" -t $resourceType) | ||
resourceId=$(echo $foundResource | jq '.Id' --raw-output) | ||
echo $resourceId | ||
export MSYS_NO_PATHCONV=1 | ||
az resource remove --Id "$resourceId" -f | ||
az resourcemanager resource rm --Id "$resourceId" -f | ||
export MSYS_NO_PATHCONV= |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,14 @@ set -e | |
printf "\n=== Provisioning Deployments in Azure ===\n" | ||
|
||
printf "\n1. Creating a new resource group: %s and location: %s.\n" "$groupName" "$location" | ||
az group create --name "$groupName" --location "$location" | ||
az resourcemanager group create --name "$groupName" --location "$location" | ||
|
||
printf "\n2. Test template with dynamic parameters\n" | ||
az group deployment test -g "$groupName" --templatefile $BASEDIR/sampleTemplate.json --siteName "$resourceName" --hostingPlanName "$resourceName" --siteLocation "$location" --workerSize "0" | ||
az resourcemanager group deployment test -g "$groupName" --templatefile $BASEDIR/sampleTemplate.json --siteName "$resourceName" --hostingPlanName "$resourceName" --siteLocation "$location" --workerSize "0" | ||
|
||
printf "\n3. Test template with JSON parameter object\n" | ||
az group deployment test -g "$groupName" --templatefile $BASEDIR/sampleTemplate.json --templateparameterobject "{\"siteName\":\"$resourceName\",\"hostingPlanName\":\"$resourceName\",\"siteLocation\":\"$location\",\"workerSize\": 0 }" | ||
az resourcemanager group deployment test -g "$groupName" --templatefile $BASEDIR/sampleTemplate.json --templateparameterobject "{\"siteName\":\"$resourceName\",\"hostingPlanName\":\"$resourceName\",\"siteLocation\":\"$location\",\"workerSize\": 0 }" | ||
|
||
printf "\n4. Provisioning Deployment\n" | ||
deploymentInfo=`az group deployment create --Name "$resourceName" --ResourceGroupName "$groupName" --TemplateFile $BASEDIR/sampleTemplate.json --TemplateParameterFile $BASEDIR/sampleTemplateParams.json` | ||
deploymentInfo=`az resourcemanager group deployment create --Name "$resourceName" --ResourceGroupName "$groupName" --TemplateFile $BASEDIR/sampleTemplate.json --TemplateParameterFile $BASEDIR/sampleTemplateParams.json` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is certainly in the top few commands used by everyone and this name is just too wordy. Why not az deployment create? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That seems like it might be good wording, can you run it by Joe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you thinking of promoting the Azure Group Deployment subcommand to be its own command? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @BurtBiel @JasonRShaver The consensus was azure resourceGroup deployment create. |
||
echo $deploymentInfo |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,13 @@ tier="Standard" | |
size="Medium" | ||
capacity=2 | ||
skuName="S2" | ||
az group create --name "$groupName" --location "$location" | ||
az resourcemanager group create --name "$groupName" --location "$location" | ||
|
||
printf "\n1. Create a new app service plan %s " "$whpName" | ||
az app service plan create -n "$whpName" -g "$groupName" -l "$location" --tier "$tier" --size "$size" --workers "$capacity" | ||
az appservice plan create -n "$whpName" -g "$groupName" -l "$location" --tier "$tier" --size "$size" --workers "$capacity" | ||
|
||
printf "\n2. Get information about the app service plan : %s.\n" "$whpName" | ||
whpInfo=`az app service plan get --name $whpName --group $groupName` | ||
whpInfo=`az appservice plan ls --name $whpName --group $groupName` | ||
|
||
printf "\nValidating app service plan name: %s\n" "$whpName" | ||
[ $(echo $whpInfo | jq '.name' --raw-output) == "$whpName" ] | ||
|
@@ -28,7 +28,7 @@ printf "\n3. Set the appservice plan: %s " "$whpName" | |
newTier="Shared" | ||
newCapacity=0 | ||
newSize="Medium" | ||
setPlanInfo=`az app service plan set -n $whpName -g $groupName --tier $newTier --workers --workers $newCapacity --size $newSize` | ||
setPlanInfo=`az appservice plan set -n $whpName -g $groupName --tier $newTier --workers --workers $newCapacity --size $newSize` | ||
[ $(echo $setPlanInfo | jq '.name' --raw-output) == "$whpName" ] | ||
[ $(echo $setPlanInfo | jq '.sku.tier' --raw-output) == "$newTier" ] | ||
[ $(echo $setPlanInfo | jq '.sku.capacity' --raw-output) -eq $newCapacity ] | ||
|
@@ -38,32 +38,32 @@ setPlanInfo=`az app service plan set -n $whpName -g $groupName --tier $newTier - | |
whpName2=`randomName testplan` | ||
printf "\n4. Creating a new app service plan: %s" "$whpName2" | ||
location2="East US" | ||
az app service plan create -n "$whpName2" -g "$groupName" -l "$location2" --tier "$tier" --size "$size" --workers "$capacity" | ||
az appservice plan create -n "$whpName2" -g "$groupName" -l "$location2" --tier "$tier" --size "$size" --workers "$capacity" | ||
|
||
printf "\n5. Get All app service plans by name: %s" "$whpName2" | ||
whpInfo2=`az app service plan get --name $whpName2` | ||
whpInfo2=`az appservice plan ls --name $whpName2` | ||
[ $(echo $whpInfo | jq '.name' --raw-output) == "$whpName2" ] | ||
[ $(echo $whpInfo | jq '.location' --raw-output) == "$location2" ] | ||
[ $(echo $whpInfo | jq '.sku.tier' --raw-output) == "$tier" ] | ||
[ $(echo $whpInfo | jq '.sku.name' --raw-output) == "$skuName" ] | ||
[ $(echo $whpInfo | jq '.sku.capacity' --raw-output) -eq $capacity ] | ||
|
||
printf "\n6. Get All app service plans by resource group: %s" "$groupName" | ||
plansByGroup=`az app service plan get --group $groupName` | ||
plansByGroup=`az appservice plan ls --group $groupName` | ||
[ $plansByGroup == *"$whpName"* ] | ||
[ $plansByGroup == *"$whpName2"* ] | ||
|
||
printf "\n7. Get All app service plans by location: %s" "$location2" | ||
plansByLocation=`az app service plan get -l $location2` | ||
plansByLocation=`az appservice plan ls -l $location2` | ||
[ $plansByLocation == *"$whpName2"* ] | ||
|
||
printf "\n8. Get All app service plans in a subscription." | ||
plansInSubscription=`az app service plan get` | ||
plansInSubscription=`az appservice plan ls` | ||
[ $plansInSubscription == *"$whpName"* ] | ||
[ $plansInSubscription == *"$whpName2"* ] | ||
|
||
printf "\n9. Remove app service plan: %s." "$whpName" | ||
az app service plan remove -n $whpName -g $groupName | ||
az appservice plan rm -n $whpName -g $groupName | ||
|
||
printf "\n10. Remove app service plan: %s." "$whpName2" | ||
az app service plan remove -n $whpName2 -g $groupName | ||
az appservice plan rm -n $whpName2 -g $groupName | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the distinction between appservice and webapp? We should decide on one noun for this and use it throughout: az appservice create etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to app service instead of webapp There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. appservice (one word) right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The branding is in fact two words: https://azure.microsoft.com/en-us/services/app-service/. But, one word is fine for the command itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the most used cmdlet in the entire set opf cmdlets - you have to create a resource group to do anything else. Do we really want the cmdlet name to be so wordy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joe/Jason would like to keep the resourcemanager term. Is it possible to create an alias for the term?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BurtBiel The decision we came to this morning was to use azure resourceGroup [verb]