Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you're new to Azure, you'll probably benefit by starting off in the Azure Web Portal. However, taking advantage of the command line and/or the API may offer much greater efficiency a lot sooner than you think; consider revisiting these more-advanced management methods before you get too deep into infrastructure deployment.

Expand

1) Azure Web Portal

The Azure Web Portal allows you to manage your Azure resources in a point-and-click fashion from a Web browser; access it here:

https://portal.azure.com/

For many services – including compute VMs – the Portal permits you to bring up a resource by simply filling out a form that prompts you to select values for resource parameters (such as name, size, and location). Clicking a "Create" button submits your choices and launches your new resource.

Other ways of managing resources (command line and API, below) facilitate working reproducibly and at scale, but require more learning and setup to get started.

2) Command line (local or Cloud Shell)

When you've become familiar with the basic principles of Azure VMs, the az command line tool permits you to carry out many VM infrastructure development and management tasks more quickly and efficiently than is possible via the Web Portal.

You can install Azure CLI tools to run in your Windows, Mac, or Linux environment, or you may run them in your own Docker container:

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli

The Azure Web Portal makes these CLI tools available in a bash shell directly in your browser:

https://docs.microsoft.com/en-us/azure/cloud-shell/quickstart

Microsoft's PowerShell environment, also available directly in your browser via the Portal, offers similar access to command-line Azure management tools:

https://docs.microsoft.com/en-us/azure/cloud-shell/quickstart-powershell

3) API

The Azure Compute REST APIs permit you to manage your Azure VMs from scripts you create, using an Azure SDK. You could even have a Jupyter notebook manage the lifecycle of your VM! Here is a Quickstart guide for python.




Minimum set of specifications parameters you must define

...

In this example above, the cloud-config directives compel your VM to download and install Nvidia GPU drivers and utilities on your VM, and then reboot the machine so that the drivers are loaded and ready to use. You don't have to find any download URLs, unzip anything, or wait for each step to complete before running the next. You also have documentation of what was done to the machine to configure it, and can easily bring up another machine just like the first without having to manually repeat these installations.

Many standard Azure VM images (including examples running Ubuntu, CentOS, and Windows) run the cloud-init service, which can read and execute cloud-config directives. A file of such directives encodes your VM configuration, including software package installations. This enables you to define your VM's configuration in a text file, which can be documented, shared, re-used, and even managed under version control. DTI researchers are strongly encouraged to consider using the built-in cloud-init service in Azure VMs to help manage deployments.

To use the cloud-init service, you may paste cloud-config text into the appropriate form field on the Advanced tab of the Web Portal VM creation screens:

...

This will deliver (and execute) your cloud-config directives to your VM's built-in cloud-init service upon its first boot.

To read more about using cloud-config files with Azure VMs, follow these links to documentation and examples:

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/using-cloud-init

...

https://cloudinit.readthedocs.io/en/latest/topics/examples.html

Note: the cloud-init service is not Azure-specific, with support from other cloud providers as well.


Stopping and starting your VM

...