#333333; cursor: text; font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">Azure CLI made me feel right at home after working at Oracle in the Enterprise Manager CLI, (EMCLI) The syntax is simple, powerful and allows an interface to manage Azure infrastructure from the command line, scripting out complex processing that would involve a lot of time in the user interface.
https://i1.wp.com/dbakevlar.com/wp-content/uploads/2018/10/azurecli.jpg?... 300w, https://i1.wp.com/dbakevlar.com/wp-content/uploads/2018/10/azurecli.jpg?... 768w" sizes="(max-width: 383px) 100vw, 383px" data-recalc-dims="1" />
I’d love to start promoting it to more DBAs and infrastructure folks, but not just for creating databases and a few server/containers/vms, but for the entire STACK. With that request, there’s going to be a lot of follow up blog posts on this one, but let’s just start with a few tips and tricks, along with a 101
Download Azure CLI to your desktop- Its really easy. Just following the defaults and install it on your desktop. There’s no need to restart and it’s readily available from the command prompt, (cmd).
If you think you’ll get by with Notepad for your script editor, don’t even try it. Get a proper text or script editor that tracks lines of code, can handle multiple scripting formats, etc. If you need a suggestion, I am using Sublime Text and it does the trick.
Logging into Azure, if you’re using Azure Active directory is really easy. Just open up a Command Prompt, (cmd from the start menu) and type in the following:
az login
An authorization window to prompt which one of your AD accounts you’re using for Azure you’d like to choose and then it will authorize and proceed. You’ll see the following in the command prompt window once it’s finished.
"You have logged in. Now let us find all the subscriptions to which you have access..."
It will also show you your subscriptions that you have access to in Azure and then return to the prompt. Congratulations, you’re now ready to deploy via the CLI!
#333333; cursor: text; font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">Then get started with it#333333; cursor: text; font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"> by deploying a few test VMs, SQL Databases and maybe a container or two.
You can deploy a VM pretty easily with just a bit of information:
>C:\az vm create -n-g --image UbuntuLTS --generate-ssh-keys SSH key files 'C:\Users\xxxxxxxxxxxx\.ssh\id_rsa' and 'C:\Users\xxxxxxxxxxxxxxxx\.ssh\id_rsa.pub' have been generated under ~/.ssh to allow SSH access to the VM. If using machines without permanent storage, back up your keys to a safe location. - Running .. C:\EDU_Docker>az vm list –n C:\EDU_Docker>az vm delete -n -g #I like to add the group, too.
The CLI will still ask you to verify if you want to delete the resource, but once you confirm, it will remove it and you’ll be back to clean.
The more people that use the CLI, the more robust it will become and the more powerful you become as an infrastructure specialist in Azure. Come on, help a girl out here- I can’t blog about this all on my own…
Recent comments
1 year 3 weeks ago
1 year 15 weeks ago
1 year 19 weeks ago
1 year 20 weeks ago
1 year 25 weeks ago
1 year 46 weeks ago
2 years 14 weeks ago
2 years 44 weeks ago
3 years 28 weeks ago
3 years 29 weeks ago