Practice Test

True/False: In Microsoft Azure, the deployment of templates involves three steps: authoring the template, deploying the template, and maintaining the template.

  • True
  • False

Answer: True.

Explanation: Deploying a template in Microsoft Azure involves authoring the template (defining the infrastructure and configuring its settings), deploying the template (running the template to create or update an Azure resource), and maintaining the template (updating and modifying the template).

Single Select: Which of the following template languages can be used in Azure?

  • a) Azure Resource Manager template
  • b) JavaScript
  • c) Python
  • d) Ruby

Answer: a. Azure Resource Manager template

Explanation: Azure Resource Manager template is a declarative programming language used in Azure for defining and deploying Azure resources.

Multiple Select: What are the different ways to deploy a template in Azure?

  • a) Azure portal
  • b) Azure CLI
  • c) PowerShell
  • d) REST API

Answer: a. Azure portal, b. Azure CLI, c. PowerShell, d. REST API

Explanation: You can deploy templates in Azure by using the Azure portal, Azure CLI, PowerShell or the REST API. Each of these methods allows for a different way of interacting with Azure.

True/False: You can’t deploy multiple resources simultaneously using a single Azure Resource Manager template.

  • True
  • False

Answer: False.

Explanation: An Azure Resource Manager template can define all the resources that a solution needs, enabling you to deploy, update, and delete all the resources for your solution in a single, coordinated operation.

Single Select: What JSON file structure does Azure Resource Manager template use?

  • a) { “resources”: [] }
  • b) { “source”: [] }
  • c) { “template”: [] }
  • d) { “manager”: [] }

Answer: a. { “resources”: [] }

Explanation: Azure Resource Manager uses JSON to define a template, and the “resources” property is an array that contains the resources you want to deploy or update.

True/False: You can validate your Azure Resource Manager templates before deploying them.

  • True
  • False

Answer: True.

Explanation: Azure Resource Manager allows you to validate your templates before deployment to check for errors and ensure they will deploy successfully.

Single Select: In what scenario would you use an incremental deployment mode?

  • a) When you want to delete resources not specified in the template.
  • b) When you only want to add or update resources.
  • c) When you want to ensure a template doesn’t exist.
  • d) When you want to clone a resource.

Answer: b. When you only want to add or update resources.

Explanation: The incremental deployment mode in Azure Resource Manager templates is used when you only want to add or update resources, but not delete ones that aren’t specified in the template.

Multiple Select: Which deployment tools support the complete deployment lifecycle of Azure Resource Manager templates?

  • a) Azure portal
  • b) Azure CLI
  • c) PowerShell
  • d) Azure DevOps

Answer: a. Azure portal, b. Azure CLI, c. PowerShell, d. Azure DevOps

Explanation: Azure portal, Azure CLI, PowerShell, and Azure DevOps support the complete deployment lifecycle of Azure Resource Manager templates including authoring, deploying, and maintaining them.

True/False: The unique name you assign to resources in the Azure Resource Manager template needs to be hard coded.

  • True
  • False

Answer: False.

Explanation: Names for resources do not need to be hard coded. You can use functions to construct names and establish relationships between nested resources.

Single Select: The ‘parameters’ section of an Azure Resource Manager template is used to?

  • a) Specify the resources to deploy.
  • b) Input values that are used when deploying the template.
  • c) Connect resources with dependencies.
  • d) Report on the status of the deployment.

Answer: b. Input values that are used when deploying the template.

Explanation: The ‘parameters’ section of an Azure Resource Manager template is used to input values that are used when deploying the template. This allows for template flexibility and can be used with different values for different deployments.

Interview Questions

What is a Template in Azure?

A template in Azure is a JSON file that defines the infrastructure and configuration for your project. It enables you to repeatedly deploy your application during every stage of the application lifecycle.

What is the ARM templates in Azure?

ARM templates are JavaScript Object Notation (JSON) files that define the infrastructure and configuration for your project. They enable you to use declarative syntax to state what you intend to deploy in Azure.

What command can be used to deploy a template in Azure using Azure CLI?

The command “az deployment group create” can be used to deploy a template in Azure using the Azure CLI.

What are the two main sections of an Azure Resource Manager Template?

The two main sections of an Azure Resource Manager Template are the parameters and the resources. The parameters allow the template to be customized, and the resources define what resources to deploy and configure.

How can a template be tested in Azure before deployment?

A template can be tested in Azure before deployment using the “What-if operation”. This enables you to preview and validate changes a template will make before committing those changes.

Can you change the parameters in a previously deployed template in Azure?

Yes, you can change the parameters in a previously deployed template by re-deploying the template with the updated parameters.

Is it possible to deploy a template directly from the Azure Portal?

Yes, it’s possible to deploy a template directly from the Azure Portal. This can be done on the template deployment blade with the “Deploy a custom template” button.

What is a deployment mode in Azure Resource Manager Templates?

A deployment mode determines how Resource Manager handles existing resources during deployment. There are two types: Incremental and Complete. Incremental mode leaves unchanged resources that exist in the resource group but are not specified in the template. Complete mode deletes resources that exist in the resource group but are not specified in the template.

How do you specify default values for parameters in Azure Resource Manager Templates?

You can specify default values for parameters by including a “defaultValue” property in the parameter definition in the Azure Resource Manager Template.

Can you link to another template from within an Azure Resource Manager Template?

Yes, you can link to another template from within an Azure Resource Manager Template using the “linked templates” function.

Can you use loops in an Azure Resource Manager Template?

Yes, you can use the “copy” function to make loops in Azure Resource Manager Templates to create multiple instances of resources.

How do you specify the order of deployment of resources within a template?

You can control the order of deployment of resources within a template by using the “dependsOn” property.

Can you call REST APIs from an Azure Resource Manager Template?

Yes, you can call REST APIs from an Azure Resource Manager Template using the ‘DeploymentScript’ resource.

What function can be used to retrieve the properties of existing resources in a template in Azure?

The `reference` function can be used to retrieve the properties of existing resources in a template in Azure.

Can you use conditions in an Azure Resource Manager Template?

Yes, you can use the “condition” element to conditionally deploy resources in an Azure Resource Manager Template. This is helpful when you need to limit what resources are created in different environments.

Leave a Reply

Your email address will not be published. Required fields are marked *