Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the Azure PowerShell module.
PowerShell
Import-Module [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'AzureRM' which is the older module.
Using 'AzureAD' which is for Azure Active Directory only.
✗ Incorrect
The current Azure PowerShell module is named 'Az'. Use Import-Module Az to load it.
2fill in blank
mediumComplete the code to connect to your Azure account.
PowerShell
Connect-[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Connect-AzureRmAccount which is deprecated.
Using Connect-AzureAccount which is not a valid command.
✗ Incorrect
The command to connect to Azure using the Az module is Connect-AzAccount.
3fill in blank
hardFix the error in the command to list all Azure resource groups.
PowerShell
Get-[1]ResourceGroup Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Get-AzureRmResourceGroup' which is deprecated.
Using 'Get-AzureResourceGroup' which is invalid.
✗ Incorrect
The correct prefix for the current Azure PowerShell module is 'Az'. Use Get-AzResourceGroup.
4fill in blank
hardFill both blanks to create a new Azure resource group in the EastUS location.
PowerShell
New-[1]ResourceGroup -Name "MyResourceGroup" -Location [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'AzureRm' prefix which is deprecated.
Using 'WestUS' instead of 'EastUS' when the instruction says EastUS.
✗ Incorrect
Use 'New-AzResourceGroup' to create a resource group and specify the location as 'EastUS'.
5fill in blank
hardFill all three blanks to update the tags of an existing resource group.
PowerShell
Update-[1]ResourceGroup -Name "MyResourceGroup" -Tag @{ [2] = '[3]' }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'AzureRm' prefix which is deprecated.
Using incorrect tag keys or values.
✗ Incorrect
Use 'Update-AzResourceGroup' to update tags. The tag key is 'Environment' and the value is 'Production'.