Coursera Answers

Deploy a Website with Azure Virtual Machines: Quiz Answers

Mastering the concepts of Azure Virtual Machines (VMs) is essential for IT professionals and developers looking to optimize cloud deployments. This article provides a detailed overview of key questions and answers from the “Deploy a Website with Azure Virtual Machines” Module 1 test, helping you prepare effectively. | Deploy a Website with Azure Virtual Machines Quiz Answers

Module 1 Test Prep Quiz Answers

Question 1)
Regarding storage for the virtual machine, what is the minimum and maximum number of virtual hard disks (VHDs) that a VM can have?

  • 2 minimum, maximum 2 per CPU
  • 0 minimum, maximum 5 per CPU
  • 1 minimum, maximum 1 per CPU

Explanation: Azure Virtual Machines allow flexibility in the number of attached VHDs, enabling users to customize storage configurations based on their requirements.

Question 2)
If you want to reduce the maintenance of your virtual machines’ storage, which type of disks should you set up?

  • Semi-managed
  • Managed
  • Unmanaged

Explanation: Managed disks simplify storage management and enhance reliability by automatically handling storage infrastructure.

Question 3)
If you want to automate the deployment of Azure VMs in a programmatic fashion, what tools should you use? Select all options that apply.

  • Azure Client SDK
  • Azure PowerShell
  • Terraform
  • Azure REST API
  • Azure CLI

Explanation: These tools allow developers to deploy, configure, and manage Azure VMs using scripts, APIs, or infrastructure-as-code (IaC).

Question 4)
What should you configure if you want to secure and control every network request coming in or out of your VMs?

  • NSGs
  • CDN
  • Load balancer

Explanation: Network Security Groups (NSGs) provide robust access control to secure VM communication by filtering inbound and outbound traffic.

Question 5)
Which virtual machines size should you choose if you plan to use them for model training and deep learning?

  • Storage optimized
  • GPU
  • Compute optimized

Explanation: GPU-optimized VMs are designed to handle computationally intensive tasks such as deep learning and machine learning model training.

Question 6)
True or False?
You cannot change the size of your VM once it has been deployed. You’ll have to delete the VM and create a new one with your desired size.

  • True
  • False

Explanation: Azure allows you to resize a VM after deployment, although this may require a reboot and adherence to regional size availability.

Question 7)
You are planning on running a network appliance on a virtual machine. Which workload option should you implement?

  • Memory optimized
  • General purpose
  • Storage optimized
  • Compute optimized

Explanation:  Compute-optimized VMs are tailored for network-intensive workloads, ensuring maximum performance and reliability for network appliances.


 

Module 2 Test Prep Quiz Answers

Question 1)
What is the maximum capacity of the default OS disk for your Linux VM?

  • 1024 GB
  • 2048 GB
  • 512 GB

Explanation: The maximum capacity of the default OS disk for a Linux VM in Azure is 1024 GB. This is the limit for the OS disk size in Azure.

Question 2)
Azure virtual disk sizes are measured in Gibibytes (GiB), which are not the same as Gigabytes (GB).
What is the size of 1 GiB compared with 1 GB?

  • 1 GiB = 1.704 GB
  • 1 GiB = 1.074 GB
  • 1 GiB = 1.407 GB

Explanation: Gibibytes (GiB) use binary measurements (1 GiB = 1024^3 bytes), while Gigabytes (GB) use decimal measurements (1 GB = 1000^3 bytes). This results in 1 GiB being approximately 1.074 GB.

Question 3)
True or False?
You can create a VHD image from a real disk for your Azure Virtual Machine.

Explanation: Azure allows creating a VHD image from a physical disk, which can then be uploaded and used as a custom image for your Virtual Machine.

  • True
  • False

Question 4)
When using unmanaged disks, how many standard virtual hard disks at full throttle can be supported by a single storage account?

  • 40
  • 60
  • 50

Explanation: For unmanaged disks, a single storage account can support up to 50 standard virtual hard disks at full throttle.

Question 5)
Which is the more secure way to connect to your Linux virtual machine using SSH?

  • Username and password
  • SSH keys
  • Connection string

Explanation: SSH keys provide stronger security as they use cryptographic key pairs, reducing the risk of brute-force attacks compared to a username and password.

Question 6)
On Windows 10, Linux, and macOS, what is the built-in command that can generate the SSH public and private key files?

  • ssh-genkey
  • genkey-ssh
  • ssh-keygen

Explanation: The ssh-keygen command is the built-in tool on Linux, macOS, and Windows to generate SSH public and private key pairs.

Question 7)
What port needs be opened on your Azure Linux VM to allow connection via SSH?

  • 3389
  • 44
  • 22
  • 86

Explanation: Port 22 is the standard port used for SSH communication and must be open for connecting to a Linux VM.

Question 8)
True or False?
For security concerns, you must use an image from the official Azure Marketplace when creating a new virtual machine.

  • True
  • False

Explanation: While using images from the Azure Marketplace is highly recommended for security, you can also use trusted custom images if required.


 

Module 3 Test Prep Quiz Answers

Question 1)
What are the limitations of Azure Windows VM names?

  • between 10-20 characters, can contain special characters and cannot contain non-ASCII characters
  • between 1-15 characters, cannot contain special or non-ASCII characters, must be unique in resource group
  • between 10-15 characters, can contain special characters, must be unique in resource group

Explanation: Azure Windows VM names must be 1-15 characters long, use only ASCII characters, avoid special characters, and be unique within the resource group to comply with naming conventions.

Question 2)
When creating a username and password to connect to your Windows VM, what constraints apply to the format of the password?

  • minimum 10 characters long, must have two of the following: one lower case, one upper case, one number and one special character that is not \ or /
  • minimum 12 characters long, must have three of the following: one lower case, one upper case, one number and one special character that is not \ or –
  • minimum 8 characters long, must have two of the following: one lower case, one upper case, one number and one special character that is not \ or –

Explanation: Azure enforces strong password requirements to enhance security, ensuring the password contains sufficient complexity and is long enough to resist brute-force attacks.

Question 3)
What port number should be opened to be able to connect to your Windows VM using RDP?

  • 433
  • 3389
  • 22

Explanation: Port 3389 is the default port used for Remote Desktop Protocol (RDP) connections to Windows VMs.

Question 4)
True or False?
You cannot store data on you C: drive along with the OS of you Azure Windows VM.

  • True
  • False

Explanation: Data can be stored on the C: drive alongside the OS in an Azure Windows VM, but it is not recommended for critical data since the OS drive is optimized for the operating system.

Question 5)
What are some methods that enable us to install custom software onto an Azure Windows VM? Select all options that apply.

  • Custom scripts
  • Remote Desktop Protocol (RDP)
  • Custom VM images

Explanation: Custom scripts can automate software installation, RDP allows manual installation, and custom VM images can have pre-installed software to meet specific needs.

Question 6)
What do you need to configure on your Windows VM if you want to connect to it using RDP via the internet?

  • ExpressRoute
  • VPN (virtual private network)
  • Public IP

Explanation: A public IP is required to connect to your Windows VM via RDP over the internet, enabling external access to the VM.

Question 7)
True or False?
NSG (network security groups) are mandatory at subnet level and optional at network interface level.

  • True
  • False

Explanation: Network Security Groups (NSGs) are mandatory at the subnet level to secure traffic but are optional at the network interface level, providing flexibility for additional configurations.


 

Module 4 Test Prep Quiz Answers

Question 1)
Which port do we need to open on the VM to allow HTTP traffic to the web app?

  • 3389
  • 22
  • 80
  • 443

Explanation: Port 80 is the default port used for HTTP traffic, which is required to serve web apps over the internet.

Question 2)
What command should you type in the Azure CLI to open port 80 on your Ubuntu VM?

  • az vm open-port \
    –port 80 \
    –name MeanStack
  • az vm open-port \
    –port 80 \
    –resource-group [sandbox resource group name] \
    –name MeanStack
  • az vm open-port-http \
    –port 80 \
    –resource-group [sandbox resource group name] \
    –name MeanStack

Explanation: The command specifies the port, the resource group, and the VM name to ensure the correct VM is configured to allow HTTP traffic.

Question 3)
What are the available MongoDB editions? Select all options that apply.

  • MongoDB Community Server
  • MongoDB Premium Edition
  • MongoDB Standard Server
  • MongoDB Enterprise Server

Explanation: MongoDB Community Server is the free version, while MongoDB Enterprise Server offers advanced features for enterprise use. Other options are not valid editions.

Question 4)
You are installing MongoDB from the SSH connection to your Ubuntu VM.
What command should you run in Bash to make sure you have the latest packages?

  • sudo apt sudo apt upgrade -y
  • sudo apt && sudo apt upgrade
  • sudo apt update && sudo apt upgrade -y

Explanation: The sudo apt update command refreshes the package lists, and sudo apt upgrade -y upgrades the installed packages to their latest versions.

Question 5)
You are installing MongoDB from the SSH connection to your Ubuntu VM.
After you installed MongoDB, what command should you run the in Bash to make sure your service started?

  • systemctl status mongodb
  • sudo systemctl status mongodb
  • sudo status mongodb

Question 6)
You are installing Node.js from the SSH connection to your Ubuntu VM.
What command should you run in Bash to register the Node.js repository?

  • curl https://deb.nodesource.com/setup_8.x | sudo -E bash –
  • curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash –
  • curl -sL https://deb.nodesource.com/setup_8.x |

Explanation: This command downloads and executes the setup script for Node.js 8.x, registering the repository for package installation.

Question 7)
Why should you make use of AngularJS in the MEAN stack?

  • It’s a browser plugin that gets installed on your user’s computer.
  • It helps run the web application from the server side.
  • AngularJS implements data binding for HTML and JavaScript.

Explanation: AngularJS simplifies web development by providing two-way data binding, which synchronizes data between the UI and JavaScript logic.


 

Module 5 Course practice exam

Question 1)
You have several Linux virtual machines hosted in Azure. You administer these VMs remotely over SSH from three dedicated machines in your corporate headquarters. Which of the following authentication methods would typically be considered best-practice for this scenario?

  • Username and password
  • Private key with passphrase
  • Private key

Explanation: Using a private key with a passphrase is considered best practice as it combines strong cryptographic security with an additional layer of protection via the passphrase.

Question 2)
You have an Azure subscription named Subscription1 that contains a virtual machine (VM) named VM1.

  1. You enable just in time (JIT) VM access to VM1.
  2. You need to connect to VM1 by using Remote Desktop.
  3. What should you do first?
  • From the Azure portal, select the virtual machine VM1, select Connect, and then select Request access.
  • From Azure Directory (Azure AD) Privileged Identity Management (PIM), activate the Security administrator user role.
  • From the Azure portal, select the virtual machine VM1 and add the Network Watcher Agent virtual machine extension
  • From Azure Active Directory (Azure AD) Privileged Identity Management (PIM), activate the Owner role for the virtual machine.

Explanation: Just-In-Time (JIT) access requires you to request access first before connecting, ensuring secure, time-limited access to the VM.

Question 3)
You are preparing to deploy an Azure virtual machine (VM) based application. The VMs that run the application have the following requirements:
When a VM is provisioned, the firewall must be automatically configured before it can access Azure resources.
You need to ensure that the requirements are met.
Which feature should you use?

  • Serial console
  • Run Command
  • Hybrid runbook worker
  • Custom script extension

Explanation: Custom script extensions allow you to execute scripts on the VM during provisioning to automate configurations like setting up the firewall.

Question 4)
Your customer has several web applications that uses a MongoDB database. You plan to migrate the web applications to Azure. Your customer does not have time and budget to make code and configuration changes. You must migrate to Azure while minimizing code and configuration changes.
You need to implement the Cosmos DB configuration.
What should you use?

  • Cassandra API
  • Gremlin API
  • SQL API
  • MongoDB API

Explanation: The MongoDB API in Azure Cosmos DB provides compatibility with MongoDB applications, enabling a seamless migration without code or configuration changes.

Question 5)
You plan on developing a solution in Azure that will host deep learning models and Machine Learning model training. You chose to build the solution on an IaaS environment, on Virtual Machines. Which size should you choose?

  • GPU
  • Compute optimized
  • Storage optimized

Explanation: GPU-based VM sizes are optimized for deep learning and Machine Learning tasks, offering the necessary computational power for training models.

Question 6)
You plan on developing a solution in Azure that will host an e-commerce application. You chose to build the solution on an IaaS environment, hosting the web servers on Linux Virtual Machines. In order to connect to the VMs to install all the necessary frameworks, what port needs to be opened on your Azure Linux VMs to allow connection via SSH?

  • 3389
  • 22
  • 44
  • 86

Explanation: Port 22 is the default port for SSH connections, which is required for remote access to Linux VMs.

Question 7)
You built VMs in your Azure environment and you plan on connecting to them via internet. What do you need to configure on your VMs if you want to connect to them?

  • ExpressRoute
  • VPN (virtual private network)
  • Public IP

Explanation: A public IP is required to connect to Azure VMs over the internet, enabling external network access.

Question 8)
You plan on developing a solution in Azure that will host an e-commerce application. You chose to build the solution on an IaaS environment, hosting the web servers on Linux Virtual Machines. Since the application is intended for commercial use in a secure manner, it needs to allow only HTTPS traffic. Which port should you open for this?

  • 80
  • 22
  • 3389
  • 443

Explanation: Port 443 is the default port for HTTPS traffic, ensuring secure communication for the e-commerce application.

Question 9)
You are configuring a MEAN stack in your Azure Environment, and you install MongoDB from the SSH connection to your Ubuntu VM.
After you installed MongoDB, what command should you run the in Bash to make sure your service started?

  • sudo status mongodb
  • sudo systemctl status mongodb
  • systemctl status mongodb

Explanation: This command checks the status of the MongoDB service with administrative privileges on Ubuntu.

Question 10)
You are configuring an Azure environment with multiple Virtual Machines. You want to minimize the maintenance as much as possible. Having that in mind, which type of disks should you set up for your VMs?

  • Semi-managed
  • Managed
  • Unmanaged

Explanation: Managed disks reduce maintenance by abstracting storage management tasks, ensuring scalability, availability, and disaster recovery.

 

Conclusion

Understanding the nuances of Azure Virtual Machines is crucial for deploying and managing resources effectively. By mastering these quiz answers, you’ll be better prepared to leverage Azure’s capabilities and ensure your projects run smoothly.

For more Azure tips and resources, stay tuned to our blog!