From c2fb16a10267eea2354becf756c89dfa7b60919b Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Thu, 10 Feb 2022 10:15:25 -0600 Subject: [PATCH] Azure: Dev env script updates (untested). --- scripts/azure-create.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/azure-create.sh b/scripts/azure-create.sh index fcbd3e5..08fddeb 100755 --- a/scripts/azure-create.sh +++ b/scripts/azure-create.sh @@ -21,26 +21,24 @@ echo "+++ creating resource group $RESOURCE_GROUP $SUBSCRIPTION" az group create --resource-group $RESOURCE_GROUP --location $LOCATION echo "+++ creating VM $VM" -# Ubuntu is "Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest" +# Ubuntu is "Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest" # Debian is "Debian:debian-10:10:latest" # Resource Group scope "subscriptions/$SUBSCRIPTION/resourceGroups/$RESOURCE_GROUP" az vm create --resource-group $RESOURCE_GROUP --name $VM \ - --image Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest \ + --image Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest \ --size Standard_D2_v4 \ - --storage-sku Standard_LRS \ + --storage-sku StandardSSD_LRS \ --public-ip-sku Standard \ --assign-identity \ --scope "subscriptions/$SUBSCRIPTION/resourceGroups/$RESOURCE_GROUP" \ + --role Contributor \ --admin-username $NAME +echo "+++ get IP for $VM" IP=$(az vm show --name $VM --resource-group $RESOURCE_GROUP -d --query publicIps -otsv) -IDENTITY=$(az vm show --name $VM --resource-group $RESOURCE_GROUP --query identity.principalId -otsv) - -echo "+++ assign the VM the Contributor role to the subscription ($IDENTITY to $SUBSCRIPTION)" -az role assignment create --assignee $IDENTITY --scope /subscriptions/$SUBSCRIPTION --role Contributor echo "+++ wait for boot and cloud-init ${VM} ${IP}" -ssh-keygen -R $IP +ssh-keygen -R "$IP" while ! ssh $NAME@$IP sudo cloud-init status --wait ; do sleep 1 done