Accessing Azure
Our goal in this section is to describe how PowerShell can be used to connect a query with a resource within Azure.
Install and import the Azure PowerShell module
Before diving into reconnaissance, installing and importing the Azure PowerShell module is essential. This module provides cmdlets designed explicitly for interacting with Azure resources:
Install-Module -Name Az -Force -AllowClobber -Scope CurrentUser Import-Module Az
Authenticate and connect to Azure
Authenticate and connect to your Azure subscription to access the resources within the environment:
PS C:\> $Creds = Get-Credential PS C:\> Connect-AzAccount -Credential $Creds Account SubscriptionName TennantID ...