Using Azure Services from Code and Command Line Flashcards

1
Q

What would you connect to with this code:

var obj = ConnectionMultiplexer.Connect(GetConnectionString());

A

A Redis Database instance

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

What would you connect to with this code:

var obj = account.CreateCloudTableClient(new TableClientConfiguration());

A

Azure Table Storage from CosmosDb using Table API

https://docs.microsoft.com/en-us/azure/cosmos-db/tutorial-develop-table-dotnet

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

What would you connect to with this code:

var obj = new DocumentClient(GetUri(), GetAuthKey());

A

Azure Cosmos DB service

https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.client.documentclient?view=azure-dotnet

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

True or False:

az storage blob copy will copy a blob asynchronously and allow you to restart from the point of failure if there is an error

A

False

az storage blob copy does run asynchronously but it does not support restart

Use the powershell AzCopy module if restarting is required

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

You want to quickly upload the data in a collection of small files held in a local folder to blob storage. This is a one-off request. You don’t want to overwrite blobs that have been modified in the last two days. Which tool should you use?

A: az CLI
B: AzCopy Powershell
C: .Net Storage Client Library

A

az copy

Use should not use .Net Client Library as it is a one off task

Use should not use AzCopy since this does not support checking the last modified time

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

You want to transfer a series of large files to blob storage. It may take several hours to upload each file, and you’re concerned that if a transfer fails it shouldn’t have to restart from the beginning. Which tool is the most appropriate to do this task?

A: az CLI
B: AzCopy Powershell
C: .Net Storage Client Library

A

AzCopy is ideal for transferring large files as it can run in the background and you can monitor the status of AzCopy jobs.

The Azure CLI doesn’t provide a way to resume a failed transfer.

You could use .Net Storage Client Library to write your own custom application for this task, but the AzCopy utility already provides the features you require

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

You want to move a set of blobs in Azure storage from one storage account to another. You want to organize the blobs in the destination account in different folders, according to the month in which each blob was last updated. You’ll be performing this task at regular intervals. Which tool should you use?

A: az CLI
B: AzCopy Powershell
C: .Net Storage Client Library

A

C: .Net Storage Client Library - As this is a repeatable task the extra effort is justified

Neither the Azure CLI nor AzCopy provide a simple way to reorganize blobs in this way

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

Which cloud service model would be the best match for the following situation? A SQL Server database is needed for a short-term project.
The IT department does not have available hardware that meets the performance requirements or resources to deploy it.
The project starts next week.
Once the project is over, the database is no longer needed.

A: IaaS
B: PaaS
C: SaaS

A

B: PaaS

Because of the immediate need and short lifetime, PaaS is the best option. For example, you could use Azure SQL Database for the solution.

IaaS is not as good of a choice because creating a virtual machine and installing SQL Server would require more time and effort than using a pre-built PaaS offering.

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

Which cloud service model is described in the following scenario?

You create several virtual machines in the cloud.
The VMs are networked together using a virtual network.
The VMs have access to x-ray image files in cloud storage.
One virtual machine is a web server that hosts a website exposed to the internet for customers to access their records.
There is a VPN that connects the solution to your on-premises datacenter for customer information to display with the image files.

A: IaaS
B: PaaS
C: SaaS

A

A: IaaS

All the resources used in this scenario can be implemented using IaaS.

Only part of the solution could be implemented using PaaS, so it would not be a good choice.

Since this is a custom solution, we can assume there isn’t a SaaS offering that delivers this functionality.

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

Which cloud service model would be the best match for the following situation?
You work at a start-up company with a small number of employees who need to collaborate.
They need email, calendar scheduling, and somewhere to store documents.
The team is technical but do not have the time or hardware to implement and manage a solution.

A: IaaS
B: PaaS
C: SaaS

A

C: SaaS solution such as Microsoft 365 would be a good solution for the collaboration requirements.

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

True or False:

Tags can be applied to any type of resource on Azure

A

False: Not all resources support tags

You will want to confirm that your resource type supports them.

https://docs.microsoft.com/en-us/learn/modules/control-and-organize-with-azure-resource-manager/3-use-tagging-to-organize-resources

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

True or False:

Tags applied at a resource group level are propagated to resources within the resource group.

A

False: Tags are not inherited.

Tags need to be applied to every supported resource that you want tagged.

https://docs.microsoft.com/en-us/learn/modules/control-and-organize-with-azure-resource-manager/3-use-tagging-to-organize-resources

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

Which of the following features does not apply to resource groups?

A: Resources can be in only one resource group.

B: Resources can be moved from one resource group to another resource group.

C: Resource groups can be nested.

D: Role-based access control can be applied to the resource group.

A

C: Resource groups cannot be nested.

A resource group is a logical container for resources deployed on Azure. These resources are anything you create in an Azure subscription like virtual machines, Application Gateways, and CosmosDB instances.

All resources must be in a resource group and a resource can only be a member of a single resource group.

Many resources can be moved between resource groups with some services having specific limitations or requirements to move.

Resource groups can’t be nested.

Before any resource can be provisioned, you need a resource group for it to be placed in.

https://docs.microsoft.com/en-us/learn/modules/control-and-organize-with-azure-resource-manager/2-principles-of-resource-groups

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

Which of the following approaches might be a good usage of tags?

A: Using tags to associate a cost center with resources for internal chargeback
B: Using tags in conjunction with Azure Automation to schedule maintenance windows
C: Using tags to store environment and department association
D: All of the above are good ways to use tags

A

D: All of the examples are good ways to use tags

https://docs.microsoft.com/en-us/learn/modules/control-and-organize-with-azure-resource-manager/3-use-tagging-to-organize-resources

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

Which of the following approaches would be the most efficient way to ensure a naming convention was followed across your subscription?

A: Send out an email with the details of your naming conventions and hope it is followed

B: Create a policy with your naming requirements and assign it to the scope of your subscription

C: Give all other users except for yourself read-only access to the subscription. Have all requests to create resources sent to you so you can review the names being assigned to resources, and then create them.

A

B: Create a policy with your naming requirements and assign it to the scope of your subscription

https://docs.microsoft.com/en-us/learn/modules/control-and-organize-with-azure-resource-manager/4-use-policies-to-enforce-standards

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

Which of the following items would be good use of a resource lock?

A: An ExpressRoute circuit with connectivity back to your on-premises network

B: A non-production virtual machine used to test occasional application builds

C: A storage account used to temporarily store images processed in a development environment

A

A: An ExpressRoute circuit with connectivity back to your on-premises network

Resource locks are a setting that can be applied to any resource to block modification or deletion.
Resource locks can set to either Delete or Read-only.
Delete will allow all operations against the resource but block the ability to delete it.
Read-only will only allow read activities to be performed against it, blocking any modification or deletion of the resource.
Resource locks can be applied to subscriptions, resource groups, and to individual resources, and are inherited when applied at higher levels.

https://docs.microsoft.com/en-us/learn/modules/control-and-organize-with-azure-resource-manager/6-use-resource-locks-to-protect-resources

17
Q

What is the correct sequence of powershell commands to create a Virtual Machine with an encrypted disk image?

A: Encrypt the VHD using Bitlocker and a TPM module, and upload it to azure, Run the New-AzVM powershell command, Run the Set-AzVMOSDisk powershell command

B Encrypt the VHD using Bitlocker and no TPM module, and upload it to azure Run the Set-AzVMOSDisk powershell command, Run the New-AzVM powershell command

C Encrypt the VHD using Bitlocker and a TPM module, and upload it to azure. Run the Set-AzVMOSDisk powershell command, Run the New-AzVM powershell command

D Encrypt the VHD using Bitlocker and no TPM module, and upload it to azure, Run the New-AzVM powershell command, Run the Set-AzVMOSDisk powershell command,

A

B Encrypt the VHD using Bitlocker and no TPM module, and upload it to azure Run the Set-AzVMOSDisk powershell command, Run the New-AzVM powershell command

TPM is a chip on a physical computers motherboard, which virtual machines do not have

You set the encrypted disk to be the OS disk in the VM configuration using the Set-AzVMOSDisk commandlet

You create a new virtual machine using that configuration object with New-AzVm cmdlet

The Set-AzVMDiskEncryptionExtension cmdlet is used to encrypt an already running VM on Azure

18
Q

You want to create an Azure Resource Manager (ARM template based on the state of an existing resource group. The ARM template should include all properties for all selected resources

What command should you use?

A: az group deployment create
B: az group create
C: az group deployment export
D: az group export

A

az group export

Captures a resource group as a template. Requires the name of a resource group

You can use –resource-ids to filter the export to only certain resources

You should not use az group deployment create - this command is used to start a deployment from a specified template file

You should not use az group deployment export - this command is used to export the template used for a deployment

https: //docs.microsoft.com/en-us/azure/azure-resource-manager/templates/export-template-portal
https: //docs.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-cli
https: //docs.microsoft.com/en-us/cli/azure/group?view=azure-cli-latest
https: //docs.microsoft.com/en-us/cli/azure/group/deployment?view=azure-cli-latest

19
Q

Your company deploys an Azure App Service Web App for testing and troubleshooting. Members of the AppDev group should have the permissions necessary to publish code to the web app.

You need to configure members of the AppDev group as members of the contribute role for the web app.

Which PowerShell cmdlet should you use?

A New-AzRoleDefinition
B New-AzManagedApplicationDefinition
C Set-AzRoleDefinition
D New-AzRoleAssignmenr

A

You should use the New-AzRoleAssignment cmdlet. This cmdlet lets you grant access based on role-based access control (RBAC) to a security principal, including a user or group. You can also use the Azure CLI az role assignment create command to assign the RBAC role as an alternate solution.

You should not use the New-AzRoleDefinition cmdlet. This is used to create a new RBAC role definition, not to control access to the role.

You should not use the Set-AzRoleDefinition cmdlet. This cmdlet lets you configure an existing RBAC role, but it does not provide any way of setting the security principals to which the role is assigned.

You should not use the New-AzManagedApplicationDefinition cmdlet. This cmdlet does not apply in this scenario. Managed applications provide a way to offer cloud solutions that are easy for consumers to deploy and operate by publishing the applications in Azure marketplace.