PUBLIC BETA OFFER

Save 50% off on an Eligible Learning PlanValid for 1-month plan, 3-month plan, 12-month plan · Code LPXBETA50 · Ends Dec 6, 2026

AZ-401: Bicep Infrastructure and Guest Configuration Responsibilities

Implement a Bicep storage declaration and a conditional guest assignment, verifying resource properties, package inputs, setting reports, drift and owned cleanup separately.

Guide

Content version 1.0

AZ-401: Bicep Infrastructure and Guest Configuration Responsibilities

AZ-401: Bicep Infrastructure and Guest Configuration Responsibilities

Implement and verify the resource layer and the guest layer separately. Use Bicep to declare a small Azure resource and compare the resulting Azure Resource Manager (ARM) properties with that declaration. On an existing supported machine, create a package-backed Machine Configuration assignment only after validating its target-specific interface and real package inputs, then inspect the assignment and individual setting results. Resource deployment success does not establish guest or application conformance.

The resource example below declares a storage account. The separate guest exercise uses a pre-existing nonproduction Azure virtual machine (VM) and an already validated configuration package; it does not create a VM or author a package. An Azure Arc target requires its own supported form rather than an assumed substitution. No deployment, assignment, drift test or cleanup was executed for this explanation.

Prepare two independently reviewable changes

Bicep is infrastructure as code (IaC): the declaration expresses Azure resources and their properties. Machine Configuration addresses settings inside supported machines. Keep separate owners and acceptance evidence when the same team manages both.

For this exercise, agree on:

  • An existing authorized subscription and resource group, permitted location, unused valid storage-account name and owner-approved cost exposure.
  • Existing Bicep authoring and ARM deployment tooling with the necessary scoped permissions.
  • One existing supported nonproduction machine, its owner, current client/agent prerequisites and an approved recovery method.
  • A validated package that is appropriate for that machine, with trusted identity, measured digest and intended behavior.
  • The exact guest-assignment interface supported for that target, the allowed mode and any package-specific overrides.
  • A harmless, reversible setting for a later drift observation, or an explicit decision that a drift change is not authorized.

Record starting resource and guest state before submitting either change. A package validation record and a machine-support check are inputs to this procedure, not outcomes to infer from a successful deployment request.

For Linux, check the applicable support conditions carefully. Microsoft's November 2026 warning concerns older affected operating-system versions using PowerShell-based configurations with newer agents; it is not a statement that all Linux configurations stopped working. Resolve the actual machine/package combination before proceeding.

Declare the small resource layer in Bicep

The current Bicep overview's storage-account model uses resource application programming interface (API) version 2023-05-01. This adaptation makes the name and location explicit inputs. Its stock-keeping unit (SKU) selects locally redundant storage (LRS); the resource kind and access tier remain those of the published model:

param accountName string
param region string

resource account 'Microsoft.Storage/storageAccounts@2023-05-01' = {
  name: accountName
  location: region
  kind: 'StorageV2'
  sku: {
    name: 'Standard_LRS'
  }
  properties: {
    accessTier: 'Hot'
  }
}

These parameters must receive the actual approved values. The model is a small worked declaration, not a production storage-security baseline. The published API version is explicit; neither Bicep's support for preview APIs nor its experimental features makes every deployment appropriate for the selected environment.

  1. Save the declaration as a complete Bicep file and review its two inputs with the resource owner.
  2. Validate it using the established tooling. Confirm that the selected resource provider, API version, location and properties are supported for the intended deployment.
  3. Review the proposed changes through the existing deployment process, using a what-if preview where applicable. Stop if the scope or effects exceed the agreed storage-account change.
  4. Submit through the approved ARM deployment interface after that review. Keep its actual deployment result and resulting resource identity.
  5. Read the resource back and compare its name, location, kind, replication selection and access tier with the approved declaration.

An accepted submission is not the final check. Preserve a failed deployment and its diagnostic if no resource was created, and distinguish that from a resource whose read-back properties differ. Do not repair an unexplained mismatch by changing the recorded expected values.

This storage-account operation has not configured any operating-system setting on the existing machine. Its evidence belongs to the resource change.

Build the guest-assignment input record

Select a package already validated by its owner for the chosen machine and intended mode. Do not invent a package address or digest to make an example look runnable.

Input Required evidence
Target Exact existing machine and management scope, with applicable Azure or Arc support and prerequisites checked
Assignment name Intended new manual assignment, distinguishable from existing assignments and recorded under its owner
Package configuration name Exact configuration name inside the package's Managed Object Format (MOF) file
Package location Real approved secure web uniform resource identifier (URI) for that package, accessible through the authorized retrieval arrangement
Package digest Trusted 256-bit Secure Hash Algorithm (SHA-256) digest measured from those exact package bytes
Mode Package-compatible behavior and the exact value accepted by the validated target interface
Overrides Only actual package-defined Desired State Configuration (DSC) resource/name/value overrides, when needed
Recovery Original setting values, permitted drift test and owner-controlled restoration/removal steps

Treat a package address containing access credentials as sensitive. Keep such values out of public examples and ordinary logs. GitHub Actions' secure-use guidance warns that secret redaction is not guaranteed; if an existing workflow submits these changes, review its actual privileges and untrusted-input boundary rather than adding a privileged workflow here.

The assignment's contentUri and contentHash must identify that same validated package. Its configuration name is not a filename guessed from the download address. The documented version property is used for built-in packages, not custom content packages. Parameter overrides must match the package rather than a similarly named setting remembered from another configuration.

Resolve the target-specific form before submission

The assignment documentation needs careful reading. Its main JavaScript Object Notation (JSON) example contains a malformed parameter array, while the separate override example uses an array of objects. Creation, the property table and deletion also show differing mode capitalization or API versions. Copying those fragments together does not establish a valid executable request.

Before creating anything, require the owner to validate:

  1. The resource and parent-machine form for the selected target. A VM example does not establish an Arc schema.
  2. The API version supported by the actual creation/read/removal interface.
  3. The required package properties and a valid structure for configurationParameter, including whether overrides are needed.
  4. The exact accepted assignmentType spelling and its compatibility with this package.
  5. The exact existing target, new assignment name, package address and matching digest.

Stop before submission if any item is unresolved. Do not guess capitalization, substitute a creation API into a deletion example, or normalize the malformed fragment into an asserted universal template. The checks are a real condition on the following operation; recording an unknown value does not satisfy them.

For a bounded first exercise, evaluate Audit with a package that supports it. The documented behaviors differ:

Behavior What to look for
Audit Observation of setting state, without expecting the assignment to correct it
Apply and Monitor Initial application followed by monitoring
Apply and Autocorrect Application with correction when drift occurs

The descriptive labels in this table are not a substitute for the exact accepted API values. Changing to an apply mode requires a compatible package, explicit authority and a validated form; it is not a shortcut for obtaining a compliant result.

Create the conditional assignment and inspect its evidence

Proceed only after the input record and every target-validation item are complete.

  1. Through the established authorized ARM deployment or client interface, create the manual guest assignment under the recorded existing machine. Bind the validated form to the selected assignment/configuration names, actual package address and digest, mode and required overrides.
  2. Preserve the real submission result and read back the exact created assignment. Compare target, configuration identity, package selection, mode and override values with the approved input record.
  3. Inspect the assignment's reported state. Keep the observation time and distinguish a pending, failed or missing report from a completed evaluation; do not invent a universal evaluation deadline.
  4. Open the Guest assignments page and examine individual setting results. Match the settings and expected values to the package's validation record.
  5. Correlate assignment-level compliance with those setting results. If they disagree or evidence is incomplete, stop acceptance and preserve both observations for the owner.

The intended result is an assignment attached to the intended existing machine, using the intended package and behavior, with explainable setting evidence. A resource object alone does not prove that the package was retrieved, evaluated or applied successfully.

Use a proposed evidence matrix rather than fabricated output:

Observation Required decision
Resource declaration deployed, but no guest assignment exists Resource work may be complete; the guest outcome remains incomplete
Assignment exists but package identity or digest differs Stop and investigate selection; do not refresh the expected digest to obtain a match
Assignment exists but evaluation is missing or failed Preserve the diagnostic and resolve retrieval, compatibility or evaluation issues
Overall result appears compliant but a required setting lacks evidence Investigate the individual result before accepting guest conformance
Expected settings and observed results agree Record the bounded guest result; application behavior still needs its own validation

Observe controlled drift and recover deliberately

Use only the harmless setting and change already authorized by the machine owner. Record its initial value, expected package value, exact modification and observation time. Never weaken a real security setting just to demonstrate noncompliance.

For an Audit exercise, observe whether the next actual setting evaluation reports the difference. Do not expect automatic repair. In a separately authorized apply-mode exercise, compare the observed response with the selected mode's documented behavior. An unrelated administrator action or another configuration system can also change the setting; preserve that context instead of crediting the assignment without evidence.

Keep the test on one nonproduction target. If workload health changes or the result is unexpected, halt further exposure and use the agreed recovery path. Safe-deployment guidance applies to configuration and infrastructure changes as well as application releases; a green resource-deployment result is not a workload health gate.

Restore the setting through the owner's approved recovery method and verify the resulting state. Keep the before/change/report/recovery sequence together. Do not switch modes or edit the package merely to conceal an unexplained test failure.

Remove only the owned manual assignment

Manually created assignments need explicit removal. Identify the exact exercise assignment again, review its ownership and parent, and use the validated removal interface for that target. Do not copy an unmatched deletion fragment or remove every assignment returned by a broad query.

Verify that the selected assignment is absent afterward and that unrelated assignments remain. Do not delete the existing VM or Arc machine as a convenient cleanup method.

Treat assignment removal and guest-state restoration as separate acceptance checks. Verify the actual remaining settings through the owner; removal alone is not evidence that earlier applied changes were undone. Preserve the package record and evaluation/recovery evidence as required by the agreed process.

For the storage account, let its owner decide whether to retain the resource or clean up the solely owned exercise change after checking data and consumers. Never delete the containing resource group as an assumed part of guest cleanup.

The handoff should contain two clear results: the declared Azure resource and its read-back properties, and the conditional guest assignment with its actual setting, drift and removal evidence. Keep application validation separate. Progressive Delivery and Deployment Slot Decisions and A Governed Release Failure Scenario extend the rollout and failure reasoning beyond this bounded exercise.

Authoritative Sources

0 views