AZ-104 Microsoft Azure Administrator Exam

You're a great admin... on-prem. Now, become a great admin in the cloud and prove it by passing the Microsoft Certified: Azure Administrator Associate exam!

Practice Test

Exam

Modify an existing Azure Resource Manager template

Understand Template Structure and Syntax

Azure Resource Manager (ARM) templates are essential tools for managing and deploying resources in Azure. They are JSON files that use declarative syntax to specify the infrastructure components you want without needing to detail the deployment order. This characteristic helps implement the concept of infrastructure as code, allowing deployments to be consistent and repeatable across different environments.

Key Components of ARM Templates

ARM templates comprise several critical sections, each serving a specific purpose:

  • Parameters: These elements allow customization at deployment time by providing values that can adjust based on the environment. Parameters make templates flexible and adaptable.
  • Variables: Used to define values reused throughout the template, variables often derive from parameter values. They help streamline template design by reducing redundancy.
  • Resources: This section lists the Azure resources you intend to deploy, including virtual machines, storage accounts, and databases.
  • Outputs: Outputs provide return values from the deployed resources. They can be pivotal for subsequent operations or workflows after a deployment.

Extending Template Capabilities

ARM templates can be enhanced with deployment scripts, which are executable PowerShell or Bash scripts integrated within templates or sourced externally. These scripts enable thorough setup of your environment beyond the capabilities of standard JSON configuration. Additionally, user-defined functions can simplify complex operations within a template, making it easier to manage intricate logic or calculations.

Testing and Validation

To ensure an ARM template meets design standards and syntax rules, the ARM template toolkit (arm-ttk) offers a reliable validation method. Available as a PowerShell script on GitHub, it checks for common errors and best practices adherence. Furthermore, templates support a what-if operation that provides an insight into potential changes before deployment, highlighting resources to be created, updated, or deleted.

Deployment and Management

ARM templates offer multiple deployment methods, including through the Azure portal, Azure CLI, PowerShell, REST API, or CI/CD pipelines using Azure DevOps. The deployment history feature in the Azure portal is valuable for reviewing past deployments. It maintains records of parameter values and outputs, ensuring you have a transparent view of changes and enabling traceability of deployment actions.

Best Practices

When constructing ARM templates, adhere to best practices for optimal effectiveness:

  • Modular Design: Divide templates into smaller units that can be reused and linked together to form larger systems. This modularity increases flexibility and manageability.
  • Parameterization: Take advantage of parameters to specify items that may change per environment, such as resource names or configuration settings.
  • Validation: Ensure your templates pass built-in validation checks prior to deployment to prevent incomplete or incorrect deployments.

By grasping these components and techniques, students can proficiently modify existing ARM templates to automate the deployment and management of Azure resources. This understanding underpins efficient and scalable cloud infrastructure development and operation.