az-104 dumps topic 4, 1-106 Flashcards
(101 cards)
Note: This question is part of a series of questions that present the same scenario.
You deploy an Azure Kubernetes Service (AKS) cluster named AKS1.
You need to deploy a YAML file to AKS1.
Solution: From Azure CLI, you run az aks.
Does this meet the goal?
A. Yes
B. No
B. No
To deploy a YAML file, the command is:
To manage a Kubernetes cluster, use the Kubernetes command-line client, kubectl, then run “kubectl apply -f azure-vote.yaml”
Reference:
https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough
Note: This question is part of a series of questions that present the same scenario.
You deploy an Azure Kubernetes Service (AKS) cluster named AKS1.
You need to deploy a YAML file to AKS1.
Solution: From Azure CLI, you run azcopy.
Does this meet the goal?
A. Yes
B. No
B. No
To deploy a YAML file, the command is:
To manage a Kubernetes cluster, use the Kubernetes command-line client, kubectl, then run “kubectl apply -f azure-vote.yaml”
Reference:
https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough
Note: This question is part of a series of questions that present the same scenario.
You deploy an Azure Kubernetes Service (AKS) cluster named AKS1.
You need to deploy a YAML file to AKS1.
Solution: From Azure CLI, you run the kubectl client.
Does this meet the goal?
A. Yes
B. No
A. Yes
To manage a Kubernetes cluster, use the Kubernetes command-line client, kubectl, then run “kubectl apply -f azure-vote.yaml”
Reference:
https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough
Note: This question is part of a series of questions that present the same scenario.
You have an Azure virtual machine named VM1 that runs Windows Server 2016.
You need to create an alert in Azure when more than two error events are logged to the System event log on VM1 within an hour.
Solution: You create an Azure storage account and configure shared access signatures (SASs). You install the Microsoft Monitoring Agent on VM1. You create an alert in Azure Monitor and specify the storage account as the source.
Does that meet the goal?
A. Yes
B. No
B. No
Instead: You create an Azure Log Analytics workspace and configure the data settings. You install the Microsoft Monitoring Agent on VM1. You create an alert in Azure Monitor and specify the Log Analytics workspace as the source.
Reference:
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/agents-overview
You have an Azure subscription named Subscription1. Subscription1 contains the resources in the following table.
Name Type
RG1 Resource group
RG2 Resource group
VNet1 Virtual network
VNet2 Virtual network
VNet1 is in RG1. VNet2 is in RG2. There is no connectivity between VNet1 and VNet2.
An administrator named Admin1 creates an Azure virtual machine named VM1 in RG1. VM1 uses a disk named Disk1 and connects to VNet1.
Admin1 then installs a custom application in VM1.
You need to move the custom application to VNet2. The solution must minimize administrative effort.
Which two actions should you perform?
First action:
- Create a network interface in RG2.
- Detach a network interface.
- Delete VM1.
- Move a network interface to RG2.
Second action:
- Attach a network interface.
- Create a network interface in RG2.
- Create a new virtual machine.
- Move VM1 to RG2.
First action: - Delete VM1.
Second action: - Create a new virtual machine.
We cannot just move a virtual machine between networks. What we need to do is identify the disk used by the VM, delete the VM itself while retaining the disk, and recreate the VM in the target virtual network and then attach the original disk to it.
Note: You can change the Subnet a VM is connected to after it’s created, but you cannot change the VNet.
Reference:
https://blogs.technet.microsoft.com/canitpro/2014/06/16/step-by-step-move-a-vm-to-a-different-vnet-on-azure/
https://4sysops.com/archives/move-an-azure-vm-to-another-virtual-network-vnet/#migrate-an-azure-vm-between-vnets
https://docs.microsoft.com/en-us/azure/virtual-machines/network-overview
You download an Azure Resource Manager template based on an existing virtual machine. The template will be used to deploy 100 virtual machines.
You need to modify the template to reference an administrative password. You must prevent the password from being stored in plain text.
What should you create to store the password?
A. an Azure Key Vault and an access policy
B. an Azure Storage account and an access policy
C. a Recovery Services vault and a backup policy
D. Azure Active Directory (AD) Identity Protection and an Azure policy
A. an Azure Key Vault and an access policy
You can use a template that allows you to deploy a simple Windows VM by retrieving the password that is stored in a Key Vault. Therefore, the password is never put in plain text in the template parameter file.
Reference:
https://azure.microsoft.com/en-us/resources/templates/101-vm-secure-password/
You have the App Service plans shown in the following table.
Name Operating system Location
ASP1 Windows West US
ASP2 Windows Central US
ASP3 Linux West US
You plan to create the Azure web apps shown in the following table.
Name Runtime stack Location
WebApp1 .NET Core 3.0 West US
WebApp2 ASP.NET 4.7 West US
You need to identify which App Service plans can be used for the web apps. What should you identify?
WebApp1:
WebApp2:
- ASP1 only
- ASP3 only
- ASP1 and ASP2 only
- ASP1 and ASP3 only
- ASP1, ASP2, and ASP3
WebApp1: - ASP1 and ASP3 only
ASP.NET Core apps can be hosted both on Windows or Linux.
The region in which your app runs is the region of the App Service Plan is in.
ASP2 is in Central US, not the same as WebApp1. Different locations.
WebApp2: - ASP1 only
ASP.NET apps can be hosted on Windows only. Only ASP1 is in the same Location as the WebApp2 (West US).
Reference:
https://docs.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?pivots=platform-linux
https://docs.microsoft.com/en-us/azure/app-service/app-service-plan-manage
You create a virtual machine scale set named Scale1. Scale1 is configured as shown in the following exhibit.
Initial instance count: 4
Minimum number of VMs: 2
Scale out
CPU threshold: 80
Duration in minutes: 5
Number of VMs to increase by: 2
Scale in
CPU threshold: 30
Number of VMs to decrease by: 4
Dropdowns:
If Scale1 is utilized at 85 percent for six minutes after it is deployed, Scale1 will be running [answer choice]:
- 2 virtual machines
- 4 virtual machines
- 6 virtual machines
- 10 virtual machines
- 20 virtual machines
If Scale1 is first utilized at 25 percent for six minutes after it is deployed, and then utilized at 50 percent for six minutes, Scale1 will be running [answer choice]:
- 2 virtual machines
- 4 virtual machines
- 6 virtual machines
- 8 virtual machines
- 10 virtual machines
If Scale1 is utilized at 85 percent for six minutes after it is deployed, Scale1 will be running [answer choice]:
- 6 virtual machines
The Autoscale scale out rule increases the number of VMs by 2 if the CPU threshold is 80% or higher. The initial instance count is 4 and rises to 6 when the 2 extra instances of VMs are added.
If Scale1 is first utilized at 25 percent for six minutes after it is deployed, and then utilized at 50 percent for six minutes, Scale1 will be running [answer choice]:
- 2 virtual machines
The Autoscale scale in rule decreases the number of VMs by 4 if the CPU threshold is 30% or lower. The initial instance count is 4 and thus cannot be reduced to 0 as the minimum instances is set to 2. Instances are only added when the CPU threshold reaches 80%.
Reference:
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/autoscale-overview
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/autoscale-best-practices
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/autoscale-common-scale-patterns
You plan to automate the deployment of a virtual machine scale set that uses the Windows Server 2016 Datacenter image.
You need to ensure that when the scale set virtual machines are provisioned, they have web server components installed.
Which two actions should you perform?
A. Upload a configuration script
B. Create an automation account
C. Create an Azure policy
D. Modify the extensionProfile section of the Azure Resource Manager template
E. Create a new virtual machine scale set in the Azure portal
A. Upload a conguration script
D. Modify the extensionProfile section of the Azure Resource Manager template
The Custom Script Extension downloads and executes scripts on Azure VMs. This extension is useful for post deployment configuration, software installation, or any other configuration / management task. Scripts can be downloaded from Azure storage or GitHub, or provided to the Azure portal at extension run-time.
The Custom Script extension integrates with Azure Resource Manager templates, and can also be used with the Azure CLI, Azure PowerShell, Azure portal, or the REST API
The following Custom Script Extension definition downloads a sample script from GitHub, installs the required packages, then writes the VM instance hostname to a basic HTML page.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/tutorial-install-apps-template
You have an Azure Kubernetes Service (AKS) cluster named AKS1 and a computer named Computer1 that runs Windows 10. Computer1 that has the Azure CLI installed.
You need to install the kubectl client on Computer1.
Which command should you run?
[1…] [2…] Install-cli
1. - az
- docker
- msiexec.exe
- Install-Module
2. - aks
- /package
- -name
- pull
[az] [aks] Install-cli
To install kubectl locally, use the az aks install-cli command.
Note: Azure cli commands start with az. We use Install-Module to install a Powershell module.
Reference:
https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough
https://docs.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest
You onboard 10 Azure virtual machines to Azure Automation State Conguration.
You need to use Azure Automation State Conguration to manage the ongoing consistency of the virtual machine congurations.
Which three actions should you perform in sequence?
- Assign tags to the virtual machines
- Check the compliance status of the node
- Compile a configuration into a node configuration
- Upload a configuration to Azure Automation State Configuration
- Create a management group
1: Upload a configuration to Azure Automation State Configuration
2: Compile a configuration into a node configuration
3: Check the compliance status of the node.
Step 1: Create and upload a configuration to Azure Automation
Step 2: Compile a configuration into a node configuration
Step 3: Register a VM to be managed by State Configuration
Step 4: Specify configuration mode settings
Step 5: Assign a node configuration to a managed node
Step 6: Check the compliance status of a managed node
Reference:
https://docs.microsoft.com/en-us/azure/automation/automation-dsc-getting-started
https://docs.microsoft.com/en-us/azure/automation/tutorial-configure-servers-desired-state
You have an Azure Resource Manager template named Template1 that is used to deploy an Azure virtual machine.
Template1 contains the following text:
“location” : { “allowedValues” : [
“canadacentral”, “eastus”, “westeurope”, “westus” ] }
The variables section in Template1 contains the following text:
“location”: “westeurope”
The resources section in Template1 contains the following text:
“location”: “westeurope”
You need to deploy the virtual machine to the West US location by using Template1.
What should you do?
A. Modify the location in the resources section to westus
B. Select West US during the deployment
C. Modify the location in the variables section to westus
A. Modify the location in the resources section to westus
You can change the location in resources. Parameters used to define the value of some variables to be able to use in different places in the template resources. Resources are used only for complicated expressions. In any case, RM will only deploy from resources. In case the value is not mentioned directly, then it will check parameters if it is specified in the resources. Based on this question, the value of location is defined directly in resources. so you change the resources location value.
Use location parameter. To allow flexibility when deploying your template, use a parameter to specify the location for resources. Set the default value of the parameter to resourceGroup().location.
Reference:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/resource-location?tabs=azure-powershell
https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax#resources
You create an App Service plan named Plan1 and an Azure web app named webapp1.
You discover that the option to create a staging slot is unavailable.
You need to create a staging slot for Plan1.
What should you do first?
A. From Plan1, scale up the App Service plan
B. From webapp1, modify the Application settings
C. From webapp1, add a custom domain
D. From Plan1, scale out the App Service plan
A. From Plan1, scale up the App Service plan
The app must be running in the Standard, Premium, or Isolated tier in order for you to enable multiple deployment slots. If the app isn’t already in the Standard, Premium, or Isolated tier, you receive a message that indicates the supported tiers for enabling staged publishing. At this point, you have the option to select Upgrade and go to the Scale tab of your app before continuing.
Scale up: Get more CPU, memory, disk space, and extra features like dedicated virtual machines (VMs), custom domains and certificates, staging slots, autoscaling, and more.
Scale out: Increase the number of VM instances that run your app. You can scale out to as many as 30 instances
Reference:
https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots
https://docs.microsoft.com/en-us/azure/app-service/manage-scale-up
You plan to move a distributed on-premises app named App1 to an Azure subscription.
After the planned move, App1 will be hosted on several Azure virtual machines.
You need to ensure that App1 always runs on at least eight virtual machines during planned Azure maintenance.
What should you create?
A. one virtual machine scale set that has 10 virtual machines instances
B. one Availability Set that has three fault domains and one update domain
C. one Availability Set that has 10 update domains and one fault domain
D. one virtual machine scale set that has 12 virtual machines instances
A. one virtual machine scale set that has 10 virtual machines instances
VM Scale Set consists of a set of identically configured VMs.
Availability Set consists of a set of discrete VMs.
No more than 20% of the Scale Set upgrading at any time, then 2 machines out of 10 will have maintenance, the 8 remaining VMs will be up.
Virtual machine scale sets are created with five fault domains by default in Azure regions with no zones. For the regions that support zonal deployment of virtual machine scale sets and this option is selected, the default value of the fault domain count is 1 for each of the zones. FD=1 in this case implies that the VM instances belonging to the scale set will be spread across many racks on a best effort basis.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/manage-availability
https://docs.microsoft.com/en-us/learn/modules/build-app-with-scale-sets/2-features-benefits-virtual-machine-scale-sets
https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-upgrade
Note: This question is part of a series of questions that present the same scenario.
You have an Azure virtual machine named VM1 that runs Windows Server 2016.
You need to create an alert in Azure when more than two error events are logged to the System event log on VM1 within an hour.
Solution: You create an event subscription on VM1. You create an alert in Azure Monitor and specify VM1 as the source.
Does this meet the goal?
A. Yes
B. No
B. No
Instead: You create an Azure Log Analytics workspace and configure the data settings. You install the Microsoft Monitoring Agent on VM1. You create an alert in Azure Monitor and specify the Log Analytics workspace as the source.
Reference:
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/agents-overview
Note: This question is part of a series of questions that present the same scenario.
You have an Azure virtual machine named VM1. VM1 was deployed by using a custom Azure Resource Manager template named ARM1.json.
You receive a notication that VM1 will be affected by maintenance.
You need to move VM1 to a different host immediately.
Solution: From the Overview blade, you move the virtual machine to a different subscription.
Does this meet the goal?
A. Yes
B. No
B. No
You would need to redeploy the VM.
Changing Subscription won’t affect the downtime, it will just you change the billing. You would need to redeploy the VM. After you redeploy a VM, the temporary disk is lost, and dynamic IP addresses associated with virtual network interface are updated.
From Overview there is no option to move the VM to another hardware to skip the maintenance.
Ideally you need an Availability Set and defining the Update Domains.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/redeploy-to-new-node
Note: This question is part of a series of questions that present the same scenario.
You have an Azure virtual machine named VM1. VM1 was deployed by using a custom Azure Resource Manager template named ARM1.json.
You receive a notication that VM1 will be affected by maintenance.
You need to move VM1 to a different host immediately.
Solution: From the Redeploy blade, you click Redeploy.
Does this meet the goal?
A. Yes
B. No
A. Yes
When you redeploy a VM, it moves the VM to a new node within the Azure infrastructure and then powers it back on, retaining all your configuration options and associated resources.
Use the Azure portal. Select the VM you wish to redeploy, then select the Redeploy button in the Settings blade. You may need to scroll down to see the Support and Troubleshooting section that contains the ‘Redeploy’ button.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/redeploy-to-new-node
Note: This question is part of a series of questions that present the same scenario
You have an Azure virtual machine named VM1. VM1 was deployed by using a custom Azure Resource Manager template named ARM1.json.
You receive a notication that VM1 will be affected by maintenance.
You need to move VM1 to a different host immediately.
Solution: From the Update management blade, you click Enable.
Does this meet the goal?
A. Yes
B. No
B. No
You would need to redeploy the VM.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/redeploy-to-new-node
You have an Azure subscription that contains a web app named webapp1.
You need to add a custom domain named www.contoso.com to webapp1.
What should you do first?
A. Create a DNS record
B. Add a connection string
C. Upload a certicate.
D. Stop webapp1.
A. Create a DNS record
You can use either a CNAME record or an A record to map a custom DNS name to App Service.
You should use CNAME records for all custom DNS names except root domains (for example, contoso.com). For root domains, use A records.
Reference:
https://docs.microsoft.com/en-us/Azure/app-service/app-service-web-tutorial-custom-domain
Note: This question is part of a series of questions that present the same scenario
You have an Azure subscription that contains the resources shown in the following table.
Name Туре Region
RG1 Resource group West US
RG2 Resource group East Asia
storage1 Storage account West US
storage2 Storage account East Asia
VM1 Virtual machine West US
VNET1 Virtual network West US
VNET2 Virtual network East Asia
VM1 connects to VNET1.
You need to connect VM1 to VNET2.
Solution: You move VM1 to RG2, and then you add a new network interface to VM1.
Does this meet the goal?
A. Yes
B. No
B. No
Instead, you should delete VM1. Then recreate VM1 and add the network interface for VM1.
To migrate a VM from a VNET to another VNET. The only option is to delete the VM and redeploy it using a new NIC and NIC connected to VNET2.
Note: When you create an Azure Virtual Machine (VM), you must create a Virtual Network (VNet) or use an existing VNet. You can change the subnet a VM is connected to after it’s created, but you cannot change the VNet. You can also change the size of a VM.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/network-overview
Note: This question is part of a series of questions that present the same scenario.
You have an Azure subscription that contains the resources shown in the following table.
Name Туре Region
RG1 Resource group West US
RG2 Resource group East Asia
storage1 Storage account West US
storage2 Storage account East Asia
VM1 Virtual machine West US
VNET1 Virtual network West US
VNET2 Virtual network East Asia
VM1 connects to VNET1.
You need to connect VM1 to VNET2.
Solution: You delete VM1. You recreate VM1, and then you create a new network interface for VM1 and connect it to VNET2.
Does this meet the goal?
A. Yes
B. No
A. Yes
You should delete VM1. You recreate VM1, and then you add the network interface for VM1.
Note: When you create an Azure virtual machine (VM), you must create a virtual network (VNet) or use an existing VNet. You can change the subnet a VM is connected to after it’s created, but you cannot change the VNet.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/network-overview
Note: This question is part of a series of questions that present the same scenario.
You have an Azure subscription that contains the resources shown in the following table.
Name Туре Region
RG1 Resource group West US
RG2 Resource group East Asia
storage1 Storage account West US
storage2 Storage account East Asia
VM1 Virtual machine West US
VNET1 Virtual network West US
VNET2 Virtual network East Asia
VM1 connects to VNET1.
You need to connect VM1 to VNET2.
Solution: You turn off VM1, and then you add a new network interface to VM1.
Does this meet the goal?
A. Yes
B. No
B. No
Instead, you should delete VM1. Then recreate VM1 and add the network interface for VM1.
To migrate a VM from a VNET to another VNET the only option is to delete the VM and redeploy it using a new NIC and NIC connected to VNET2.
Note: When you create an Azure Virtual Machine (VM), you must create a Virtual Network (VNet) or use an existing VNet. You can change the subnet a VM is connected to after it’s created, but you cannot change the VNet. You can also change the size of a VM.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/network-overview
You have an Azure subscription named Subscription1 that contains the quotas shown in the following table.
Quota Location Usage
Standard BS Family VCPUs West US 0 of 20
Standard D Family vCPUs West US 0 of 20
Total Regional vCPUs West US 0 of 20
You deploy virtual machines to Subscription1 as shown in the following table.
Name Size vCPUs Location Status
VM1 Standard_B2ms 2 West US Running
VM2 Standard_B16ms 16 West US Stopped(Deallocated)
You plan to deploy the virtual machines shown in the following table.
Name Size vCPUs
VM3 Standard_B2ms 1
VM4 Standard_D4s_v3 4
VM5 Standard_B16ms 16
Yes/No
You can deploy VM3 to West US.
You can deploy VM4 to West US.
You can deploy VM5 to West US.
You can deploy VM3 to West US. - Yes
You can deploy VM4 to West US. - No
You can deploy VM5 to West US. - No
Total regional vCPUs = 20
2 vCPUs (VM1) + 16 vCPUs (VM20) = 18 vCPUs, which means that only 2 vCPUs left to exceed usage limit.
We can add 1 vCPU. 2 vCPUs (VM1) + 16 vCPUs (VM20) + 1 vCPU (VM3) = 19 vCPUs
We cannot add 4 vCPUs. 2 vCPUs (VM1) + 16 vCPUs (VM20) + 4 vCPU (VM4) = 22 vCPUs
We cannot add 16 vCPU. 2 vCPUs (VM1) + 16 vCPUs (VM20) + 16 vCPU (VM5) = 34 vCPUs
Reference:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/quotas
You have an Azure subscription that contains an Azure Availability Set named WEBPROD-AS-USE2 as shown in the following exhibit.
“platformFaultDomainCount” : 2,
“platformUpdateDomainCount” : 10
You add 14 virtual machines to WEBPROD-AS-USE2.
Dropdowns:
When Microsoft performs planned maintenance in East US 2, the maximum number of unavailable virtual machines will be [answer choice]: 2, 7, 10, 14
If the server rack in the Azure datacenter that hosts WEBPROD-AS-USE2 experiences a power failure, the maximum number of unavailable virtual machines will be [answer choice]: 2, 7, 10, 14
When Microsoft performs planned maintenance in East US 2, the maximum number of unavailable virtual machines will be [answer choice]: 2
If the server rack in the Azure datacenter that hosts WEBPROD-AS-USE2 experiences a power failure, the maximum number of unavailable virtual machines will be [answer choice]: 7
There are 10 update domains. The 14 VMs are shared across the 10 update domains, so 4 update domains will have 2 VMs and 6 update domains will have 1 VM. Only one update domain is rebooted at a time.
There are 2 fault domains. The 14 VMs are shared across the 2 fault domains, so 7 VMs in each fault domain. A rack failure will affect one fault domain so 7 VMs will be offline.