How to connect to Azure management tools

Case #

You need to manage Azure Resource Manager (ARM) resources as an administrator. You have a variety of options for administering Azure services, including the Azure management portal, Azure Powershell, Azure CLI, Azure Cloud Shell, Azure mobile app and Azure Rest API clients. This article includes information and guidance about how to connect to Azure management tools.

Further automation of ARM resources can be accomplished via an Infrastructure As Code (IaC) technology. The available IaC options in Azure are Azure ARM and Azure Bicep. ARM and Bicep templates will be analyzed in a separate blog post. The remaining article presents the available Azure management tools, SDKs and APIs, which are available to Azure administrators for accessing and managing Azure resources.

What is Azure Resource Manager? #

Azure Resource Manager (https://docs.microsoft.com/en-us/azure/azure-resource-manager/) is the deployment and management service for Azure. It provides a management layer that enables you to create, update, and delete resources in your Azure account. You use management features, like access control, locks, and tags, to secure and organize your resources after deployment. When a user sends a request from any of the Azure tools, REST APIs, or Azure SDKs, Resource Manager receives the request. It authenticates and authorizes the request. Resource Manager sends the request to the Azure service, which takes the requested action. Because all requests are handled through the same API, you see consistent results and capabilities in all the different tools.The following image shows the role Azure Resource Manager plays in handling Azure requests.

Resource Manager request model

All capabilities that are available in the portal are also available through PowerShell, Azure CLI, REST APIs, and client SDKs. Functionality initially released through APIs will be represented in the portal within 180 days of initial release.

Azure Management Portal #

The most commonly used management tool is the Web-based management portal, which can be accessed from any modern Web browser at: https://portal.azure.com.

There are various other Web-based management portals which are service-specific, such as for example the Azure App Service Kudu service management portal. This can be accessed by authenticating to the following address pattern: .

Azure Powershell #

Azure Powershell utilizes the Az module to access all Azure ARM services and features. Powershell was using the Azure ARM module, which is now gradually being retired. Users can work with both the standard desktop version of Powershell (5.1) or the new Powershell core (7.x). Powershell core is supported on all major platforms and operating systems. Powershell core is the branch of Powershell where Microsoft will be investing their efforts in the future and is the preferred Powershell flavor for Azure since it is also interoperable with all major operating systems.

In order to access your Azure tenant via Powershell core, follow the procedure below:

  1. Install Powershell core.
  2. Install the Powershell Az module.

The Az module has numerous submodules (for example Az.Accounts and Az.Network) and a large list of available Powershell cmdlets, as shown in the example below.

  • Run the following command to interactively authenticate to your Azure tenant:
Connect-AzAccount

You will be redirected to an HTTPS session to authenticate as a global admin user and then you should return to the Powershell session to execute Powershell Az module commands.

Your tenant may have more than one active subscriptions. Run the Get-AzSubscription and then the Set-AzContext cmdlet for selecting your subscription of choice on which to perform actions.

You can navigate available Powershell modules and cmdlets by using the embedded help system. By using the -examples parameter you will receive standard cmdlet usage examples for the requested cmdlet, as shown in the example below.

You can also sign in with Azure Powershell by using a service principal or a managed service identity. For details instructions on these options, refer to the following article: https://docs.microsoft.com/en-us/powershell/azure/authenticate-azureps.

Azure CLI #

Azure CLI is available in all major operating systems. Install Azure CLI and run it by executing command az in the Windows terminal. The first command to run to authenticate to your Azure tenant is:

az login

After you authenticate in an interactive Web browser window, you will see the following notification and you should now be ready to issue commands from within the Azure CLI.

You can run az help for a list of availble Azure CLI commands. Detailed Azure CLI command syntax is available at: https://docs.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest.

One example command to receive all Azure resources is the az resource list command, as shown below.

You can upgrade the Azure CLI by running the az upgrade command.

Azure Cloud Shell #

Azure Cloud Shell can be thought of as a Web-based version of both Azure Powershell and Azure CLI. There are certain limitations when executing commands inside the Azure Cloud Shell. For instance commands which reference local machine resources may fail with permissions error but will work ok if run from Azure Powershell or Azure CLI. Azure Cloud shell requires an Azure storage account and Azure Files resource to be provisioned. Within Azure Cloud shell you can choose between the Powershell and Bash (Azure CLI) flavors.

Azure Cloud Shell can be launched from the top bar inside the Azure Management Portal.

After choosing an Azure storage account and Azure files resource to associated with Azure Cloud Shell, you can choose Powershell vs. Bash flavor and start working in the shell right away.

You can switch between Powershell and Bash at any given time.

Azure mobile app and Azure portal app #

The Azure mobile app has limited features and is supported in Android and iOS mobile devices but offers all the fundamental features which are needed to perform monitoring of your Azure resources whilst on the go. You can use the Azure Cloud Shell to have access to all Azure management features.

Also you can download and install the Azure portal app. In essence this is a Web-based management portal wrapper, which allows you to connect to a Web-based session of the Azure management portal via a dedicated window.

Azure REST APIs #

There is a multitude of Azure APIs which can be called by API clients, such as any custom application written in any supported language for which the Azure REST APIs are available. Supported development runtimes and languages include .NET, Java, Javascript, Python, Go, C++, C, Android, iOS, PHP and Ruby. The following articles provide detailed information about the available Azure APIs:

You should utilize the Azure Graph Explorer Web application to test all available Graph REST API methods.

Azure SDKs and tools for download #

There are various tools which can directly interact with Azure Resource Manager (ARM) resources. These include Visual Studio, Visual Studio Code, Azure Storage Explorer, Azure Key Vault Explorer, Azure AzCopy and Azure Data Studio. More details about the available Azure SDKs and tools can be found at: https://azure.microsoft.com/en-us/downloads/

Sources #

https://docs.microsoft.com/en-us/learn/modules/management-fundamentals/

Powered by BetterDocs