AZ 104 Practice Test 4072024 Flashcards

1
Q

Your company has an Azure Active Directory (Azure AD) subscription. You need to deploy five virtual machines (VMs) to your company’s virtual network subnet.

The VMs will each have both a public and private IP address. Inbound and outbound security rules for all of these virtual machines must be identical. Which of the following is the least number of security groups needed for this configuration?

A

1, Single NSG can be applied to the subnet, and the rules within it would be applicable to all VMs within that subnet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which log tracks all control-plane operations that occur within the subscription, like stopping or restarting a virtual machine?

A

Activity Logs. The Azure Monitor activity log is a platform log in Azure that provides insight into subscription-level events. The activity log includes information like when a resource is modified or a virtual machine is started.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which Azure CLI command will be required to create an Azure Key Vault?

A

az keyvault create

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Your organization has hired a new cloud engineer and he should be able to manage cloud engineer’s access as well. You also need to follow Microsoft principle of least privilege.

Which role should be assigned to cloud engineer ?

A

User Access Administrator. Consider assigning the “User Access Administrator” role. This role enables members to handle user access for Azure resources efficiently.

Avoid assigning the “Owner” role. While it provides extensive access to Azure resources, it grants full control, which may exceed the principle of least privilege in this context.

Avoid assigning the “Contributor” role. Although it allows for the creation and management of various resources, it does not cover user access management for Azure resources within the subscription.

Avoid assigning the “User Administrator” role. This is an Azure AD role not a subscription RBAC role.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you successfully delete an Azure Recovery Services Vault that currently protects VM1 and VM2, given that you no longer need to maintain backups for these virtual machines and you are encountering error messages during the deletion process? Which three actions should you perform to delete the Azure recovery services vault?

a. Delete VM1 and VM2.

b. Stop the backup of VM1 and VM2.

c. Disable the soft delete feature and delete all the data.

d. Permanently remove any items in the soft delete state.

e. Delete the backup policy.

A

b, c, d. Soft delete is enabled by default on newly created vaults to protect backup data from accidental or malicious deletes. Backup data that exists in a soft deleted state before disabling this feature will remain in a soft deleted state for a period of 14 days. If you wish to permanently delete these immediately, then you need to undelete and delete them again to get them permanently deleted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which network watcher tool allows you to measure latency between Azure and on-premises resources?

A

The Connection Monitor monitors communication at regular intervals. It informs you of changes in reachability and latency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the primary purpose of the Export-AzResourceGroup cmdlet in Azure PowerShell?

A

To export Azure resources from a resource group to a template file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

You have an administrative unit – Chicago. Below users and groups are added to administrative unit – Chicago.
You need to identify Which Azure AD objects can be administered by Admin of administrative unit.

A

Chris Green, john, group2. Adding a group to an administrative unit brings the group itself into the management scope of the administrative unit, but not the members of the group. In other words, an administrator scoped to the administrative unit can manage properties of the group, such as group name or membership, but they cannot manage properties of the users or devices within that group (unless those users and devices are separately added as members of the administrative unit). Since Godfred is part of group2, that means the admin won’t be able to manage the user Godfred as he is not the direct user added to the administrative unit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You have two Azure virtual networks (VNet-A and VNet-B) connected via a virtual network peering configuration. You want resources in VNet-A to resolve Fully Qualified Domain Names (FQDNs) of resources in VNet-B. What Azure service can you use to achieve this?

A

Azure DNS Private Zones allows you to create a private DNS zone that can be associated with one or more virtual networks. By associating the private DNS zone with both VNet-A and VNet-B, resources in VNet-A can resolve the FQDNs of resources in VNet-B using the private DNS zone, ensuring secure and private name resolution within the connected virtual networks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

You are executing the below PowerShell cmdlet to enable encryption.

$RGName = “MyResourceGroup”

$VMName = “MyTestVM”

$VaultName= “MyKeyVault”

$KeyVault = Get-AzKeyVault -VaultName $VaultName -ResourceGroupName $RGName

$DiskEncryptionKeyVaultUrl = $KeyVault.VaultUri

$KeyVaultResourceId = $KeyVault.ResourceId

$VolumeType = “All”

Set-AzVMDiskEncryptionExtension -ResourceGroupName $RGName -VMName $VMName -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -VolumeType $VolumeType

Is it required to stop the VM first before enabling encryption?

A

False. We can enable encryption on a running IaaS virtual machine in Azure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Your organization has purchased a public domain: cloudportalfinance.com. You configured the cloudportalfinance.com Azure public DNS zone. You have already created an app service and deployed your application to the Azure app service. Your website is currently being accessed from cloudportal.azurewebsites.net. But you want users to be able to access it through the cloudportalfinance.com domain. You create two DNS records (txt and A) using the below PowerShell cmdlets.

Is this the correct method?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

You have an Azure Key Vault in your subscription. You executed the below powershell cmdlet:

$vault = Get-AzKeyVault -ResourceGroupName ‘myrg1’

Below is the output of the cmdlet:

How would you retrieve only the resource ID property of the above-executed cmdlet?

A

$vault.ResourceID. The most common way to get the values of the properties of an object is to use the member access operator (.). Type a reference to the object, such as a variable that contains the object, or a command that gets the object. Then, type the operator (.) followed by the property name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A storage account is “serverless storage” to store data. You can access the data without running a VM from the internet and/or VMs in Azure. Can we also access data on the data disk if the disk is not attached to the VM?

A

False. A storage account is “serverless storage” to store data. You are able to access the data without running a VM from the internet and/or VMs in Azure.
A storage account (fileshare or blob storage, for example) can be used by a VM like a “network share.”.

A data disk is always attached to a VM. You can’t access the data on the data disk directly from the internet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

You have an Azure File Share, Fileshare-01. You are checking the connectivity using the below PowerShell cmdlet.

$hostName = “mystorageaccount.file.core.windows.net”

Test-NetConnection -ComputerName $hostName -Port ___

Which port number should you use for connectivity?

A

445.
# Replace this value with the fully qualified domain name for your storage account.

Different storage accounts, especially in different Azure environments,

may have different suffixes than file.core.windows.net, so be sure to use the correct

suffix for your storage account.

$hostName = “mystorageaccount.file.core.windows.net”

Do the TCP connection test - see the above protocol/port table to figure out which

port to use for your test. This test uses port 445, the port used by SMB.

Test-NetConnection -ComputerName $hostName -Port 445

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

You have an Azure subscription, and below is the hub and spoke topology given.

HUB-VNET is connected to on-premises using a site-to-site VPN, and SPOKE-VNET is peering into HUB-VNET.

How VM1 can communicate with On-premises using the same HUB-VNET virtual network gateway.

Select yes if the statement is true. Otherwise, select no.

Statement: You are planning to use Gateway Transit.

A

Yes, Gatewaytransit is a peering property that lets one virtual network use the VPN gateway in the peered virtual network for cross-premises or VNet-to-VNet connectivity.

To add peering, you can go to HUB-VNET and configure the below settings.

checking the box: Allow traffic to be forwarded from the remote virtual network (allow gateway transit).

Once you enable peering after configuring the option, you will find the Gateway transit option is enabled on the HUB-VNET, which means your Spoke-VNET can use the remote virtual network gateway to communicate with the on-premises environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

You need to create a Network Security group using the PowerShell cmdlet and configure NSG rules to allow RDP and HTTP traffic.

$rule1 = New-AzNetworkSecurityRuleConfig -Name rdp-rule -Description “Allow RDP” `

-Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix `

Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389

$rule2 = New-AzNetworkSecurityRuleConfig -Name web-rule -Description “Allow HTTP” `

-Access Allow -Protocol Tcp -Direction Inbound -Priority 101 -SourceAddressPrefix `

Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 80

New-AzNetworkSecurityGroup -ResourceGroupName TestRG -Location westus -Name `

“NSG-FrontEnd” -SecurityRules $rule1, $rule2

You executed the above PowerShell cmdlet; is it correct?

A

Yes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

You have an Azure Storage account that contains a blob container – container4626.

You need to configure access to container4626.

Which authorization types can be used.

A

Azure AD, shared access signature (SAS) or storage key only.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Let’s examine the following situation:.

The resource group includes:

· Virtual Machine A

· Storage account B

· Virtual network C

You are trying to deploy the below resource using the ARM template:

· Network security group D

Below is the PowerShell cmdlet you are using to deploy the template.

New-AzResourceGroupDeployment -Mode Complete -Name ExampleDeployment `

-ResourceGroupName ExampleResourceGroup `

-TemplateFile c:\MyTemplates\storage.json

As you can see in the above cmdlet, we are using mode as complete. When deploying resources with Azure Resource Manager templates (ARM templates), you have two options for deployment mode: incremental or complete. What will happen if we use mode as complete?

A

Resource Manager deletes resources in the resource group that aren’t specified in the template. -that means virtual machine A, Storage account B, Virtual Network C will be deleted since these are not defined in ARM template. In complete mode, the Resource Manager deletes resources in the resource group that aren’t specified in the template.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A company is looking to amend its security policy to enhance security by reducing the exposure of certain ports—3389 and 22—on its Azure virtual machines (VMs). They want to achieve this while maintaining secure remote access options. Which Azure service can help them achieve this goal?

A

Azure Bastion is the Azure service that enables secure remote access to Azure VMs while reducing the exposure of ports. It allows users to connect to VMs over RDP and SSH without the need for public IP addresses or direct internet exposure. You require access to the Azure portal to use this service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

You have a virtual machine, and Network Security Groups (NSGs) are configured at both the subnet level and NIC level. For inbound traffic, which NSG will be evaluated first?

A

Subnet Level. For inbound traffic, Azure processes the rules in a network security group associated to a subnet first, if there’s one, and then the rules in a network security group associated to the network interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which agent will replace the old log analytics agent for Windows and Linux machines?

A

Azure Monitor Agent (AMA) replaces the Log Analytics agent (also known as MMA and OMS) for Windows and Linux machines in Azure and non-Azure environments, including on-premises and third-party clouds.

22
Q

In the Azure Recovery Services vault, if you delete any data mistakenly, it goes to soft delete to protect your data and recover backups. For how many days is the data retained before being permanently deleted?

A

14 days.

23
Q

Your organization has an Azure subscription.

You are planning to create a virtual machine scale set (VMSS) that has the following settings:.

· Resource group name: RG1

· Region: West US

· Orchestration Mode: uniform

· Security type: Standard

· OS disk type: SSD standard

You need to add custom virtual machines to VMSS.

Which settings do you need to modify?

A

Orchestration Mode.
Uniform Mode: In uniform mode, all VM instances in the VMSS are identical, using the same image and configuration. Since our requirement is to add custom virtual machines to VMSS, we need to choose orchestration mode as Flexi, as you can have a mix of custom and platform images within the same VMSS.

24
Q

Your Azure subscription contains 10 virtual machines. You need to enable alerts if any virtual machine restarts, stops, or delocalizes. Alerts must be sent to three administrators by email and Azure App push notifications.

You need to create alert rules, action groups, and actions in the Azure portal.

What are the minimum number of alert rules, action groups, and actions you should create?

A

Alert Rules = 3; Action groups = 1; Actions = 3.
You need to establish three alert rules, each corresponding to a specific condition: restarting a virtual machine, powering off a virtual machine, and deallocating a virtual machine.

Additionally, you should create a single action group, which can be linked to multiple alert rules. Within this action group, you will define multiple actions.

To cater to three administrators, you must create three distinct actions within the action group.

25
Q

You have an Azure virtual machine (Prod-VM01).

You received a notification that prod-vm01 will be affected by maintenance.

You need to move prod-vm01 to a different host immediately.

Solution: From the Redeploy+reapply blade, you click Redeploy.

Does this meet the goal?

A

Yes.
If you have been facing difficulties troubleshooting a remote desktop (RDP) connection or application access to a Windows-based Azure virtual machine (VM), redeploying the VM may help. When you redeploy a VM, Azure will shut down the VM, move the VM to a new node within the Azure infrastructure, and then power it back on, retaining all your configuration options and associated resources.

26
Q

You have an Azure subscription, which contains the following resources:

Prod-VM1 (virtual machine)

Prod-Webapp1 (app service)

Contoso.com (Azure AD domain services)

All the resources connect to prod-vnet1. You are planning to deploy an Azure Bastion host from Prod-Bastion1 to Prod-Vnet1.

Which resources can be protected by Prod-Bastion1?

A

Prod-VM1 only.
Bastion provides secure RDP and SSH connectivity to all of the VMs in the virtual network on which it is provisioned.

27
Q

Your organization wants to start using Azure premium file shares to replace on-premises file servers.

You have the storage account in your Azure Subscription as shown below.
Select Yes if the statement is True. Otherwise select No.

Statement: You should create a new premium storage account since existing storage accounts will not allow you to create premium file share

A

Yes.
To provision an Azure premium file share, creating a new storage account is required even though it incurs additional costs. Converting an existing General-Purpose storage V2 account to Azure premium file share is not feasible.

In the below screenshot provided, you’ll notice that to create a premium file share, you must choose “Premium” as the storage account performance level and set the account type to “File Share.”

28
Q

You have migrated your on-premises web application to the Azure web app, prod-webapp. After migration, it has been observed that the website is not accessible using the old domain name, https://www.cloudfinanceportal.com.

You need to configure DNS to resolve this issue.

Which two DNS records are needed to resolve this issue?

A

Create CNAME record and map it to prod-webapp.azurewebsites.net

A record points the domain (www.cloudfinanceportal.com) to the specific IP address where your Azure Web App is hosted. Make sure the IP address you provide is the correct public IP address of your Azure Web app.

The CNAME record allows you to alias one domain name to another.

29
Q

You are a global administrator in an Azure AD tenant responsible for managing user access to Azure resources. You need to invite an external partner to collaborate on a project in your Azure environment, but you are encountering an error: unable to invite a user. a generic authorization exception when trying to invite guest users.

What should you check to resolve this problem?

A

Verify that external collaboration settings allow guest invitations.

To invite guest users to your Azure AD tenant, it’s essential to ensure that your external collaboration settings allow guest invitations. Azure AD provides settings to control who can invite guests and collaborate externally. By verifying and adjusting these settings as necessary, you can resolve issues related to inviting guest users.

30
Q

Your organization has deployed Microsoft 365 Business Standard licenses and has implemented Azure Active Directory self-service password reset. Now, you aim to establish a hybrid environment that connects your on-premises Active Directory Domain Services to Azure AD. As part of this setup, you must enable password writeback from Azure AD to your on-premises network.

Select Yes if the statement is True. Otherwise select No.

Statement: Microsoft 365 Business Standard License supports password writeback.

A

Yes.
You need at least an Azure AD Premium P1 or P2 license, or a Microsoft 365 Business Premium license for password writeback.

31
Q

You have an Azure subscription, and there are 100 virtual machines in your subscription. You need to identify the underutilized VMs so that the service tier of those VMs can be changed to a less expensive offering.

Which Azure service will you use?

A

Advisor.

Azure Advisor is a personalized cloud consultant that helps you follow best practices to optimize your Azure deployments. It analyzes your resource configuration and usage telemetry and then recommends solutions that can help you improve the cost effectiveness, performance, reliability (formerly called high availability), and security of your Azure resources.

32
Q

You have the below NSG configured in your Azure environment.

At the destination, we are directly providing the names of the services. What are these called?

A

Service tags.

33
Q

You have an Azure Resource Manager (ARM) template designed to deploy 10 virtual machines, and you want to automate the deployment. Identify one PowerShell and one Azure CLI command for this task. What are the two commands you would select?

A

1) az deployment group create & New-AzResourceGroupDeployment.

34
Q

In your Azure subscription named Subscription1, which contains an Azure Log Analytics workspace named Workspace1, you need to view the error events from a table named Event. What query should you run in Workspace 1?

A

search in (Event) “error”

35
Q

You have an Azure subscription that contains a resource group named Prod-RG1 in the West Europe location.

Prod-RG1 contains the resources shown in the following table:

Prod-SQLDB01 is a backup to Prod-RGV1.

This entire setup was part of a testing project. Your testing is done, and you are trying to delete the resource group, Prod-RG1, but deletion fails.

What should you do first?

A

Stop the backup of Prod-SQLDB01.

You can’t delete a vault that contains protected data sources (for example, IaaS VMs, SQL databases, or Azure file shares).

You can’t delete a vault that contains backup data. Once backup data is deleted, it will go into the soft deleted state.

You can’t delete a vault that contains backup data in the soft deleted state.

You can’t delete a vault that has registered storage accounts.

So, before you can delete a recovery services vault, you need to stop the backup and delete the backup data.

36
Q

You deploy an Azure Kubernetes cluster (AKS) named prod-AKS1. You have created a YAML file to create a POD. You need to deploy this YAML file to AKS.

Solution: From Azure CLI, you run Kubectl client?

Does this meet the goal?

A

Yes,

Deploy the application using the Kubectl apply command and specify the name of your YAML manifest.

37
Q

Which PowerShell cmdlet allows you to create a new Virtual machine scale set?

A

New-AzVmss

38
Q

You want to implement Azure file share on your on-premises Windows server. What is the recommended Windows OS required?

A

Windows server 2019 and above.

39
Q

You need to create a DNS record set with the relative name www in DNS Zone contoso.com. Fully qualified domain name of the record set will be www.contoso.com.

Record Type is ‘A’ and TTL is 3600 seconds. Record set contains a single record set with IP Address ‘1.2.3.4’.

Complete the PowerShell cmdlet.

A

A = “1.2.3.4”, B = New-AzDnsRecordSet

40
Q

We need to upload a blob to a storage account (Prod-storage01). You have created the storage context using the below PowerShell command.

$Storage = “Prod-storage01”

$Container = container1.

$Context = New-AzStorageContext -StorageAccountName $Storage -UseConnectedAccount

We need to upload a BLOB to a container. Which PowerShell cmdlet allows you to upload a Blob to a container?

_______________ -Container $Container -File “Prod-RG1.json” -Blob “Prod-RG1.json” -context $Context -StandardBlobTier Hot

A

Set-AzStorageBlobContent

41
Q

In your Azure subscription, there is a highly important resource group named “Prod-rg1.” The subscription owner intends to prevent the deletion of the resource group itself or any resources contained within it.

Which solution would you recommend. You also want to use a minimal amount of administrative effort.

A

Add a delete lock on the resource group itself. We can also place a lock on the resources inside a resource group as well, but it involves more administrative effort. Since our requirement is to use a minimal amount of administrative effort, we should place a lock on the resource group itself.

42
Q

You have an existing virtual machine (VM) in Azure, and you want to add it to an availability set for high availability. What is the correct approach to achieving this?

A

You cannot add an existing VM to an availability set; you must create a new VM within the set.

A VM can only be added to an availability set when it is created. To change the availability set, you need to delete and then recreate the virtual machine.

43
Q

Apply the below tag to the resource group - EngineerBlog. Which PowerShell cmdlet will you choose to apply the tag to the resource group?

$tags = @{Name=”CostCenter”; Value=”0001”}

A

Set-AzResourceGroup -Name “EngineerBlog”-Tag $tags

44
Q

You must create an alert in Azure Monitor. You must create an action group that will be used to send voice and SMS messages.

What is the maximum number of voice and SMS messages that will be sent in an hour if the alert gets triggered every minute?

A
  1. Both SMS and voice are limited to no more than one notification every five minutes.
45
Q

You have to create an alert in Azure Monitor. You must create an action group that will be used to send email and SMS messages.

What is the maximum number of email messages that will be sent in an hour if the alert gets triggered every minute?

A
  1. An email message will be generated every minute.
46
Q

Your company has an Azure Active Directory (Azure AD) subscription. You need to deploy five virtual machines (VMs) to your company’s virtual network subnet. The VMs will each have both a public and private IP address. Inbound and outbound security rules for all of these virtual machines must be identical. Which of the following is the least number of network interfaces needed for this configuration?

A
  1. 5 VMs, so 5 NIC cards would be needed.
47
Q

The following sample rule filters the Storage account to run the actions on objects that exist inside sample-container and start with blob1.

{

“rules”: [

{

“enabled”: true,

“name”: “sample-rule”,

“type”: “Lifecycle”,

“definition”: {

“actions”: {

“version”: {

“delete”: {

“daysAfterCreationGreaterThan”: 90

}

},

“baseBlob”: {

“tierToCool”: {

“daysAfterModificationGreaterThan”: 30

},

“tierToArchive”: {

“daysAfterModificationGreaterThan”: 90,

“daysAfterLastTierChangeGreaterThan”: 7

},

“delete”: {

“daysAfterModificationGreaterThan”: 2555

}

}

},

“filters”: {

“blobTypes”: [

“blockBlob”

],

“prefixMatch”: [

“sample-container/blob1”

]

}

}

}

]

}

Select Yes if the statements are true. Otherwise, Select No.

Delete previous Blob versions 90 days after creation.

Tier blob to cool tier 30 days after last modification.

A

Yes, Yes.

Previous blob versions are deleted automatically 90 days after creation.

It will tier blob to cool tier 30 days after last modification.

48
Q

You have below Azure VM in your subscription.

You need to create 10 more VMs based on the same configuration. Which blade will you use so that you can use the existing ARM template and modify it according to your requirements?

A

A. You need to click on Export Template to download the ARM template.

49
Q

Which Network Watcher tool allows you to check if a packet is allowed or denied to or from a virtual machine?

A

IP Flow verify. IP flow verify checks if a packet is allowed or denied to or from a virtual machine. The information consists of direction, protocol, local IP, remote IP, local port, and a remote port. If the packet is denied by a security group, the name of the rule that denied the packet is returned.

50
Q

The policy must be configured to require members of the Global Administrators group to use multi-factor authentication and an Azure AD-joined device when they connect to Azure AD from untrusted locations.

Solution: You can access the multi-factor authentication page to alter the user settings. Does the solution meet the goal?

A

No. The most effective approach for implementing multi-factor authentication (MFA) is through conditional access policies.