LevelUpWith

Explore / Microsoft Azure Administrator (AZ-104) Exam Prep / Practice questions

Microsoft Azure Administrator (AZ-104) practice questions

10 questions from the bank behind this course's timed mock. Free to read and to answer, no account needed, and each has its answer and an explanation. They belong to Microsoft Azure Administrator (AZ-104) Exam Prep.

Answer them one at a time →Read lesson 1 free

  1. Question 1

    An administrator commits a file named main.bicep to source control. The file sets targetScope = 'subscription' and declares a resource group named rg-demo in westeurope. An hour later, rg-demo does not exist in the subscription. The administrator must create the resource group from this file and works only in Azure CLI. What should the administrator do?

    1. Wait for Azure Resource Manager to detect the committed file and create the resource group
    2. Rewrite main.bicep as an ARM template in JSON and commit it again
    3. Run New-AzSubscriptionDeployment -Location westeurope -TemplateFile main.bicep
    4. Run az deployment sub create --location westeurope --template-file main.bicep
    Show the answer

    Answer: D. Run az deployment sub create --location westeurope --template-file main.bicep

    A Bicep file does nothing until it is deployed, and az deployment sub create is the Azure CLI command that deploys it at subscription scope. New-AzSubscriptionDeployment performs the same deployment but is an Azure PowerShell cmdlet, so it breaks the Azure CLI constraint.

  2. Question 2

    You administer a Microsoft Entra tenant that uses default external collaboration settings. Guest contractors can currently read limited properties of other users and the membership of nonhidden groups. Security requires that guests can read only the properties and memberships of their own directory objects. Which setting should you change?

    1. Under Guest invite settings, select "Only users assigned to specific admin roles can invite guest users"
    2. Under Collaboration restrictions, select "Allow invitations only to the specified domains (most restrictive)"
    3. Under Guest user access, select "Guest users have limited access to properties and memberships of directory objects"
    4. Under Guest user access, select "Guest user access is restricted to properties and memberships of their own directory objects (most restrictive)"
    Show the answer

    Answer: D. Under Guest user access, select "Guest user access is restricted to properties and memberships of their own directory objects (most restrictive)"

    Guest user access controls what guests can see in the directory, and its most restrictive option limits them to their own directory objects. The "limited access" option is the default already in place, so selecting it changes nothing.

  3. Question 3

    You are an administrator for two subscriptions, Sub-A and Sub-B. You plan to move a storage account from the resource group rg-src in Sub-A to the resource group rg-dst in Sub-B. Which two conditions must be met before the move can succeed? (Select TWO.)

    More than one answer is right.

    1. You must hold the Owner role on Sub-B at subscription scope.
    2. Sub-A and Sub-B must be in the same Microsoft Entra tenant.
    3. rg-src must have a ReadOnly lock applied during the move.
    4. rg-dst must be in the same region as the storage account.
    5. Sub-B must be registered for the Microsoft.Storage resource provider.
    Show the answer

    Answers: B. Sub-A and Sub-B must be in the same Microsoft Entra tenant.; E. Sub-B must be registered for the Microsoft.Storage resource provider.

    A cross-subscription move requires both subscriptions to be in the same Microsoft Entra tenant and the destination subscription to be registered for the resource's provider. Owner on Sub-B is not required: the move needs only write on the destination resource group and moveResources/action on the source group, and a group's region does not restrict where its resources are.

  4. Question 4

    You are the administrator for a storage account in the East US region. The account is set to Enabled from selected networks. An application runs on virtual machines in a subnet of a virtual network in the West Europe region. You must allow that subnet through the storage firewall by using a virtual network rule. Which service endpoint should you enable on the subnet?

    1. Microsoft.Storage.Global
    2. Microsoft.Storage
    3. Both Microsoft.Storage and Microsoft.Storage.Global
    4. No service endpoint, because a virtual network rule works without one
    Show the answer

    Answer: A. Microsoft.Storage.Global

    Microsoft.Storage.Global reaches storage accounts in any region, so it covers a subnet in West Europe and an account in East US. Microsoft.Storage only reaches accounts in the same region as the virtual network, and a subnet can have only one of the two.

  5. Question 5

    Your company syncs its on-premises Active Directory users to Microsoft Entra ID. Remote staff work on laptops from home networks and have no VPN or other connectivity to the on-premises domain controllers. They must access an SMB Azure file share with their own identities over Kerberos, and you must not distribute the storage account key. Which identity source should you enable on the storage account?

    1. On-premises Active Directory Domain Services (AD DS)
    2. Microsoft Entra Kerberos
    3. A shared access signature (SAS) token scoped to the share
    4. Microsoft Entra Domain Services
    Show the answer

    Answer: B. Microsoft Entra Kerberos

    Microsoft Entra Kerberos supports hybrid identities and requires no client connectivity to domain controllers. On-premises AD DS is the nearest distractor because the users originate there, but it requires clients to reach the domain controllers, which these laptops cannot do.

  6. Question 6

    An administrator uses the Azure portal to create a Linux VM in a new virtual network and accepts the default subnet settings. To meet a security requirement, the VM has no public IP address. An administrator connected from an internal network finds that the VM cannot download packages from an internet repository. The VM must reach the internet without being given a public IP address. What should the administrator do?

    1. Deallocate the VM and start it again so that it receives a new private IP address
    2. Redeploy the VM with the authentication type set to SSH public key
    3. Associate a NAT gateway with the VM's subnet
    4. Add an inbound NSG rule that allows TCP 443 from the internet
    Show the answer

    Answer: C. Associate a NAT gateway with the VM's subnet

    The portal now creates private subnets by default, so a VM with no public IP needs an explicit outbound method such as a NAT gateway. An inbound NSG rule only controls traffic arriving at the VM and does not provide an outbound path to the internet.

  7. Question 7

    You are deploying a container app that pulls its image from a private Azure Container Registry. Security policy states that no registry password may be stored in the container app. Which configuration meets the requirement?

    1. Set --registry-username and --registry-password, so that the password is stored as a container app secret
    2. Set --registry-identity to system and assign the app's managed identity the AcrPull role on the registry
    3. Set --registry-identity to system and also supply --registry-username and --registry-password as a fallback
    4. Set --registry-identity to system and assign the app's managed identity the Reader role on the registry's resource group
    Show the answer

    Answer: B. Set --registry-identity to system and assign the app's managed identity the AcrPull role on the registry

    Managed identity authentication stores no password and requires the identity to hold the AcrPull role on the registry. Username and password authentication stores the password as a secret in the app, which violates the policy, and you must not combine it with a managed identity.

  8. Question 8

    You are an Azure administrator. You peer VNet-Prod and VNet-Test by running `az network vnet peering create` twice, once from each virtual network, passing only the resource group, peering name, `--vnet-name` and `--remote-vnet`. Both links show Connected and the address spaces do not overlap, but VMs in the two virtual networks cannot communicate. The same peering created by a colleague in the portal with default settings works. What should you do?

    1. Run `az network vnet peering sync` on both peering links
    2. Update both peering links to enable `--allow-vnet-access`
    3. Delete both links and re-create them with the same commands in the reverse order
    4. Update both peering links to enable `--allow-forwarded-traffic`
    Show the answer

    Answer: B. Update both peering links to enable `--allow-vnet-access`

    In the Azure CLI, `--allow-vnet-access` defaults to False, whereas the equivalent portal option is selected by default, so the links connect but VM-to-VM communication is not allowed. `--allow-forwarded-traffic` only permits traffic that did not originate in the peered virtual network, such as packets forwarded by an NVA.

  9. Question 9

    A key vault firewall allows only selected networks and contains one IP network rule for the public IP address of VM1. VM1 reads secrets successfully. An administrator then enables the Microsoft.KeyVault service endpoint on the subnet of VM1 and makes no other change. VM1 immediately starts receiving Forbidden errors from the key vault. You must restore access and keep the service endpoint. What should you do?

    1. Assign the Key Vault Secrets User role on the key vault to the managed identity of VM1
    2. Associate a service endpoint policy that lists the key vault with the subnet of VM1
    3. Add a virtual network rule for the subnet of VM1 to the key vault firewall
    4. Add an IP network rule for the private IP address of VM1 to the key vault firewall
    Show the answer

    Answer: C. Add a virtual network rule for the subnet of VM1 to the key vault firewall

    Once the endpoint is enabled, the service sees the VM's private address and subnet identity, so the public IP rule no longer matches and a virtual network rule for the subnet is needed. An RBAC role does not help because authorization was already working; the request is being rejected at the network layer.

  10. Question 10

    You administer a Log Analytics workspace that collects heartbeat data from 60 virtual machines. You must create a single alert rule that runs a KQL query, raises a separate alert for each affected VM, and resolves each alert automatically when the condition clears. Which configuration meets these requirements?

    1. A log search alert rule evaluated every 1 day, split by the Azure Resource ID column, with Automatically resolve alerts selected
    2. A log search alert rule evaluated every 15 minutes, with no dimension splitting and Automatically resolve alerts cleared
    3. A log search alert rule evaluated every 15 minutes, split by the Azure Resource ID column, with Automatically resolve alerts selected
    4. An activity log alert rule scoped to the subscription, with one action group attached
    Show the answer

    Answer: C. A log search alert rule evaluated every 15 minutes, split by the Azure Resource ID column, with Automatically resolve alerts selected

    Splitting by the Azure Resource ID column produces one alert per affected resource, and selecting Automatically resolve alerts makes the rule stateful at a 15-minute frequency. The 1-day option fails because stateful log search rules aren't supported above a 12-hour evaluation frequency.

The full timed mock

50 questions in 100 minutes, with a pass mark of 70%. Each paper is drawn from a bank of questions written for the mock alone, and these 10 are left out of it. Full access opens it, with every level of the course.

See the course →See the plans

LevelUpWith is independent of the organisation that sets this exam. These questions were written for this course; they are not taken from the exam.