Automate Deployment Of Resources Using Templates Flashcards

1
Q

What does arm stand for?

A

Azure Resource Manager

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of Azure Resource Manager?

A

Whether via the portal , powershell, azure cli , test clients or any other mechanism to manage azure resources, the action passes through an ARM process before interacting with the individual service backends to perform the action.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What notation do ARM templates use?

A

JSON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the main files that form part of a template?

A

A template file, a parameters file and an optional script file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 6 root properties of an arm template?

A
  • $chema: usually fixed. Wood change if you use a different type of deployment template in the future but as of 2024 it’s still using the 2015 one
  • ContentVersion: user managed versioning string to track which version of the the arm template it is
  • parameters: variables which can be passed into the template at execution time
  • variables: standard variables which aren’t specified at run time. Think hard coded values or expressions.
  • resources: this is an array or resource you want to create. Vnets, VMs, disks, scales etc.
  • outputs: these values will be printed to the output log at the end of the deployment process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When modifying an arm template for a vm, what are the additional changes necessary to make if you remove the public ip block?

A

Any section which dependsOn that public ip being created should have that dependsOn entry removed. The consequence of having a dependency listed which is not actually created as part of the arm template is that the resource will wait forever for that dependsOn to be complete so it wont actually be created.

The ipConfigurations sections in the network interface section is used to map a publicIpAddress to the network interface so if you remove the public ip from the arm template you should also be careful to remove any instructions which do something with it such as attaching it to a network interface.

Generally, removing as single resource seems simple but there can be gotcha’s if it is referenced in other places in the arm template, so be careful!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are template specs and how are they used?

A

It’s a library of templates which you can add your own arm templates to.

To do it, open( deprecated ) templates or (recommended) template specs from the azure portal, create new and follow the wizard. You will need to copy the template to this ui.

The template then becomes a resource in the resource group it was added to and can be shared and RBAC permissions assigned.

From the template sites ui you can press the deploy button where you will need to add the parameters from scratch. You can also create new versions of the template spec.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Are azure resources deployed with an arm template idempotent?

A

Yes. Any resource with the same name and settings defined in an arm template which is the same as an existing resource would be skipped.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to deploy a an arm template using powershell?

A

New-AzResourceGroupDeploymemt -ResourceGroupName “<…>” -TemplateFile “<…>” -TemplateParameterFile “<…>”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to review the deployments of a resource group?

A

From the deployments link in the blade of the resource group ui in the portal. This history is not complete only holding the last N deployments. Each deployment is incremental and so may look different even though the same template was used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Are all changes to a resource ( its settings) visible in the resource’s deployment history?

A

No. A resource’s deployment history tracks the deployments caused by changes to an arm template . Changes made to a resource manually will not be visible in the deployment history, so it’s better to make the changes directly to the arm template rather than to the resource directly.

Azure’s deployment history primarily tracks the deployment operations performed on a resource or resource group, showing the actions taken through Azure Resource Manager (ARM) templates, Azure CLI, Azure PowerShell, and other Azure services. This includes creation, updates, and deletions of resources. However, not all changes made to a resource’s settings may be visible in the deployment history. Here’s why:

  1. Granularity: The deployment history is focused on the deployment operations themselves, not on fine-grained configuration changes or settings adjustments made post-deployment unless they are made through a new deployment.
  2. Direct Modifications: Changes made directly to a resource’s settings through the Azure Portal, CLI, or PowerShell might not be recorded as a deployment unless they trigger a new deployment operation. For instance, adjusting a setting on a virtual machine directly might not appear as a separate deployment.
  3. Service-Specific Logs: Some Azure services track changes to their settings or resources through their own logging and auditing mechanisms, separate from the Azure Resource Manager deployment history. For example, Azure App Service has its own activity logs, and Azure Storage Accounts have storage analytics for tracking requests.
  4. Auditing and Logging: Azure provides extensive auditing and logging features through Azure Monitor and Azure Activity Log. While the Activity Log records all write operations (PUT, POST, DELETE) performed on your resources, it is more comprehensive and includes operations that might not result in a deployment record.

To get a complete picture of all changes made to a resource or its settings, it’s advisable to consult the Azure Activity Log, service-specific logs, and the deployment history. This approach will provide a more comprehensive view of the actions performed on a resource.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is bicep?

A

It’s a declarative pre-processor language which compiles into ARM notation. You write your code in bicep because it’s easier to use, learn, read and understand, then you compile into machine readable ARM template.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is an arm custom script extension?

A

It’s a part of an arm template that configures a specific script into be run on a vm. This can be used for getting your vm to a usable state for example by creating a necessary directory structure, creating users etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Where can you find azure QuickStart templates from Microsoft?

A

GitHub at Azure/azure-quickstart-templates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a VHD?

A

It’s a virtual hard disk.

17
Q

How can you use a VHD in an arm template to deploy a vm in a ready state?

A

You can define a ready to use disk as the disk to use. You import a copy of that disk to use. Apparently the speed of doing this is not much faster than using an image even if it seems illogical.

You must create it in the arm template but then use it too

https://learn.microsoft.com/en-us/azure-stack/user/azure-stack-manage-vm-disks?view=azs-2306&tabs=az1%2Caz2%2Caz3%2Caz4%2Caz5%2Caz6%2Caz7%2Caz8