SaveMyCert
Log in
5 of 5 free questions left today·for 30 a day
AZ-104 practice

AZ-104 sample questions — 25 answered and explained

25 AZ-104 sample questions written to the official Microsoft Certified: Azure Administrator Associate exam guide, grouped by exam domain and weighted like the real exam. Each shows the correct answer, why every other option is wrong, and the lesson that teaches it. None of them repeat the examples on the other AZ-104 practice pages.

On this page
25
answers included
Full bank
592
on the practice page
Domains
5
weighted like the exam
Free, no account
5/day
a free account allows 30 a day

Domain 1: Manage Azure identities and governance

24% of the AZ-104 exam, so 6 of the 25 questions on this page.

Question 1Manage Azure identities and governance

A dynamic security group must include every user whose department attribute is Sales or Marketing, and nobody else. Each user has exactly one department value. Which membership rule meets the requirement?

Choose one.

  • a
    (user.department -eq "Sales") -or (user.department -eq "Marketing") Correct

    -or matches a user when either condition is true, so users in either department are included and no others.

  • b
    (user.department -eq "Sales") -and (user.department -eq "Marketing")

    -and needs both conditions true at once; a single-valued department can't equal two values, so the group stays empty.

  • c
    (user.department -eq "Sales") -or (user.jobTitle -eq "Marketing")

    The second condition reads job title, so Marketing staff whose title isn't literally Marketing are missed and others could match.

  • d
    (user.department -ne "Sales") -or (user.department -ne "Marketing")

    Every user differs from at least one of the two values, so this matches everyone in the tenant.

The concept

Dynamic membership rules combine attribute expressions with logical operators, and the operator choice decides who matches.

Why that’s the answer

With one department value per user, either-or membership is an -or of two equality checks on department. Joining them with -and requires one value to equal two strings, which matches nobody. Swapping one condition to jobTitle tests the wrong attribute. Using -ne with -or is true for every user, since nobody can equal both values. The -in operator with a list would also work, but it is not offered here.

How to reason it out
  1. Translate 'Sales or Marketing' into two equality expressions on department.
  2. Join them with -or because a user only needs to satisfy one.
  3. Check the edge cases: -and matches none, -ne with -or matches all.

Exam tip: Either-or membership on one attribute is -or of -eq expressions (or -in); -and on one single-valued attribute matches nobody.

Manage Microsoft Entra Users and Groups (AZ-104) — the lesson that teaches this.

Question 2Manage Azure identities and governance

You are filling in the Bulk invite CSV template to add 60 people from a supplier as guests. The upload fails validation for rows where you completed only some of the columns. Which two values must each row contain?

Choose one.

  • a
    Each person's display name and an initial password

    An initial password is a Bulk create column for member accounts; guests authenticate with their own credentials.

  • b
    Each person's user principal name and usage location

    These are set on member accounts and for licensing; a guest's UPN is generated from the invitation, not supplied.

  • c
    Each person's email address and a send-invitation flag

    The email address is required, but whether to send the invitation message is an optional column.

  • d
    Each person's email address and a redirection URL Correct

    Bulk invite requires the email address to invite and the URL the guest is sent to after redeeming.

The concept

Each bulk operation uses a fixed CSV template with its own required columns.

Why that’s the answer

The Bulk invite template requires the email address to invite and the redirection URL the guest lands on after redemption; columns such as the invitation message and whether to send it are optional. An initial password belongs to the Bulk create template for members. A guest's UPN is generated from the invited address, and usage location is a licensing property. The tempting near-miss pairs the right email column with an optional column.

How to reason it out
  1. Recognize Bulk invite creates B2B guests, not members.
  2. Recall its two required columns: email address to invite and redirection URL.
  3. Treat the message text and send flag as optional columns.

Exam tip: A Bulk invite row needs the invitee's email address and a redirection URL.

Manage Microsoft Entra Users and Groups (AZ-104) — the lesson that teaches this.

Question 3Manage Azure identities and governance

Company policy lets employees invite guests only from four approved partner domains, and invitations to any other domain must be rejected. Two of the partners use their own email domains hosted outside Microsoft (for example, Google Workspace) and have no Microsoft Entra tenant. Where should you configure the restriction?

Choose one.

  • a
    Cross-tenant access settings, adding each partner as an organization

    Cross-tenant access settings control B2B collaboration with other Microsoft Entra tenants; the two partners without a tenant can't be added as organizations.

  • b
    A Microsoft Entra Conditional Access policy that targets guest users

    Conditional Access evaluates sign-ins after an account exists; it does not stop invitations being sent to a domain.

  • c
    External collaboration settings in Microsoft Entra ID Correct

    External collaboration settings hold the collaboration restrictions: allow invitations only to specified domains, or deny specified domains.

  • d
    Guest user access restrictions in user settings

    That setting limits what guests can see in the directory once they are in; it does not decide which domains can be invited.

The concept

Invitation domain allow and deny lists live in External collaboration settings; cross-tenant access settings work per Microsoft Entra organization.

Why that’s the answer

The requirement is a domain allowlist for invitations that also covers partners who have no Microsoft Entra tenant. External collaboration settings provide collaboration restrictions that allow invitations only to specified domains, which fits. Cross-tenant access settings are configured per Microsoft Entra organization, so they can't express the partners that have no tenant. Conditional Access acts at sign-in, not at invitation. Guest user access restrictions govern what guests can read in the directory.

How to reason it out
  1. Note the control point is the invitation, filtered by domain.
  2. Note some partners have no Microsoft Entra tenant, which rules out per-organization settings.
  3. Configure 'Allow invitations only to the specified domains' in External collaboration settings.

Exam tip: Restrict which domains can be invited with the allow/deny list in External collaboration settings.

Manage Microsoft Entra Users and Groups (AZ-104) — the lesson that teaches this.

Question 4Manage Azure identities and governance

A contractor must stop receiving access granted through a security group whose membership rule is user.department -eq "Finance". On the group's Members page, you find no way to remove him, although you can remove members from other groups you own. What explains this?

Choose one.

  • a
    You lack the Groups Administrator role that this group requires

    You can already edit other groups you own, and a role gap wouldn't explain why removal is missing for this group's members only.

  • b
    Its members are computed from an attribute, not edited by hand Correct

    The group is dynamic: membership follows the department attribute, so you change his department or add an exclusion to the rule instead.

  • c
    It is synchronized from on-premises AD, which manages its members

    Synced groups are read-only in the cloud, but their membership comes from AD; a group carrying a cloud membership rule is not a synced group.

  • d
    It is role-assignable, so membership changes need privileged roles

    Role-assignable groups do restrict who can manage membership, but they can't use dynamic membership, and this group has a rule.

The concept

In a dynamic group, membership is computed from the rule; members can't be added or removed manually.

Why that’s the answer

A group with a membership rule is dynamic, and Microsoft Entra ID doesn't let anyone add or remove its members by hand. To take the contractor out, correct his department attribute, or edit the rule (for example, add a condition that excludes him), and let it reprocess. A synchronized group is also read-only in the cloud, but its membership is managed in on-premises AD and it has no cloud rule. A role-assignable group limits who can manage members, but role-assignable groups can't be dynamic. A missing admin role is ruled out because you edit other groups.

How to reason it out
  1. Spot the membership rule: the group is dynamic.
  2. Recall that dynamic group members can't be added or removed manually.
  3. Rule out the other read-only causes: synced groups have no cloud rule, and role-assignable groups can't be dynamic.
  4. Change the user's attribute or the rule, then wait for processing.

Exam tip: To get someone out of a dynamic group, change their attribute or the rule, not the member list.

Manage Microsoft Entra Users and Groups (AZ-104) — the lesson that teaches this.

Question 5Manage Azure identities and governance

You need a group that automatically contains every Windows device registered in the tenant, so that device configuration can target it. The membership should update as devices are added. How should you create the group?

Choose one.

  • a
    Security group, membership type Dynamic Device, with a rule on device.deviceOSType Correct

    Security groups support Dynamic Device membership, and deviceOSType is a device attribute, so Windows devices are added automatically.

  • b
    Microsoft 365 group, membership type Dynamic Device, with a rule on device.deviceOSType

    Microsoft 365 groups contain users only and can't use Dynamic Device membership.

  • c
    Microsoft 365 group, membership type Dynamic User, with a rule on device.deviceOSType

    Microsoft 365 groups can't hold devices at all, and a Dynamic User rule can't reference device attributes.

  • d
    Security group, membership type Dynamic User, with a rule on device.deviceOSType

    A Dynamic User group evaluates user objects; device attributes can't be used in a user rule, so it can't contain devices.

The concept

Only security groups can contain devices and use Dynamic Device rules; Microsoft 365 groups are user-only.

Why that’s the answer

Two choices must line up: the group type that can hold devices (security) and the membership type that evaluates device objects (Dynamic Device). Microsoft 365 groups contain users only, which rules out both of their combinations. A security group set to Dynamic User is the near-miss: right group type, but the rule evaluates users, and user and device attributes can't be mixed in one rule.

How to reason it out
  1. The members are devices, so the group must be a security group.
  2. Device attributes need the Dynamic Device membership type.
  3. Write a rule such as device.deviceOSType -eq "Windows".

Exam tip: Dynamic device membership requires a security group set to Dynamic Device.

Manage Microsoft Entra Users and Groups (AZ-104) — the lesson that teaches this.

Question 6Manage Azure identities and governance

Users are synchronized from on-premises Active Directory with Microsoft Entra Connect and password hash synchronization. After you enable SSPR, users who reset their password in the cloud still have to use the old password on domain-joined PCs. What must you configure?

Choose one.

  • a
    Group-based licensing for the synchronized users

    Licensing assigns products to users; it does not move password changes between directories.

  • b
    Password hash synchronization in Microsoft Entra Connect

    Password hash sync is already in place and only flows on-premises password hashes up to the cloud, not cloud resets down to AD.

  • c
    Password writeback in Microsoft Entra Connect Correct

    Password writeback sends passwords changed or reset in the cloud back to on-premises AD, so the new password works on domain-joined PCs.

  • d
    Seamless single sign-on in Microsoft Entra Connect

    Seamless SSO signs domain-joined users in to cloud apps automatically; it does not change the on-premises password.

The concept

For accounts synced from on-premises AD, password writeback pushes cloud SSPR changes back to Active Directory.

Why that’s the answer

The symptom is a cloud reset that never reaches AD, which is the gap password writeback fills. Password hash synchronization is the tempting answer because it is also a password feature of Microsoft Entra Connect, but it runs the other way, from AD to the cloud. Seamless SSO handles sign-in convenience, and group-based licensing assigns products. Writeback also needs Microsoft Entra ID P1 (or Microsoft 365 Business Premium).

How to reason it out
  1. Note the accounts are synchronized and the cloud reset doesn't reach AD.
  2. Recall that hash sync flows AD to cloud only.
  3. Enable password writeback (Microsoft Entra Connect or Cloud Sync) and turn it on in Password reset > On-premises integration.

Exam tip: SSPR for synced users needs password writeback; password hash sync only flows the other way.

Manage Microsoft Entra Users and Groups (AZ-104) — the lesson that teaches this.

Domain 2: Implement and manage storage

19% of the AZ-104 exam, so 5 of the 25 questions on this page.

Question 7Implement and manage storage

VMs in the app subnet of VNet1 must reach a storage account. Every other source, including the internet and other subnets, must be blocked. The networking team will not create or change any DNS zones or records for this project, and you want the fewest new resources. What should you configure?

Choose one.

  • a
    A private endpoint for the account in the app subnet and a private DNS zone

    A private endpoint would work, but it needs a private DNS zone (or records) for name resolution, which the networking team will not create, and it adds new resources.

  • b
    A Microsoft.Storage service endpoint on the app subnet and a virtual network rule Correct

    Correct. The service endpoint lets the firewall identify the subnet's traffic, and a virtual network rule with the default action set to Deny admits only that subnet; DNS is unchanged and no new resources are deployed.

  • c
    A Microsoft.Storage service endpoint on the app subnet and a default action of Allow

    The service endpoint alone does not restrict anything; with the firewall default action at Allow, the internet and other subnets can still connect.

  • d
    An IP network rule for the app subnet's private address range on the account

    Storage firewall IP network rules accept public address ranges only; private address ranges are not allowed, so this rule cannot admit the subnet.

The concept

Subnet-only access to a storage account can be built two ways: a service endpoint plus a virtual network rule on the storage firewall (public endpoint, no DNS change), or a private endpoint (private IP, needs private DNS).

Why that’s the answer

Both the service-endpoint design and the private endpoint can restrict access to the subnet. The constraints decide: no DNS changes and the fewest new resources rule out the private endpoint, which relies on a private DNS zone and a new network interface. A service endpoint without the virtual network rule and Deny default leaves the account open. IP rules cannot hold private ranges, and same-region traffic is not matched by IP rules anyway.

How to reason it out
  1. List the workable designs: service endpoint plus virtual network rule, or private endpoint.
  2. Apply the DNS constraint: a private endpoint needs private DNS, so it is out.
  3. Check the remaining service endpoint option actually restricts access (Deny default plus virtual network rule).
  4. Reject the IP rule because the firewall accepts only public ranges.

Exam tip: Subnet-only access without DNS changes = service endpoint + virtual network rule; private endpoints are the answer when traffic must use a private IP.

Configure Access to Azure Storage: SAS, Keys & Firewalls (AZ-104) — the lesson that teaches this.

Question 8Implement and manage storage

An on-premises application reaches Azure through ExpressRoute private peering into VNet1. It must read from a storage account whose public network access is set to Disabled, and its traffic must not traverse the public internet. What should you deploy?

Choose one.

  • a
    A Microsoft.Storage service endpoint on the VNet1 gateway subnet

    Service endpoints secure traffic that originates in the Azure subnet; they are not used for on-premises traffic and still target the public endpoint, which is disabled.

  • b
    A firewall IP network rule for the on-premises public egress range

    An IP rule admits traffic arriving at the public endpoint, which is disabled here, and that traffic would not stay on the private connection.

  • c
    A privatelink.blob.core.windows.net private DNS zone linked to VNet1

    The zone only resolves names; without a private endpoint there is no private IP for its record to point at, and the account's public endpoint is disabled.

  • d
    A private endpoint for the storage account in the VNet1 address space Correct

    Correct. The private endpoint gives the account a private IP address in VNet1, which on-premises clients reach over ExpressRoute private peering even with public network access disabled.

The concept

A private endpoint projects a storage account into a virtual network with a private IP address. Anything that can route to that VNet privately, including on-premises networks over VPN or ExpressRoute private peering, can then use the account without its public endpoint.

Why that’s the answer

With public network access disabled, only private endpoints can carry traffic to the account. Service endpoints and IP rules act on the public endpoint, and service endpoints do not extend to on-premises sources. The privatelink DNS zone is part of a private endpoint design, but on its own it has nothing to resolve to; it complements the endpoint rather than replacing it. On-premises DNS must then resolve the account name to the private endpoint IP, typically by forwarding to Azure private DNS.

How to reason it out
  1. Note that the public endpoint is disabled.
  2. Recall which features act on the public endpoint: IP rules and virtual network rules with service endpoints.
  3. Recall that a privatelink DNS zone only resolves to a private endpoint that already exists.
  4. Choose the private endpoint, reachable over private peering.

Exam tip: Public endpoint disabled or traffic must stay private from on-premises = private endpoint.

Configure Access to Azure Storage: SAS, Keys & Firewalls (AZ-104) — the lesson that teaches this.

Question 9Implement and manage storage

You change a storage account's public network access to Enabled from selected virtual networks and IP addresses and add only the production subnet. Administrators in the head office now get an authorization error when they open a container in the Azure portal to list its blobs. Their role assignments are unchanged, and the restriction must stay in place. What should you do?

Choose one.

  • a
    Change the firewall default action on the account back to Allow

    This restores portal access but removes the restriction that must stay in place.

  • b
    Allow trusted Microsoft services through the public network firewall

    The exception admits listed Azure platform services; data requests from the portal come from the administrators' browsers, which it does not cover.

  • c
    Add the head office's public IP range as an IP network rule Correct

    Correct. Portal data browsing sends data-plane requests from the user's browser, so the office's public egress range must be allowed by the firewall.

  • d
    Assign the head office admins the Storage Account Contributor role

    A stronger role does not help: the request is rejected by the network rule before authorization is evaluated, and the error persists from an unlisted IP.

The concept

Portal data browsing (listing containers and blobs) is a data-plane request sent from the user's browser, so the storage firewall evaluates the user's public IP. A firewall denial surfaces in the portal as an authorization error.

Why that’s the answer

The firewall now admits only the production subnet, so requests from the head office's public IP are rejected; the portal reports this as "not authorized", which tempts candidates toward RBAC changes. Adding an IP network rule for the office range fixes it while keeping the restriction. Opening all networks drops the restriction, the trusted services exception covers platform services, not browsers, and roles cannot override a network denial.

How to reason it out
  1. Notice the change that preceded the error: the firewall default moved to Deny.
  2. Recall that portal data browsing originates from the user's browser IP.
  3. Recognise that a network denial appears as an authorization error.
  4. Allow the office's public range with an IP network rule.

Exam tip: A storage firewall blocks portal data browsing too; allow the admins' public IP range rather than reaching for RBAC.

Configure Access to Azure Storage: SAS, Keys & Firewalls (AZ-104) — the lesson that teaches this.

Question 10Implement and manage storage

You are creating a service SAS for a vendor's integration. The token must be rejected when it is presented from anywhere other than the vendor's corporate network addresses. Which SAS query parameter enforces this?

Choose one.

  • a
    The spr parameter

    The signed protocol (spr) parameter limits the token to HTTPS requests; it does not restrict where requests come from.

  • b
    The sip parameter Correct

    Correct. The signed IP (sip) parameter lists the address or range, such as sip=203.0.113.0-203.0.113.255, that the token may be used from; requests from any other source address are rejected.

  • c
    The sr parameter

    The signed resource (sr) parameter sets the token's scope, for example sr=b for one blob; it says nothing about the source address.

  • d
    The se parameter

    The signed expiry (se) parameter controls when the token stops working, not where it can be used from.

The concept

Every SAS carries its own constraints as signed query parameters: permissions (sp), start and expiry (st, se), signed resource (sr), allowed protocol (spr) and allowed IP address or range (sip).

Why that’s the answer

The sip parameter binds the token to a source address or range, so the vendor's token fails from anywhere else. spr, sr and se are real constraints on protocol, scope and time, which makes them plausible but not location controls. A storage firewall rule would also restrict by address, but it applies to every client of the account, not to one token.

How to reason it out
  1. Classify the requirement: restriction by request source address.
  2. Map each parameter: spr protocol, sr scope, se expiry, sip source IP.
  3. Choose sip with the vendor's range.

Exam tip: sip pins a SAS to a source IP or range; spr pins the protocol; se sets the expiry.

Configure Access to Azure Storage: SAS, Keys & Firewalls (AZ-104) — the lesson that teaches this.

Question 11Implement and manage storage

A storage account in West Europe receives Azure Monitor resource logs from diagnostic settings on resources in the same region. After you set the account's public network access to selected virtual networks and IP addresses, the logs stop arriving. Other networks must stay blocked. What should you do?

Choose one.

  • a
    Change the firewall default action on the account back to Allow

    This restores log delivery but drops the network restriction that must stay in place.

  • b
    Add the Azure Monitor service tag IP ranges as IP network rules

    IP network rules do not apply to requests from Azure services in the same region as the account, and broad service ranges would admit other tenants' traffic.

  • c
    Grant Azure Monitor's managed identity a Storage Blob Data role

    A role assignment addresses authorization, but the requests are being rejected by the network firewall, which a role does not bypass.

  • d
    Allow trusted Microsoft services to access the storage account Correct

    Correct. Azure Monitor is on the trusted services list; enabling this exception lets it write resource logs while the firewall still denies other networks.

The concept

Storage firewall exceptions let listed Azure platform services (such as Azure Monitor and Azure Backup) reach an account whose network access is restricted, without opening it to other networks.

Why that’s the answer

Two facts combine here. First, IP network rules have no effect on requests that originate in the same Azure region as the storage account, so adding service IP ranges would not restore delivery. Second, Azure Monitor is a trusted Microsoft service, so the firewall exception admits it while the deny-by-default posture stays in place. Opening all networks breaks the requirement, and RBAC cannot override a network denial.

How to reason it out
  1. Identify the blocked caller: Azure Monitor writing logs from the same region.
  2. Recall that IP rules do not apply to same-region Azure traffic.
  3. Recall that Azure Monitor is on the trusted services list.
  4. Enable the trusted services exception and keep the Deny default.

Exam tip: Same-region Azure services cannot be admitted with IP rules; use the trusted services exception (or virtual network or resource instance rules).

Configure Access to Azure Storage: SAS, Keys & Firewalls (AZ-104) — the lesson that teaches this.

Domain 3: Deploy and manage Azure compute resources

24% of the AZ-104 exam, so 6 of the 25 questions on this page.

Question 12Deploy and manage Azure compute resources

A Bicep file deploys a public IP address with a DNS domain name label. The fully qualified domain name (FQDN) is assigned by Azure when the resource is created. A release pipeline must read that FQDN after the deployment completes. What should the administrator add to the Bicep file?

Choose one.

  • a
    A variable that builds the FQDN from the label and the region name

    Variables are evaluated inside the template and are not returned by the deployment, so the pipeline still could not read the value.

  • b
    A tag on the public IP resource that holds the generated FQDN

    The FQDN is not known until the resource exists, and a tag is not a deployment result the pipeline receives.

  • c
    A parameter whose default value is the expected FQDN

    Parameters are inputs supplied before deployment; a guessed default is not the value Azure assigns.

  • d
    An output that reads the FQDN property of the public IP resource Correct

    Correct. Outputs are returned with the deployment result, and referencing the resource's dnsSettings.fqdn property returns the value Azure actually assigned.

The concept

Outputs are the deployment's return values. A Bicep output can reference a deployed resource's runtime properties (for example publicIp.properties.dnsSettings.fqdn), and pipelines read them from the deployment result.

Why that’s the answer

Only an output both reads the value Azure generated and hands it back to the caller. A variable or a default parameter value is computed or guessed before deployment and is never returned. A tag does not exist as a deployment result and could not be set from a value that does not yet exist. The pipeline then reads the output with 'az deployment group show --query properties.outputs'.

How to reason it out
  1. Note the direction of data: from the deployment back to the caller.
  2. Recall that only outputs are returned in the deployment result.
  3. Reference the resource symbolically so the output reads its runtime property.

Exam tip: Values flow in through parameters and out through outputs.

ARM Templates and Bicep: AZ-104 Deployment Guide — the lesson that teaches this.

Question 13Deploy and manage Azure compute resources

A platform team maintains a standard virtual network definition that dozens of application teams must reuse inside their own Bicep deployments, passing their own address ranges. Which approach should the platform team provide?

Choose one.

  • a
    A copy loop that repeats the network definition in each team's file

    Loops create several instances inside one file; they do not let other teams' files reuse a shared definition.

  • b
    An outputs section that exports the network definition to other files

    Outputs return values from a deployment; they do not export a reusable resource definition.

  • c
    A deployment script that builds the network with Azure CLI commands

    Deployment scripts run imperative code during a deployment; they add complexity and are not a reuse mechanism for declarative definitions.

  • d
    A module file that each team's Bicep deployment calls with parameters Correct

    Correct. A Bicep module packages the definition in its own file; consuming files call it with the module keyword and pass parameters such as address ranges.

The concept

A Bicep module is a Bicep file deployed from another Bicep file. It takes parameters and returns outputs, so a shared definition is written once and reused by many deployments, from a local path, a Bicep registry or a template spec.

Why that’s the answer

Reuse across teams with team-specific values is exactly what modules do. Copy loops repeat resources within a single file, outputs return values rather than definitions, and deployment scripts run imperative code instead of providing a reusable declarative unit.

How to reason it out
  1. Identify the need: one definition, many consuming files, different inputs.
  2. Match it to modules: a callable file with parameters and outputs.
  3. Publish the module to a registry or template spec if teams deploy from separate repositories.

Exam tip: Reuse a definition across Bicep files with modules; repeat it inside one file with loops.

ARM Templates and Bicep: AZ-104 Deployment Guide — the lesson that teaches this.

Question 14Deploy and manage Azure compute resources

An administrator has a large existing ARM template in JSON format and wants to convert it to a Bicep file to simplify future maintenance. Which command should the administrator run?

Choose one.

  • a
    az bicep build --file azuredeploy.json

    Build goes the other direction: it compiles a .bicep file into ARM JSON.

  • b
    az bicep generate-params --file azuredeploy.json

    generate-params creates a parameter file for a template; it does not convert the template itself.

  • c
    az bicep decompile --file azuredeploy.json Correct

    Correct. Decompile converts ARM JSON into a best-effort Bicep file that should then be reviewed.

  • d
    az bicep publish --file azuredeploy.json

    Publish pushes a Bicep file to a registry as a module; it performs no conversion.

The concept

The Bicep CLI converts in both directions: 'build' compiles Bicep to ARM JSON, and 'decompile' translates ARM JSON into Bicep. Decompilation is best-effort, so the output should be reviewed and cleaned up.

Why that’s the answer

'az bicep decompile' is the documented JSON-to-Bicep conversion. Build is the reverse operation, generate-params produces a parameter file, and publish uploads a module to a registry. After decompiling, review the warnings, rebuild the file and run what-if before trusting it.

How to reason it out
  1. Run 'az bicep decompile --file azuredeploy.json' to generate azuredeploy.bicep.
  2. Review the generated Bicep for warnings and awkward constructs, because decompilation is best-effort.
  3. Validate the result with a what-if deployment before replacing the JSON template.

Exam tip: Decompile means JSON to Bicep; build means Bicep to JSON.

ARM Templates and Bicep: AZ-104 Deployment Guide — the lesson that teaches this.

Question 15Deploy and manage Azure compute resources

Resources in a resource group were first deployed from a template, and since then several were added and reconfigured by hand in the Azure portal. The administrator needs a starting-point template that reflects the current state of every resource in the group. What should the administrator do?

Choose one.

  • a
    Download the template from the latest entry in the group's Deployments history

    A template saved from history is the exact template that was deployed; it does not include resources or settings changed by hand afterwards.

  • b
    Run the what-if operation against the resource group with an empty template

    What-if only previews changes; it does not generate a template of the existing resources.

  • c
    Select all resources in the resource group and use Export template Correct

    Correct. Exporting from the resource group generates a snapshot of the current state, including manual changes, which can then be cleaned up for reuse.

  • d
    Run 'az deployment group export' for the group's most recent deployment

    This command also exports the template from deployment history, so it misses resources and settings changed after that deployment.

The concept

There are two export paths. Exporting from a resource group or resource generates a template from the current state of the resources (a snapshot that includes manual changes). Saving from deployment history returns the exact template that was used, which reflects only what that deployment set.

Why that’s the answer

The deciding detail is the manual changes after the original deployment. Only an export from the resource group captures current state. Both history options (portal Deployments and az deployment group export) return the original template, so they miss the later changes. What-if never produces a template. Exported templates usually need cleanup and added parameters before reuse.

How to reason it out
  1. Notice that the requirement is the current state, not the original deployment.
  2. Recall that history exports return the template as it was deployed.
  3. Export from the resource group (or az group export) to capture the live configuration, then parameterise it.

Exam tip: Current state: export from the resource group. Original intent: save from deployment history.

ARM Templates and Bicep: AZ-104 Deployment Guide — the lesson that teaches this.

Question 16Deploy and manage Azure compute resources

A central IT team must offer sanctioned deployment templates, each with numbered releases, that project teams across the organization can deploy. Access must be controlled with Azure RBAC, and deployments must not depend on storage accounts or SAS tokens. What should the team do?

Choose one.

  • a
    Store each template in a blob container and share SAS URLs

    This works for linked templates but depends on a storage account and SAS tokens, which the requirement rules out, and has no built-in versioning.

  • b
    Create a template spec with a version for each template Correct

    Correct. A template spec is an Azure resource with versions; teams are given Reader access through Azure RBAC and deploy it by its resource ID.

  • c
    Embed each template in an Azure Policy deployIfNotExists rule

    deployIfNotExists remediates non-compliant resources; it is not a catalogue that teams deploy from on demand.

  • d
    Commit each template to an Azure Repos Git repository for cloning

    Repository access is controlled by Azure DevOps permissions, not Azure RBAC, and teams would deploy local copies rather than a governed, versioned Azure resource.

The concept

A template spec stores an ARM template or Bicep file as an Azure resource (Microsoft.Resources/templateSpecs) with named versions. Access is governed by Azure RBAC, and users deploy it by resource ID from the portal, CLI, PowerShell or as a module reference.

Why that’s the answer

Template specs meet every requirement: versioned, RBAC-controlled, and hosted by Azure without storage accounts or SAS tokens. Blob storage with SAS is the classic linked-template approach that the constraint excludes. A Git repository is versioned but governed by Azure DevOps permissions. A deployIfNotExists policy deploys only to remediate compliance, not as a shared template catalogue.

How to reason it out
  1. List the requirements: versions, Azure RBAC, no storage or SAS dependency.
  2. Eliminate storage-based sharing because of the SAS constraint.
  3. Choose template specs, which are versioned Azure resources secured with RBAC.

Exam tip: Sharing templates with Azure RBAC and versions: template specs.

ARM Templates and Bicep: AZ-104 Deployment Guide — the lesson that teaches this.

Question 17Deploy and manage Azure compute resources

An administrator must deploy an ARM template into an existing resource group named RG-Web by using Azure PowerShell. Which command should the administrator run?

Choose one.

  • a
    New-AzDeployment -Location eastus -TemplateFile ./azuredeploy.json

    New-AzDeployment (alias New-AzSubscriptionDeployment) deploys at subscription scope, not into a resource group.

  • b
    New-AzResourceGroupDeployment -ResourceGroupName RG-Web -TemplateFile ./azuredeploy.json Correct

    Correct. This cmdlet deploys a template into the named resource group.

  • c
    Test-AzResourceGroupDeployment -ResourceGroupName RG-Web -TemplateFile ./azuredeploy.json

    The Test- cmdlet only validates the template against the resource group; it deploys nothing.

  • d
    New-AzTemplateSpec -ResourceGroupName RG-Web -Name web -Version 1.0 -TemplateFile ./azuredeploy.json

    This creates a template spec resource that stores the template; it does not deploy the resources in it.

The concept

Azure PowerShell has one deployment cmdlet per scope: New-AzResourceGroupDeployment (resource group), New-AzDeployment (subscription), New-AzManagementGroupDeployment and New-AzTenantDeployment.

Why that’s the answer

Deploying into a resource group is New-AzResourceGroupDeployment. Test-AzResourceGroupDeployment is the tempting near-twin, but it only validates. New-AzDeployment targets the subscription scope, and New-AzTemplateSpec stores the template for later deployment rather than deploying it.

How to reason it out
  1. Identify the scope: an existing resource group.
  2. Pick the New- cmdlet for that scope, not the Test- validation cmdlet.
  3. Supply -ResourceGroupName and -TemplateFile (plus -TemplateParameterFile if needed).

Exam tip: Resource group deployments in PowerShell: New-AzResourceGroupDeployment.

ARM Templates and Bicep: AZ-104 Deployment Guide — the lesson that teaches this.

Domain 4: Implement and manage virtual networking

19% of the AZ-104 exam, so 5 of the 25 questions on this page.

Question 18Implement and manage virtual networking

Spoke subnets use user-defined routes that send spoke-to-spoke packets to a network virtual appliance in VNet-Hub, and IP forwarding is enabled on the appliance's NIC. A packet capture on the appliance shows packets from VNet-Spoke1 leaving toward VNet-Spoke2, but VMs in VNet-Spoke2 never receive them. Which change fixes the problem?

Choose one.

  • a
    Enable "Use remote gateways" on VNet-Spoke2's peering to the hub

    Use remote gateways consumes a VPN or ExpressRoute gateway in the hub for on-premises routes; it does not affect packets an appliance relays.

  • b
    Enable "Allow forwarded traffic" on VNet-Spoke2's peering to the hub Correct

    The packets come from Spoke1, not from the hub, so Spoke2's peering must accept traffic forwarded from the remote network; this setting does that.

  • c
    Enable "Allow gateway transit" on the hub's peering to VNet-Spoke2

    Allow gateway transit offers a hub gateway to peers. It has no effect on traffic relayed by an appliance, and the hub has no gateway in this scenario.

  • d
    Enable IP forwarding on the network interfaces of VNet-Spoke2's VMs

    IP forwarding lets a NIC accept packets addressed to someone else. Spoke2's VMs are the real destinations, so they need no forwarding.

The concept

"Allow forwarded traffic" on a peering controls whether the VNet accepts traffic that did not originate in the directly peered VNet but was relayed through it, such as spoke-to-spoke packets an NVA or Azure Firewall in the hub forwards.

Why that’s the answer

The capture proves the routing and the appliance work; the packets are dropped on entry to Spoke2 because their source is Spoke1, not the hub. Enabling "Allow forwarded traffic" on Spoke2's peering to the hub admits them (Spoke1's peering needs the same for return traffic). The gateway options govern gateway sharing, not relayed traffic. IP forwarding belongs on the appliance, where it is already enabled.

How to reason it out
  1. Trace the path: Spoke1, UDR, hub NVA, Spoke2.
  2. Note where packets stop: after leaving the appliance, before reaching Spoke2.
  3. Notice the source address belongs to Spoke1, a network not directly peered with Spoke2.
  4. Enable "Allow forwarded traffic" on the receiving spoke's peering to the hub (and on the other spoke for replies).

Exam tip: Relayed spoke-to-spoke traffic needs "Allow forwarded traffic" on the peering of the VNet that receives it.

Azure Virtual Networks, Subnets, Peering & User-Defined Routes — the lesson that teaches this.

Question 19Implement and manage virtual networking

You are creating a public IP address for a production VM in a region that has three availability zones. The address must keep working if any single zone fails and will be associated with the VM's network interface. Which configuration should you choose?

Choose one.

  • a
    Standard SKU, zonal in zone 1

    A zonal IP shares fate with zone 1, so it fails the requirement to survive the loss of any single zone.

  • b
    Standard v2 SKU, zonal in zone 2

    Standard v2 IPs are zone-redundant only, so a zonal v2 address cannot be created, and Standard v2 IPs currently attach only to the Standard v2 NAT gateway, not a VM's network interface.

  • c
    Standard v2 SKU, zone-redundant

    Standard v2 IPs are zone-redundant and static, but they can currently be used only with the Standard v2 NAT gateway, not a VM's network interface.

  • d
    Standard SKU, zone-redundant Correct

    A Standard (v1) IP can be zone-redundant, which survives a single zone failure, and it can be associated with a VM's network interface. It is always static, so it also survives stop and deallocate.

The concept

Public IPs are Standard (v1 or v2) or the retired Basic SKU (retired 30 September 2025). Standard IPs are always static and secure by default, and can be zonal or zone-redundant; a zonal IP shares fate with its zone. Standard v2 IPs are always zone-redundant but currently work only with the Standard v2 NAT gateway.

Why that’s the answer

Only a Standard zone-redundant IP meets both requirements. A zonal Standard IP fails when its zone fails. Standard v2 looks ideal on paper because it is zone-redundant, but it cannot be zonal at all and currently cannot be attached to a VM NIC. Every Standard IP is static, so the address also stays the same through stop and deallocate.

How to reason it out
  1. Rule out the retired Basic SKU: Standard IPs (v1 and v2) are the only choices and are always static.
  2. Match the zone requirement: zone-redundant survives a zone failure; zonal does not.
  3. Check the target resource: a VM NIC takes a Standard (v1) IP, while Standard v2 currently works only with the v2 NAT gateway and is zone-redundant only.

Exam tip: For a VM: Standard SKU, static, zone-redundant; zonal shares its zone's fate and Standard v2 is for the v2 NAT gateway.

Azure Virtual Networks, Subnets, Peering & User-Defined Routes — the lesson that teaches this.

Question 20Implement and manage virtual networking

Subnet "apps" (10.0.2.0/26) holds 40 VM network interfaces and is nearly out of addresses. You want to expand it to 10.0.2.0/24, a range that is inside the VNet's address space and unused by any other subnet. What must be true before you can change the subnet's address range?

Choose one.

  • a
    The VNet's peerings must be synced before the subnet range is changed

    Peering sync applies after the VNet's address space changes. Growing a subnet inside the existing space does not change what peers see.

  • b
    The subnet's NSG and route table must be dissociated before the change

    NSG and route table associations can stay in place; they are not what blocks a change to the subnet range.

  • c
    The subnet must contain no resources, so attached ones are moved first Correct

    Azure lets you change a subnet's address range only when no resources are deployed in it, so the 40 NICs must be moved or deleted first.

  • d
    The subnet's delegation must be removed before the range is changed

    Delegation governs which service may deploy into a subnet; removing it does not unlock a range change while resources remain.

The concept

A subnet's address range can be changed only when no resources are deployed in it. Growing a busy subnet means moving or deleting what is attached, or creating a new larger subnet and migrating to it.

Why that’s the answer

The 40 NICs are the blocker, so the subnet must be emptied first. Peering sync is about VNet address-space changes, not subnet edits within the space. NSG and route table associations and delegation settings do not block the change. In practice, creating a new larger subnet and migrating is often less disruptive than emptying the old one.

How to reason it out
  1. Confirm the new range fits the VNet space and overlaps no other subnet (it does).
  2. Check what is deployed in the subnet: 40 NICs.
  3. Move or delete them, change the range, then redeploy, or migrate to a new larger subnet instead.
  4. Size subnets with growth headroom to avoid this.

Exam tip: You can change a subnet's address range only when the subnet is empty.

Azure Virtual Networks, Subnets, Peering & User-Defined Routes — the lesson that teaches this.

Question 21Implement and manage virtual networking

A Bicep template enables regional virtual network integration for an Azure App Service app, using an existing empty /26 subnet named 'apps' that has no NSG or route table. Which subnet setting must the template also configure for the integration to succeed?

Choose one.

  • a
    A service endpoint for Microsoft.Web on the subnet

    Service endpoints optimize and identify OUTBOUND traffic from a subnet to a PaaS service's public endpoint; they do not dedicate a subnet to host a service's injected resources.

  • b
    An application security group applied to the subnet

    ASGs are logical groupings of NICs used inside NSG rules — they attach to network interfaces, not subnets, and grant no service any control over a subnet.

  • c
    A route with next hop type VirtualNetworkServiceEndpoint

    You cannot author UDRs with that next hop type — it only appears in effective routes when a service endpoint exists; routing entries do not reserve a subnet for a service.

  • d
    A delegation to Microsoft.Web/serverFarms on the subnet Correct

    Delegating the subnet to Microsoft.Web/serverFarms hands the subnet to App Service for regional VNet integration, letting the service create the resources and rules it needs while blocking incompatible tenants.

The concept

Subnet delegation designates a subnet for a specific Azure PaaS service (App Service regional VNet integration, Azure Container Instances, Azure NetApp Files, and others). The delegated service gains permission to deploy service-specific resources into the subnet, and Azure enforces the dedication.

Why that’s the answer

Regional VNet integration explicitly requires a subnet delegated to Microsoft.Web/serverFarms. Service endpoints solve a different problem (identifying subnet traffic to PaaS firewalls). ASGs group NICs for NSG rules and cannot be applied to subnets. The UDR distractor cites a system-generated next hop type that administrators cannot create.

How to reason it out
  1. Create or choose an empty subnet with room for scale-out, because each app instance uses an address from it.
  2. On the subnet, set Delegation to Microsoft.Web/serverFarms.
  3. Configure VNet integration on the App Service app and select that delegated subnet.
  4. Note that a delegated subnet is reserved: other resource types may be blocked from deploying into it.

Exam tip: Subnet delegation dedicates a subnet to a PaaS service — App Service regional VNet integration needs Microsoft.Web/serverFarms.

Azure Virtual Networks, Subnets, Peering & User-Defined Routes — the lesson that teaches this.

Question 22Implement and manage virtual networking

A Windows VM in Azure must always use the private IP address 10.0.1.10. An administrator signed in to the VM and set 10.0.1.10 as a static address in the Windows network adapter settings, and the VM then lost connectivity. What should have been done instead?

Choose one.

  • a
    Set the private IP assignment to static on the NIC's IP configuration in Azure Correct

    Azure delivers private IPs through platform DHCP; setting the NIC's IP configuration to static reserves 10.0.1.10 in Azure while the guest keeps using DHCP.

  • b
    Set the allocation to static on a public IP associated with the VM's NIC

    That fixes a public address, not the private 10.0.1.10 address the VM must keep.

  • c
    Create an A record in a private DNS zone that resolves the VM to 10.0.1.10

    A DNS record only maps a name to an address; it does not make Azure assign 10.0.1.10 to the VM.

  • d
    Keep the OS setting and restart the VM so Azure records the new address

    Azure does not learn addresses from the guest OS; editing the guest's IP settings is what broke connectivity, and a restart does not fix it.

The concept

Azure manages private IP addresses and delivers them to the guest by DHCP. To pin an address you set the NIC's IP configuration to static in Azure; editing the address inside the operating system desynchronises the guest from the platform and usually breaks connectivity.

Why that’s the answer

A static assignment on the NIC's IP configuration reserves the address in Azure and keeps the guest on DHCP, the supported pattern. The public-IP option fixes the wrong address. A DNS record names an address but does not assign it. Azure never reads addresses from the guest OS, so restarting keeps the broken state.

How to reason it out
  1. Revert the in-guest change so the adapter obtains its address automatically.
  2. Open the VM's network interface, then IP configurations, then the ipconfig.
  3. Change private IP assignment from Dynamic to Static and enter 10.0.1.10 (unused and inside the subnet's usable range).
  4. Save; the VM keeps receiving 10.0.1.10 through Azure DHCP.

Exam tip: Pin private IPs on the Azure NIC's IP configuration, never inside the guest OS.

Azure Virtual Networks, Subnets, Peering & User-Defined Routes — the lesson that teaches this.

Domain 5: Monitor and maintain Azure resources

14% of the AZ-104 exam, so 3 of the 25 questions on this page.

Question 23Monitor and maintain Azure resources

Windows VMs in a fleet send their System and Application event logs through the Azure Monitor Agent. An administrator needs a list of all error events from the last 24 hours, with a count per computer name, for the whole fleet in one view. What should the administrator use?

Choose one.

  • a
    Metrics explorer with splitting on the computer name

    Metrics explorer charts numeric metrics. Guest event records are log rows in a workspace and cannot be opened in metrics explorer.

  • b
    A KQL query in the Logs blade of the target workspace Correct

    Correct. The agent sends the events to a Log Analytics workspace table, where a KQL query filters by level and time and summarizes a count by Computer.

  • c
    The activity log filtered to Error level for the fleet

    The activity log records control-plane operations at subscription level. Guest OS event log entries never appear there.

  • d
    Event viewer through Run command on each fleet VM

    Run command can read each VM's local event log, but it is a per-VM manual step and gives no single fleet-wide view or count.

The concept

Log Analytics is the query experience for Azure Monitor Logs. KQL queries filter, correlate, and summarize records across workspace tables, supporting operators for time filtering and aggregation such as summarize count() by Computer.

Why that’s the answer

The Azure Monitor Agent delivers guest event logs to a Log Analytics workspace, and filtering by level, restricting to 24 hours and summarizing by computer is a standard KQL query. Metrics explorer reads only metrics, the activity log has no guest OS events, and Run command works per VM rather than across the fleet.

How to reason it out
  1. Open the Log Analytics workspace and select Logs to open the query editor.
  2. Write a KQL query against the event table filtering on error level and a 24-hour time range.
  3. Add a summarize count() by Computer clause to group results per machine and run the query.

Exam tip: Anything stored in a Log Analytics workspace is answered with a KQL query in the Logs experience.

Azure Monitor: Metrics, Logs, Diagnostic Settings & Alerts (AZ-104) — the lesson that teaches this.

Question 24Monitor and maintain Azure resources

An administrator must alert on unusual drops in requests for a web app whose traffic varies widely by hour of day and day of week. Setting a fixed number would cause false alarms at night and missed problems at peak. Which alert configuration requires the LEAST ongoing tuning?

Choose one.

  • a
    A metric alert rule with a static threshold reviewed weekly

    A static threshold is a single fixed value. Weekly manual reviews are exactly the ongoing tuning burden the scenario asks to avoid, and a single number can never fit both night and peak traffic.

  • b
    An activity log alert rule scoped to the web app

    Activity log alerts fire on control-plane events such as restarts or configuration changes. They cannot evaluate the Requests metric against any threshold.

  • c
    A log search alert rule with a fixed request threshold

    A log search alert can count requests, but a fixed threshold has the same problem as a static metric threshold: one number cannot fit both night and peak traffic, so it needs constant retuning.

  • d
    A metric alert rule with a dynamic threshold Correct

    Dynamic thresholds use machine learning over the metric's history to learn its seasonal pattern and set adaptive boundaries, so hourly and weekly variation is handled without manual retuning.

The concept

Metric alert rules support static thresholds (a fixed value you choose) and dynamic thresholds (machine-learning boundaries derived from the metric's historical behavior, including seasonality). Dynamic thresholds suit metrics with regular patterns that a single number cannot capture.

Why that’s the answer

Traffic with strong hourly and weekly seasonality is the use case for dynamic thresholds: the model learns the expected band for each period and flags deviations, so it needs the least ongoing tuning. A static metric threshold and a log search alert with a fixed threshold both work technically but share the single-number problem the scenario describes; an activity log alert watches management operations, not metric values.

How to reason it out
  1. Create a new alert rule scoped to the web app and select the Requests metric as the signal.
  2. In the condition, set the threshold type to Dynamic and choose the sensitivity (low, medium, or high).
  3. Set the evaluation frequency and lookback window, attach an action group, assign a severity, and create the rule.

Exam tip: Choose dynamic thresholds for metrics with seasonal patterns; static thresholds fit metrics with a known fixed acceptable limit.

Azure Monitor: Metrics, Logs, Diagnostic Settings & Alerts (AZ-104) — the lesson that teaches this.

Question 25Monitor and maintain Azure resources

Ten alert rules across a subscription must all notify the same operations team by email and SMS and trigger the same remediation webhook. The configuration should be defined once and reused by every alert rule. What should the administrator create?

Choose one.

  • a
    One shared action group holding the email, SMS, and webhook entries Correct

    An action group is a reusable, named bundle of notifications and actions. Defining it once and referencing it from all ten alert rules avoids duplicating the recipient and webhook configuration.

  • b
    Ten action groups, each with the same email, SMS, and webhook entries

    This works but duplicates identical configuration ten times, so every change to the team's contacts must be repeated everywhere - the opposite of define-once reuse.

  • c
    An alert processing rule listing the email, SMS, and webhook targets

    Alert processing rules can apply existing action groups or suppress notifications at scale, but they cannot hold recipients or webhooks themselves; those are defined only in an action group.

  • d
    Email, SMS, and webhook settings entered directly in each alert rule

    Alert rules do not hold notification targets themselves: a rule's actions are references to action groups. There is nowhere in the rule to enter email or webhook details.

The concept

Action groups decouple what fires (the alert rule and its condition) from who is told and what runs (notifications like email, SMS, push, and voice, plus actions like webhooks, Azure Functions, Logic Apps, and Automation runbooks). Many alert rules can reference one action group.

Why that’s the answer

A single action group holding the email, SMS, and webhook entries is the reusable unit the scenario describes; each of the ten alert rules simply references it, and future contact changes happen in one place. Ten duplicate groups multiply maintenance, an alert processing rule can attach an existing action group but cannot itself define the notification targets, and alert rules cannot hold email, SMS or webhook targets directly - their actions are references to action groups.

How to reason it out
  1. In Azure Monitor, open Alerts and create a new action group in the appropriate resource group.
  2. Add notification entries for the team's email and SMS, and an action entry for the remediation webhook URI.
  3. Edit each of the ten alert rules (or create new ones) and select this action group under Actions.

Exam tip: Define notifications and automated actions once in an action group and reference it from every alert rule that needs them.

Azure Monitor: Metrics, Logs, Diagnostic Settings & Alerts (AZ-104) — the lesson that teaches this.

Keep going with AZ-104

AZ-104 practice by domain

AZ-104 sample questions: your questions

No. Real exam questions are confidential. These are original questions written to the skills in the official AZ-104 exam guide, so they test the same knowledge in the same style without being copies of the exam.

Source

The domains and weights on this page come from the official AZ-104 exam guide.