Question 31 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question 31 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question

HOTSPOT - You are developing an application that needs access to an Azure virtual machine (VM)

The access lifecycle for the application must be associated with the VM service instance.

You need to enable managed identity for the VM.

How should you complete the PowerShell segment? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

$vm = Get-AzVM -ResourceGroupName "ContosoRG" -Name "ContosoVM"

Update-AzVM -ResourceGroupName "ContosoRG" -VM $vm

iv

-Assignidentity: $SystemAssigned
-Identityld $UserAssigned

Explanations

Answer Area

$vm = Get-AzVM -ResourceGroupName "ContosoRG" -Name "ContosoVM"

Update-AzVM -ResourceGroupName "ContosoRG" -VM $vm iv lw

-Assignidentity: $SystemAssigned
-Identityld: $UserAssigned

Box 1: -IdentityType - Enable system-assigned managed identity on an existing Azure VM: To enable a system-assigned managed identity, use the -IdentityType switch on the Update-AzVM cmdlet (see below)

Box 2: $SystemAssigned - $vm = Get-AzVM -ResourceGroupName myResourceGroup -Name myVM Update-AzVM -ResourceGroupName myResourceGroup -VM $vm -IdentityType SystemAssigned Reference: https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/qs-configure-powershell-windows-vm.