pasobwant.blogg.se

Install azure cli on linux vm
Install azure cli on linux vm













install azure cli on linux vm
  1. #INSTALL AZURE CLI ON LINUX VM CODE#
  2. #INSTALL AZURE CLI ON LINUX VM WINDOWS#

|- create_az_instance.sh -> Launch a vm ( requires a vnet) |- check_az_vmsize.sh -> Displays available vmsize per chosen vcpu number |- check_az_image.sh -> Displays most recent image details per OS type Below are the files you will find after cloning the directory (with embedded hyperlinks).Pick an area on your file system and issue the following command.Note: The default region used in this lab will depend on your resource group or the configured region parameter.| output | /home/brokedba/.azure/config | table | $ az config set defaults.output= table +-+-+ Your public key has been saved in /home/brokedba/id_rsa_az.pub. Your identification has been saved in /home/brokedba/id_rsa_az.

install azure cli on linux vm

$ ssh-keygen -P "" -t rsa -b 2048 -m pem -f ~/id_rsa_az below is the PEM based key pair I generated for this lab

  • ssh key pair to attach to your azure vm.
  • I will assume that the below elements are present/configured in your workstation: If your cli environment is not configured yet, go check my previous post ( az-cli installation) it’s very easy. The following figure shows the layers involved between our workstation and Azure while running the cli commands. This will hopefully give beginners a glimpse on az-cli capabilities that make it so handy.Ī big shout out to Stackoverflow community that made my life easier while bash scripting my way to pull this off.

    #INSTALL AZURE CLI ON LINUX VM CODE#

    The code also ensures that required network components like subnet or security group are created if missing during the launch.

    #INSTALL AZURE CLI ON LINUX VM WINDOWS#

    In total, 6 interactive BASH scripts & userdata files were used with Windows turning out to be the nastiest to deploy (I’ll explain why). With a little patience and few days debugging bash errors, my interactive scripts can now automate the provisioning of a webserver on 6 different OS ( RHEL, Centos, Oracle Linux, Ubuntu, SUSE, Windows server 2016) Here’s also a gif demo to see things in motion: I. Here’s a direct link to my Github repo with all the scripts: What comes along when you test your third cli tool in a row though, is how easy it is to spot differences with other cloud platforms (expect to see some in this post). Thus, az-cli became my third victim after oci-cli and aws-cli.Īs in my previous cli tutorials, the aim is to demonstrate how the CLI tool can enrich your IaC experience when combined with powerful shell scripts. Azure cli was another tool I had to try right after passing Az-900 azure certification, because what are certifications for if it’s not to give a little itching to get your hands a little dirty.















    Install azure cli on linux vm