AZ-301T03A - Course Manual
AZ-301T03A - Course Manual
AZ-301T03
Designing for
Deployment, Migration,
and Integration
■■ Module 0 Welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Start Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
■■ Module 1 Module Deploying Resources with Azure Resource Manager . . . . . . . . . . . . . . . . . . . 5
ARM Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Role-Based Access Control (RBAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Resource Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Building Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Online Lab - Getting Started with Azure Resource Manager Templates and Azure Building Blocks . . . 26
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
■■ Module 2 Module Creating Managed Server Applications in Azure . . . . . . . . . . . . . . . . . . . . . . 35
Infrastructure-Backed Platform-as-a-Service (PaaS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
High-Performance Compute (HPC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Online Lab - Deploying Managed Containerized Workloads to Azure . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
■■ Module 3 Module Authoring Serverless Applications in Azure . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Azure Web Apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Azure Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
High Performance Hosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Design - Mobile Apps Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Online Lab - Deploying Serverless Workloads to Azure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Start Here
Welcome to Designing for Deployment, Migra-
tion, and Integration
Welcome to Designing for Deployment, Migration, and Integration. This course is part of a series of four
courses to help students prepare for Microsoft’s Azure Solutions Architect technical certification exam
AZ-301: Microsoft Azure Architect Design. These courses are designed for IT professionals and develop-
ers with experience and knowledge across various aspects of IT operations, including networking,
virtualization, identity, security, business continuity, disaster recovery, data management, budgeting, and
governance.
This module establishes a basic understanding of Azure Resource Manager and the core concepts of
deployments, resources, templates, resource groups, and tags. The module will dive deeply into the
automated deployment of resources using ARM templates.
• Author a complex deployment using the Azure Building Blocks tools.
This module describes how solutions can leverage serverless application hosting services in Azure to
host web applications, REST APIs, integration workflows and HPC workloads without the requirement to
manage specific server resources. The module focuses on App Services-related components such as Web
Apps, API Apps, Mobile Apps, Logic Apps, and Functions.
• Describe the differences between API, Mobile, and Web Apps.
• Integrate an API or Logic App with the API Management service.
• Design an App Service Plan or multi-region deployment for high performance and scale.
Module 3 - Authoring Serverless Applications in Azure
This module describes how solutions can leverage serverless application hosting services in Azure to
host web applications, REST APIs, integration workflows and HPC workloads without the requirement to
manage specific server resources. The module focuses on App Services-related components such as Web
Apps, API Apps, Mobile Apps, Logic Apps, and Functions.
• Describe the differences between API, Mobile, and Web Apps.
• Integrate an API or Logic App with the API Management service.
• Design an App Service Plan or multi-region deployment for high performance and scale.
• Deploy an ARM template to a resource group Integrate an API or Logic App with the API Manage-
ment service.
• Design an App Service Plan or multi-region deployment for high performance and scale.
• Integrate an API or Logic App with the API Management service.
• Design an App Service Plan or multi-region deployment for high performance and scale.
Prerequisites
This course requires that students have the following knowledge and skills:
• Create App Service Plans and manage apps related to the plan.
• Configure an Azure Virtual Network and enable S2S and P2S connectivity.
• Automate everyday Azure resource tasks using Azure CLI or Azure PowerShell.
• Monitor existing Azure solutions using built-in metrics, Application Insights, or Operational Insights.
ARM Templates
Azure Resource Manager
This module establishes a basic understanding of Azure Resource Manager and the core concepts of
deployments, resources, templates, resource groups, and tags. The module will dive deeply into the
automated deployment of resources using ARM templates.
After completing this module, students will be able to:
• Create a resource group
• Add resources to a resource group
• Deploy an ARM template to a resource group
• Filter resources using tags
• Author a complex deployment using the Azure Building Blocks tools
ARM Templates
Azure has developed a great deal over the last few years, and with new services being released on a
regular basis, there was a need to create a way to manage and deploy resources in a componentized and
reusable manner. Azure Resource Manager was designed to represent each service in Azure as a resource
provider and each service instance in Azure as a modular resource. With Azure Resource Manager, JSON
templates were used to deploy collections of resources using Infrastructure-as-Code concepts. Along
with Azure Resource Manager, we saw that release of a new Azure Portal (https://portal.azure.com) that
focused on the modular nature of resources. This lesson focuses on Azure Resource Manager (ARM) and
how you can use JSON to deploy resources using ARM templates.
After completing this section you will be able to:
• Describe ARM Templates
• Understand the JSON format and how to author a JSON template in various ways
• Describe the format of a JSON file and where to obtain example templates for Azure deployments
• Deploy a resource using the Azure Quickstart templates on GitHub
Azure Resource Manager (ARM) is the latest way to conceptualize your Azure resources in your subscrip-
tion. Service instances are now resources, which are grouped as resource groups. Resource groups
provide a common lifecycle for the child resources. They can be created, managed, monitored, or deleted
together. The Resource Manager also offers the concept of resource group templates which enable you
to define a service unit in advance, and then use the template to create as many resource groups as you
need.
Resource groups and resource group templates are ideal for developer operations scenarios where you
need to quickly build out development, test, quality assurance, or production environments that are
homogenous in nature and can be managed with a shared lifecycle. Developers can quickly delete their
environment and create a new environment by using the shared template. The resource groups can be
monitored to determine the billing rate or resource usage at a higher level than monitoring individual
service instances.
Before using ARM, you need to consider resource providers and ensure your subscription contains
registrations for each provider you wish to use. Deploying a complex Virtual Machine template will fail at
the first hurdle if you are not registered for the Microsoft.Compute provider. This provider controls
access to all Virtual Machine creation.
• Resource Group: A resource group is a group of resources in the logical sense. For example, a Resource
Group composed of a Network Interface Card (NIC), a Virtual Machine compute allocation, a Virtual
Network, and a Public IP Address creates what we would logically consider a “Virtual Machine.”
• Resource Group Template: Every resource group deployment is completed using a JSON file known as
the resource group template. This JSON file declaratively describes a set of resources. The deployment
adds the new resources to a new or existing resource group. For example, a template could contain the
configuration necessary to create 2 API App instances, a Mobile App instance and a Cosmos DB instance.
ARM Templates
Azure supports the deployment of resources using Azure Resource Manager templates. In an Azure
Resource Manager template, you specify the resource—for example, a virtual network, virtual machine,
and so on—using a JSON object. Some or all of the properties of the resource can be parameterized so
that you can customize your deployment by providing parameter values at deployment time.
●● ARM Templates are deployed in a few ways. These depend on your aims, the result intended and
your chosen method for development.
●● A developer may choose to use Visual Studio to create and deploy ARM templates directly and to
manage the lifecycle of the resources through Visual Studio.
●● An administrator may choose to use PowerShell or the Azure Command Line to deploy resources
and amend them.
An end user without command line or developer skills would choose to use the Azure Portal to
deploy resources without realizing a template is involved. This deployment would typically be a
less complicated group of resources unless the user chooses to deploy a marketplace offering.
Advantages Of Using Templates
Templates are preferred to manually deploying resources for the following:
●● Ensure idempotency: If you deploy an identical template to multiple resource groups, they would
functionally be the same.
●● Simplify orchestration: only need to deploy the template to deploy all of your resources. Normal-
ly this would take multiple operations.
●● Configure multiple resources: You can configure multiple resources simultaneously and use
variables/parameters /functions to create dependencies between resources. For example you can
require that a VM is created before a Web App because you need the VM's public IP address for
one of the Web App's settings. Additionally, you can require a Storage account is created before a
VM so that you can place the VHDs in that storage account.
●● Parameterize: You can parameterize input and output values so they can be reused across many
different scenarios. Templates can also be nested so you can reuse smaller templates as part of a
larger orchestration.
Template Resources
JSON
What is JSON?
JavaScript Object Notification (JSON) is a lightweight formatted script designed for data transfer. Azure
Resource Manager uses this as the foundation for every resource.
Empty ARM Template
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
},
"variables": {
},
"resources": [
],
"outputs": {
}
}
The format of JSON is flexible in that several elements are optional.
The script must have a schema and a content section as well as a resource section. The other three,
parameters, variables and output are optional.
In day to day use, most Arm Template JSON contains all sections and even contains logic as well.
Resources can depend on other resources existing and even their names, locations and content. This
resource dependency can lead to very complex nested JSON templates when building a sophisticated
resource group, such as a SharePoint farm.
The Azure Quickstart templates on Github are an excellent resource for learning to structure and deploy
your templates correctly. If you are just beginning on your JSON journey, then the Automation script
element of every object in the Azure Portal allows you to learn the constructs and formatting of JSON.
Role Assignment
A role assignment can be created that associates a security principal to a role. The role is further used to
grant access to a resource scope. This decoupling allows you to specify that a specific role has access to a
resource in your subscription and add/remove security principals from that role in a loosely connected
manner. Roles can be assigned to the following types of Azure AD security principals:
Resource Scope
Access does not need to be granted to the entire subscription. Roles can also be assigned to resource
groups as well as for individual resources. In Azure RBAC, a resource inherits role assignments from its
parent resources. So if a user, group, or service is granted access to only a resource group within a
subscription, they will be able to access only that resource group and resources within it, and not the
other resources groups within the subscription. As another example, a security group can be added to
the Reader role for a resource group, but be added to the Contributor role for a database within that
resource group.
By granting an individual owner or contributor access to the resource group, they can configure resourc-
es, create new deployments, add new resources or create automation scripts at will without requiring
additional administrator assistance or having access to resources in other resource groups.
Custom Roles
If there is no role suitable for your purposes or granular enough to suit your needs, it is possible to create
a custom role and apply that. To create a custom role, you must use either Azure PowerShell or the Azure
Command-Line Interface.
It is also possible to use the REST API to create roles programmatically. Each Azure AD tenant is limited to
2000 custom roles.
To create a new custom role you run the New-AzureRmRoleDefinition cmdlet; you can pass a JSON
template to the cmdLet or use PSRoleDefinitionObject.
JSON required for a new Custom Role
{
"Name": "New Role 1",
"Id": null,
"IsCustom": true,
"Description": "Allows for read access to Azure storage and compute resources",
"Actions": [
"Microsoft.Compute/*/read",
"Microsoft.Storage/*/read",
],
"NotActions": [
],
"AssignableScopes": [
"/subscriptions/c489345-9cd4-44c9-99a7-4gh6575315336g"
]
}
If you save the JSON to a file such as C:\CustomRole\newrole1.json, you can use the following PowerShell
to add the custom role to a subscription.
Command to add the Custom role to the Subscriptionin PowerShell
Resource Policies
Azure Resource Policies
The use of RBAC controls users access to resources. Resource Policy is a preview service that controls
which resources can be created and what for they take, such as naming conventions, locations, and sizes.
This lesson will describe the features available and show the ways of defining, assigning and monitoring
those policies.
Built-In Policies
Azure has a built-in library of Policies to allow organizations to control their resources. These include:
• Allowed locations
• Allowed resource types
• Allowed storage account SKUs
• Allowed virtual machine SKUs
• Apply tag and default value
• Enforce tag and value
• Not allowed resource types
• Require SQL Server version 12.0
• Require storage account encryption
The inclusion of these built-in policy definitions limits the number a user is required to create to manage
their subscription efficiently.
Policy Definition
Every policy definition contains a minimum of two elements, first the conditions under which it is en-
forced. Secondly, it has an action that triggers if the conditions are met.
Policy definitions are created using JSON. A policy definition contains elements to define:
• mode
• parameters
• display name
• description
• policy rule
• logical evaluation
• effect
The following example shows a policy that defines not allowed resources (This is a built-in policy defini-
tion).
During assignment, the list of resource types not allowed parameter is populated and evaluated against
all current resources in scope for the assignments. Any non-compliant resources will be identified. When
creating new resources, the deployment will fail if they are non-compliant. The above is a straightforward
policy definition. The JSON for policy definitions can be much more complicated.
The definition can contain multiple if, then blocks and combines logical operators, conditions, and fields
to build out the policy. In addition, the policy can define alternative effects.
Policy Assignment
Once a policy definition has been created, this is known as a custom policy definition and can be as-
signed to take effect over a specific scope. This scope could range from several subscriptions within an
enterprise (known as a management group) to a resource group. A scope is the list of all the resource
groups, subscriptions, or management groups that the policy definition is assigned to.
If a policy is assigned to a resource group, the same policy applies to all the resources contained in that
group. Policy assignments are inherited by all child resources. This can be altered or prevented using the
exclusion option at the time of assignment. As an example, a policy assignment could prevent the
creation of SQL databases within your subscription. An exclusion could allow this in a single Resource
group, which you want to keep as your database Resource Group. RBAC is then used to restrict access to
the SQL database resource group to the trusted group of users that have the necessary skills and require-
ments for these resources.
A policy definition will create parameters to be applied at the time of Policy assignment. This allows for
one definition to be re-used across several resource groups, locations, and subscriptions.
The scope, exclusions, and parameters of the Not Allowed resource types are shown in the policy assign-
ments blade when assigning a definition.
Azure policies can be assigned using the Azure Portal, Azure PowerShell, and the Azure Command Line
Interface.
Initiative Definition
An initiative definition is a collection of policy definitions that are designed to achieve a design goal.
Initiative definitions contain policy definitions and can be assigned as a group to simplify the process
of achieving that goal. The definition appears as a single item rather than multiple definitions.
{
"if": {
"not": {
"field": "name",
"match": "contoso??????"
}
},
"then": {
"effect": "deny"
}
}
The effect of non-compliance is deployment failure on the creation of a resource or listing in the
non-compliant reporting if the resource is already in existence.
Security
Azure Key Vault
When deploying resources using Arm templates and automating that deployment, it is best practice to
use a Service Principal, the Azure equivalent of an Active Directory Service Account. This removes the risk
whereby an administrator account is stored and used to deploy resources. To facilitate this in a secure
manner, Azure Resource Manager can use the Azure Key Vault to store the service principal secrets. This
lesson describes the Key Vault and its use in deploying Arm templates securely.
After completing this section you will be able to:
• Describe the Azure Key Vault service.
• Describe the secure deployment of templates using Service Principals and the Key Vault.
• Create a Service Principal.
• Deploy a resource ARM templates and the Azure Key Vault.
Azure Key Vault is a two-tier service that allows secure storage of cryptographic keys, certificates, and
secrets. These can be used by applications, services, and users. The premium tier allows storage of these
secrets in a Hardware Security Module, a physical device to contain all your secrets.
Key Vault makes the process of creation, importing, maintaining and recycling secrets much easier. The
developer can easily create dev and test keys that can be migrated to production use at deployment.
Security administrators can manage all the secrets in the Key Vault with ease and grant and revoke access
when required. Key Vault can be used for several scenarios in Azure.
App developers want to use keys for signing and encryption but want all keys outside of the application.
App developers do not want to manage keys but wants their customers to bring their own keys and
certificates.
Security admins want to ensure that company applications comply with regulatory bodies requirements
such as FIPS. Key Vaults can be created in any Azure subscription by any contributor or Owner. Key Vaults
can be used to create, manage and import secrets, keys, and certificates for applications, services and
users.
Building Blocks
Azure Building Blocks
While authoring ARM templates can give you the most flexibility when automating deployments, ARM
templates can become very complex in a short amount of time. Additionally, it may be difficult to ensure
that Microsoft best practices for Azure infrastructure are reflected in every template authored by your
team.
This section introduces the Azure Building Blocks, an open-source tool and repository to help simplify the
authoring and deployment of ARM Templates. This tool includes ARM templates that already reflect best
practices as prescribed by the Patterns & Practices team at Microsoft.
After completing this section you will be able to:
• Describe the Azure Building Blocks and how they fit into a deployment automation solution.
• Decide when to author an ARM template manually or when to use the Azure Building Blocks.
• Author an Azure Building Blocks parameters file.
• Deploy a resource using the Azure Building Blocks command-line tool.
Azure supports the deployment of resources using Azure Resource Manager templates. In an Azure
Resource Manager template, you specify the resource—for example, a virtual network, virtual machine,
and so on—using a JSON object. Some or all of the the properties for the resource can be parameterized
so that you can customize your deployment by providing parameter values at deployment time.
If you have spent time developing and maintaining Azure Resource Manager templates, you may have
noticed that development of your templates follows a pattern. First you specify the JSON object for a
virtual network, then you specify the JSON object for virtual machines that are deployed into the virtual
network. Then you specify a JSON object for a network security group to secure the virtual network, and
you might specify the JSON object for a load balancer to distribute incoming requests to the virtual
machines. Perhaps you have parameterized some of the property values so you can customize the
deployment.
While Azure Resource Manager templates are very powerful and allow you to deploy very large and
complex architectures to Azure, they require a great deal of knowledge about Azure Resource Manager
and the resources themselves. This leads to difficulty maintaining your templates because any modifica-
tion can lead to unforeseen issues.
The Azure Building Blocks project solves this problem by providing a command line tool and set of Azure
Resource Manager templates designed to simplify deployment of Azure resources. You specify settings
for Azure resources using the Building Blocks JSON schema, and the command line tool merges these
settings with best practice defaults to produce a set of parameter files. The command line tool deploys
these parameter files using a set of pre-built Azure Resource Manager templates. Below is an example of
Azure Building Blocks workflow:
The Building Blocks JSON schema is designed to be flexible. You can either specify your resources
settings in one large file or several small files.
The Template Building Blocks currently support the following resource types:
• Virtual Networks
• Virtual Machines (including load balancers)
• Virtual Machine Extensions
• Route Tables
• Network Security Groups
• Virtual Network Gateways
• Virtual Network Connection
Once the azbb tool has created an ARM template parameters file, the azbb tool will use the Azure CLI
(version 2.0) to deploy the master ARM template from the building blocks repository using the parame-
ters file that was generated.
The template and parameters are sent to Azure and a deployment is created.
The Azure deployment will create a collection of resources within an Azure Resource Group. These
resource group will have historical deployment information so you can go back and view the template
and parameters used by the building blocks command line tool to deploy your resources.
access for each subnet independently of the entire VNet. Subnets are also used to segment VMs into
back-end pools for load balancers and application gateways.
As you can see from our settings file, we've specified a single subnet named firewall with an address
space of 10.0.1.0/24. Note that the subnets property is also an array—we can specify up to 1,000 subnets
for each VNet.
Settings File
To deploy this virtual network, we will need to create a settings file for the azbb command line tool. An
empty settings file looks like this:
{
"$schema": "https://raw.githubusercontent.com/mspnp/template-building-blocks/master/schemas/
buildingBlocks.json",
"contentVersion": "1.0.0.0",
"parameters" : {
"buildingBlocks": {
"value": [
{}
]
}
}
}
In the example above, the buildingBlocks array is empty. For our deployment, we will add the simple
Virtual Network building block that we discussed earlier in this topic. The settings file for our deployment
would look like this:
{
"$schema": "https://raw.githubusercontent.com/mspnp/template-building-blocks/master/schemas/
buildingBlocks.json",
"contentVersion": "1.0.0.0",
"parameters": {
"buildingBlocks": {
"value": [
{
"type": "VirtualNetwork",
"settings": [
{
"name": "msft-hub-vnet",
"addressPrefixes": [
"10.0.0.0/16"
],
"subnets": [
{
"name": "firewall",
"addressPrefix": "10.0.1.0/24"
}
]
}
]
}
]
}
}
}
Before we start
1. Ensure that you are logged in to your Windows 10 lab virtual machine using the following credentials:
●● Username: Admin
●● Password: Pa55w.rd
2. Review Taskbar located at the bottom of your Windows 10 desktop. The Taskbar contains the icons for
the common applications you will use in the labs:
●● Microsoft Edge
●● File Explorer
●● Visual Studio Code1
●● Microsoft Azure Storage Explorer2
●● Bash on Ubuntu on Windows
●● Windows PowerShell
3. Note: You can also find shortcuts to these applications in the Start Menu.
1 https://code.visualstudio.com/
2 https://azure.microsoft.com/features/storage-explorer/
3 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#exercise-1-deploy-core-azure-resources-by-using-an-
azure-resource-manager-template-from-the-azure-portal
4 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-1-open-the-azure-portal
5 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-2-deploy-an-azure-virtual-network-from-the-
azure-portal-by-using-an-azure-resource-manager-template
"metadata": {
"description": "Name prefix of the vnet"
}
},
"vnetIPPrefix": {
"type": "string",
"defaultValue": "10.2.0.0/16",
"metadata": {
"description": "IP address prefix of the vnet"
}
},
"subnetNamePrefix": {
"type": "string",
"defaultValue": "subnet-",
"metadata": {
"description": "Name prefix of the subnets"
}
},
"subnetIPPrefix": {
"type": "string",
"defaultValue": "10.2.0.0/24",
"metadata": {
"description": "IP address prefix of the first subnet"
}
}
},
"variables": {
"vnetName": "[concat(parameters('vnetNamePrefix'), resourceGroup().
name)]",
"subnetNameSuffix": "0"
},
"resources": [
{
"apiVersion": "2018-02-01",
"name": "[variables('vnetName')]",
"type": "Microsoft.Network/virtualNetworks",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('vnetIPPrefix')]"
]
},
"subnets": [
{
"name": "[concat(parameters('subnetNamePrefix'), varia-
bles('subnetNameSuffix'))]",
"properties": {
"addressPrefix": "[parameters('subnetIPPrefix')]"
}
}
],
"virtualNetworkPeerings": [],
"enableDdosProtection": false,
"enableVmProtection": false
},
"dependsOn": []
}
]
}
6 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-3-view-deployment-metadata
7 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#exercise-2-deploy-core-azure-resources-by-using-
azure-building-blocks-from-the-azure-cloud-shell
8 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-1-open-cloud-shell
2. At the Cloud Shell command prompt, type in the following command and press Enter to update the
npm configuration to include the new local directory:
npm config set prefix '~/.npm-global'
3. At the Cloud Shell command prompt, type in the following command and press Enter to open the
~./bashrc configuration file for editing:
vi ~/.bashrc
4. At the Cloud Shell command prompt, in the vi editor interface, scroll down to the bottom of the file
(or type G), scroll to the right to the right-most character on the last line (or type $), type a to enter
the INSERT mode, press Enter to start a new line, and then type the following to add the newly
created directory to the system path:
export PATH="$HOME/.npm-global/bin:$PATH"
5. At the Cloud Shell command prompt, in the vi editor interface, to save your changes and close the
file, press Esc, press :, type wq! and press Enter.
6. At the Cloud Shell command prompt, type in the following command and press Enter to install the
Azure Building Blocks npm package:
npm install -g @mspnp/azure-building-blocks
7. At the Cloud Shell command prompt, type in the following command and press Enter to exit the
shell:
exit
9 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-2-install-the-azure-building-blocks-npm-package-
in-azure-cloud-shell
10
2. At the Cloud Shell command prompt, type in the following command and press Enter to view the
content of the Azure Building Block parameter file you will use for this deployment:
cat ./template-building-blocks/scenarios/vnet/vnet-simple.json
3. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the name of your Azure subscription:
SUBSCRIPTION_ID=$(az account list --query "[0].id" | tr -d '"')
4. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the name of the resource group you created earlier in this exercise:
RESOURCE_GROUP='AADesignLab0202-RG'
5. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the Azure region you will use for the deployment:
LOCATION=$(az group list --query "[?name == 'AADesignLab0201-RG'].location"
--output tsv)
6. At the Cloud Shell command prompt, type in the following command and press Enter to deploy a
virtual network by using the Azure Building Blocks:
azbb -g $RESOURCE_GROUP -s $SUBSCRIPTION_ID -l $LOCATION -p ./tem-
plate-building-blocks/scenarios/vnet/vnet-simple.json --deploy
7. Wait for the deployment to complete before you proceed to the next task.
11
10 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-3-deploy-an-azure-virtual-network-from-cloud-
shell-by-using-azure-building-blocks
11 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-4-view-deployment-metadata
2. On the Resource groups blade, click the entry representing the resource group you created earlier in
this exercise.
3. With the Overview selection active, on the resource group blade, click the Deployments link.
4. On the resulting blade, click the latest deployment to view its metadata in a new blade.
5. Within the deployment blade, observe the information displayed in the Operation details section.
6. Close the Cloud Shell pane.
Review: In this exercise, you deployed an Azure virtual network by using an Azure Resource Manager
template from the Azure portal
12
3. Verify that the output contains only the resource groups you created in this lab. These groups will be
deleted in the next task.
14
12 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#exercise-3-remove-lab-resources
13 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-1-open-cloud-shell-1
14 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod01_
Getting%20Started%20with%20Azure%20Resource%20Manager%20Templates.md#task-2-delete-resource-groups
Review Questions
Module 1 Review Questions
Manage resources
You are designing a solution to migrate your on-premises architecture to Microsoft Azure.
You need to ensure resources are deployed in a componentized and reusable manner.
What Azure service is essential to the deployment of module resources? What is used to manage re-
sources with a shared lifecycle?
Suggested Answer ↓
Azure Resource Manager is designed to represent each service in Azure as a resource provider and each
service instance as a modular resource. Resource Groups provide a common lifecycle for child resources.
You can add multiple resources to a single resource group. You can manage all resources in a resource
group as a single unit.
Manage resource access
You are designing a solution to migrate your on-premises architecture to Microsoft Azure.
You need to manage access to Azure resources by team members in your company.
How is access to resources managed in Azure? To which security principals can access be assigned?
Suggested Answer ↓
Azure AD identities grant predetermined levels of access to an Azure subscription, resource group, or
individual resource. Role-Based access control is used to assign roles to existing Azure AD identities. You
can assign roles to users, groups, and service principals.
Manage security objects
You are designing a solution for Microsoft Azure.
What should you use to manage certificates and keys? What should you do to secure resource deploy-
ments?
Suggested Answer ↓
Azure Key Vault allows the storage of cryptographic keys, certificates, and secrets that can be used by
applications, services, and users. You can secure resource deployments by retrieving passwords from Key
Vault when you deploy an ARM Template.
Infrastructure-Backed Platform-as-a-Service
(PaaS)
Infrastructure-Backed PaaS
This module describes services that use infrastructure but manage the infrastructure on behalf of the user
instead of obfuscating the infrastructure resources. The module focuses on infrastructure-backed PaaS
options such as Azure Service Fabric, Container Service, and App Service Environments. The module will
explore how to deploy custom workloads to these services such as an HPC batch processing task.
After completing this module, students will be able to:
• Describe the differences between App Service Environments, Service Fabric and Container Service.
• Use Azure Batch to manage an HPC workload.
• Migrate to an Infrastructure-backed PaaS service from another IaaS service or a legacy Cloud Service.
Infrastructure-Backed Platform-as-a-Service (PaaS)
The need to deploy highly scalable, isolated applications with secure network access and high memory
utilization is one that is growing with increased cloud adoption. This lesson will describe the options with-
in Microsoft Azure to deploy App Service Environments, Azure Service Fabric and Azure Container Service
applications. The growth of containerized applications and microservice based applications requires the
use of these services to deploy open source solutions to deploy, manage and orchestrate at low cost and
high flexibility.
After completing this section, you will be able to:
• Describe App Service Environments and distinguish between v1 and v2.
• Describe Azure Service Fabric and distinguish between Microservices and Containers.
• Describe Azure Container Services and the variants, Docker, Mesosphere and Kubernetes.
• Deploy an App Service Environment with a web app.
Infrastructure-Backed PaaS
Every Microsoft Azure PaaS service is already hosted on Azure IaaS. Azure provides several options for
architecting and hosting your own PaaS applications at scale in the same secure and isolated infrastruc-
ture within the Azure Datacenters. To be able to provide highly scalable applications requiring isolation
with secure network access and high memory utilization, there are three services available. App Service
Environments provides a dedication scalable home for Azure Web Apps. Azure Service Fabric provides a
cluster of VMs to host containers and microservices for those applications. Finally, there is the Azure
Container Service this provides open source tools to orchestrate containers based on Docker Swarm,
Mesosphere and Kubernetes clusters. The benefit of all these technologies is that Azure lets you concen-
trate on the application architecture, and code whilst it looks after the infrastructure and the orchestra-
tion of the containers. In this lesson, we will detail these services and their intended uses.
Since Azure provides all the usual management functions, there is no SSH access to the AKS cluster.
Access is provided to the Kubernetes API endpoints. This allows any software capable of communicating
with Kubernetes endpoints to be used. Examples could include kubectl, helm, or draft. Whilst Azure
handles the infrastructure management, Kubernetes itself handles your containerized applications.
The list of Kubernetes management features includes:
• Automatic binpacking
• Self-healing
• Horizontal scaling
• Service discovery and load balancing
• Automated rollouts and rollbacks
• Secret and configuration management
• Storage orchestration
• Batch execution
HPC Pack is Microsoft’s HPC cluster and job management solution for Windows. The HPC Pack can be
installed on a server that functions as the "head node," and the server can be used to manage compute
nodes in an HPC cluster.
HPC Pack is not required for you to use the A8, A9, A10, and A11 instances with Windows Server, but it is
a recommended tool to create Windows HPC clusters in Azure. In the case of A8 and A9 instances, HPC
Pack is the most efficient way to run Windows MPI applications that access the RDMA network in Azure.
HPC Pack includes a runtime environment for the Microsoft implementation of the Message Passing
Interface for Windows.
HPC Pack can also be used in hybrid scenarios where you want to "burst to Azure" with A8 or A9 instanc-
es to obtain more processing power.
Azure Batch
Microsoft Azure Batch is a fully-managed cloud service that provides job scheduling and compute
resource management for developers in organizations, independent software vendors, and cloud service
providers. Both new and existing high-performance computing (HPC) applications running on worksta-
tions and clusters today can be readily enabled to run in Azure at scale, and with no on-premises infra-
structure required. Common application workloads include image and video rendering, media transcod-
ing, engineering simulations, Monte Carlo simulations, and software test execution, among others; all
highly parallel, computationally intensive workloads that can be broken into individual tasks for execu-
tion. With Azure Batch, you can scale from a few VMs, up to tens of thousands of VMs, and run the most
massive, most resource-intensive workloads.
Azure Batch
Azure Batch is a service that manages Virtual Machines for large-scale parallel and high-performance
computing (HPC) applications. Batch is a Platform as a Service (PaaS) offering that manages the VMs
necessary for your compute jobs for you instead of forcing you to manage an HPC cluster or job sched-
ule. Batch provides auto-scaling functionality and job scheduling functionality in addition to managing
compute nodes.
Batch computing is a familiar pattern for organizations that process, transform, and analyze large
amounts of data, either on a schedule or on-demand. It includes end-of-cycle processing such as a bank’s
daily risk reporting or a payroll that must be done on schedule. It also includes large-scale business,
science, and engineering applications that typically need the tools and resources of a compute cluster or
grid. Applications include traditional HPC applications such as fluid dynamics simulations as well as
specialized workloads in fields ranging from digital content creation to financial services to life sciences
research. Batch works well with intrinsically parallel (sometimes called “embarrassingly parallel”) applica-
tions or workloads, which lend themselves to running as parallel tasks on multiple computers.
Scaling out Parallel Workloads
The Batch API can handle scale out of an intrinsically parallel workload such as image rendering on a
pool of up to thousands of compute cores. Instead of having to set up a compute cluster or write code
to queue and schedule your jobs and move the necessary input and output data, you automate the
scheduling of large compute jobs and scale a pool of compute VMs up and down to run them. You can
write client apps or front-ends to run jobs and tasks on demand, on a schedule, or as part of a larger
workflow managed by tools such as Azure Data Factory.
You can also use the Batch Apps API to wrap an existing application, so it runs as a service on a pool of
compute nodes that Batch manages in the background. The application might be one that runs today on
client workstations or a compute cluster. You can develop the service to let users offload peak work to
the cloud, or run their work entirely in the cloud. The Batch Apps framework handles the movement of
input and output files, the splitting of jobs into tasks, job and task processing, and data persistence.
Migration
On-Premises Lift and Shift
Migrating from on-premises workloads into Azure can be achieved in several ways that depend upon the
individual workloads and the level of rewriting that the user is prepared or able to achieve. This lesson
covers the Azure Migrate preview service and strategies for migrating from on-premises to Azure IaaS,
and PaaS solutions. The ability to convert cloud service roles into Azure Service Fabric microservices is
also discussed.
Migration
The challenge of migrating workloads and applications to a cloud-based or hybrid platform or even from
converting from cloud-based IaaS to a PaaS solution is one that causes much concern when adopting a
public cloud strategy. There are several options for beginning the “journey to the cloud.” For moving
workloads, the “lift and shift” approach provides all the benefits of pay as you go computing without the
potential headaches of rewriting application code or re-architecting the application to fit a specific cloud
application pattern.
On-Premises Lift and Shift
A new service from Microsoft, the Azure Migrate service provides a discovery and assessment tool. Azure
Migrate assesses suitability for migration and ensures that sizing is correct for the performance of the
VM. An estimate of the cost of running your VM in Azure is also available; this service is designed for
those considering a lift and shift migration or beginning to plan their migration to the cloud. Migrate
provides the ability to visualize dependencies of a specific VM or for all VMs in a group. The service
currently only provides assessment for VMWare VMs but soon will also include Hyper-V VMs.
The lift and shift approach is an ideal method to begin the migration of workloads to modernization.
Commencing with lift and shift, moving through the phases shown below to cloud-optimized taking
advantage of the PaaS services and cloud native applications. The latter often requires the applications to
be rewritten.
The deployment package contains the web role and worker role definition and specifies the instance
count for each role; an instance is a VM hosting that role.
Deployment Package
Migrating a cloud service to Service Fabric switches to deploying applications to VMs that are already
running Service Fabric either on Windows or Linux. The applications or services that are deployed are
entirely unrelated to the VM infrastructure. The service fabric application platform hides the VM layer
from the application. This also allows multiple applications to be deployed to a service fabric cluster.
The architecture of applications running on the two services is fundamentally different.
A cloud service application will typically have external dependencies which manage the data and state of
an application and the method of communicating between web and worker roles.
A Service fabric application can also rely on the same external service dependencies. The quickest and
easiest way to migrate a Cloud Service application to service fabric is to merely convert the Web roles
and worker roles to stateless services whilst keeping the architecture the same.
If the aim is to remove the external dependencies and take full advantage of the ability to unify deploy-
ment, management and upgrade models, then state-full services would be required which will mean full
code and application rewrites.
Migration both to the cloud in general as a lift and shift and to modern cloud-native applications is a
complicated and time-consuming project.
Before we start
1. Ensure that you are logged in to your Windows 10 lab virtual machine using the following credentials:
●● Username: Admin
●● Password: Pa55w.rd
2. Review Taskbar located at the bottom of your Windows 10 desktop. The Taskbar contains the icons for
the common applications you will use in the labs:
●● Microsoft Edge
●● File Explorer
●● Visual Studio Code1
●● Microsoft Azure Storage Explorer2
●● Bash on Ubuntu on Windows
●● Windows PowerShell
3. Note: You can also find shortcuts to these applications in the Start Menu.
1 https://code.visualstudio.com/
2 https://azure.microsoft.com/features/storage-explorer/
3 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#exercise-1-create-azure-kubernetes-service-aks-cluster
4 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-1-open-the-azure-portal
3. If prompted, authenticate with the user account account that has the owner role in the Azure sub-
scription you will be using in this lab.
5 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-2-open-cloud-shell
6 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-3-create-an-aks-cluster-by-using-cloud-shell
2. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the Azure region you will use for the deployment (replace the place-
holder <Azure region> with the name of the Azure region to which you intend to deploy resources
in this lab):
LOCATION='<Azure region>'
3. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new resource group:
az group create --name $RESOURCE_GROUP --location $LOCATION
4. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new AKS cluster:
az aks create --resource-group $RESOURCE_GROUP --name aad0402-akscluster
--node-count 1 --node-vm-size Standard_DS1_v2 --generate-ssh-keys
5. Note: If you receive an error message regarding availability of the VM size which value is represented
by the --node-vm-size parameter, review the message and try other suggested VM sizes.
6. Note: Alternatively, you can identify VM sizes available in your subscription in a given region by
running the following command and reviewing the values in the Restriction column (make sure to
replace the <region> placeholder with the name of the target region):
Get-AzComputeResourceSku | where {$_.Locations -icontains "region"} |
Where-Object {($_.ResourceType -ilike "virtualMachines")}.
7. Note: The Restriction column will contain the value NotAvailableForSubscription for VM sizes that
are not available in your subscription.
8. Note: As of 2/21/2019, VM Size Standard_DS2_V2 was available in westeurope
9. Wait for the deployment to complete before you proceed to the next task.
10. Note: This operation can take up to 10 minutes.
2. At the Cloud Shell command prompt, type in the following command and press Enter to verify
connectivity to the AKS cluster:
7 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-4-connect-to-the-aks-cluster
3. At the Cloud Shell command prompt, review the output and verify that the node is reporting the
Ready status. Rerun the command until the correct status is shown.
Result: After you complete this exercise, you should have successfully deployed a new AKS cluster.
1. Note: Make sure to use lower case letters when typing the name of the deployment.
2. At the Cloud Shell command prompt, type in the following command and press Enter to verify that a
Kubernetes pod has been created:
kubectl get pods
3. At the Cloud Shell command prompt, type in the following command and press Enter to identify the
state of the deployment:
kubectl get deployment
4. At the Cloud Shell command prompt, type in the following command and press Enter to make the
pod available from Internet:
kubectl expose deployment aad0402-akscluster --port=80 --type=LoadBalancer
5. Note: Make sure to use lower case letters when typing the name of the deployment.
6. At the Cloud Shell command prompt, type in the following command and press Enter to identify
whether the public IP address has been provisioned:
kubectl get service --watch
8 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#exercise-2-managing-an-aks-cluster-and-its-containerized-
workloads
9 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-1-deploy-a-containerized-application-to-an-aks-
cluster
7. Wait until the value in the EXTERNAL-IP column for the aad0402-akscluster entry changes from to
a public IP address, then press Ctrl-C key combination. Note the public IP address in the EXTER-
NAL-IP column for aad0402-akscluster.
8. Start Microsoft Edge and browse to the IP address you obtained in the previous step. Verify that
Microsoft Edge displays a web page with the Welcome to nginx! message.
10
2. At the Cloud Shell command prompt, type in the following command and press Enter to verify the
outcome of scaling the deployment:
kubectl get pods
3. Note: Review the output of the command and verify that the number of pods increased to 2.
4. At the Cloud Shell command prompt, type in the following command and press Enter to scale out
the number of cluster nodes:
az aks scale --resource-group $RESOURCE_GROUP --name aad0402-akscluster
--node-count 2
8. Note: Review the output of the command and verify that the number of nodes increased to 2.
9. At the Cloud Shell command prompt, type in the following command and press Enter to scale the
deployment:
kubectl scale --replicas=10 deployment/aad0402-akscluster
10. At the Cloud Shell command prompt, type in the following command and press Enter to verify the
outcome of scaling the deployment:
kubectl get pods
10 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-2-scaling-containerized-applications-and-aks-cluster-
nodes
11. Note: Review the output of the command and verify that the number of pods increased to 10.
12. At the Cloud Shell command prompt, type in the following command and press Enter to review the
pods distribution across cluster nodes:
kubectl get pod -o=custom-columns=NODE:.spec.nodeName,POD:.metadata.name
13. Note: Review the output of the command and verify that the pods are distributed across both nodes.
14. At the Cloud Shell command prompt, type in the following command and press Enter to delete the
deployment:
kubectl delete deployment aad0402-akscluster
11
2. At the Cloud Shell command prompt, type in the following command and press Enter to navigate to
the location of the downloaded app:
cd azure-voting-app-redis
3. At the Cloud Shell command prompt, type in the following command and press Enter to list the
content of the application .yaml file:
cat azure-vote-all-in-one-redis.yaml
4. Review the output of the command and verify that the pod defninition includes requests and limits in
the followng format:
resources:
requests:
cpu: 250m
limits:
cpu: 500m
11 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#exercise-3-autoscaling-pods-in-an-aks-cluster
12 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-1-deploy-a-kubernetes-pod-by-using-a-yaml-file
5. At the Cloud Shell command prompt, type in the following command and press Enter to deploy the
application based on the .yaml file:
kubectl apply -f azure-vote-all-in-one-redis.yaml
6. At the Cloud Shell command prompt, type in the following command and press Enter to to verify
that a Kubernetes pod has been created:
kubectl get pods
7. At the Cloud Shell command prompt, type in the following command and press Enter to identify
whether the public IP address for the containerized application has been provisioned:
kubectl get service azure-vote-front --watch
8. Wait until the value in the EXTERNAL-IP column for the azure-vote-front entry changes from to a
public IP address, then press Ctrl-C key combination. Note the public IP address in the EXTERNAL-IP
column for azure-vote-front.
9. Start Microsoft Edge and browse to the IP address you obtained in the previous step. Verify that
Microsoft Edge displays a web page with the Azure Voting App message.
13
2. At the Cloud Shell command prompt, type in the following command and press Enter to install
Metrics Server:
kubectl create -f ~/metrics-server/deploy/1.8+/
3. At the Cloud Shell command prompt, type in the following command and press Enter to configure
autoscaling for the azure-vote-front deployment:
kubectl autoscale deployment azure-vote-front --cpu-percent=50 --min=3
--max=10
4. At the Cloud Shell command prompt, type in the following command and press Enter to view the
status of autoscaling:
kubectl get hpa
5. At the Cloud Shell command prompt, type in the following command and press Enter to view the
pods:
13 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-2-autoscale-kubernetes-pods
6. Note: Verify that the number of replicas incrased to 3. If that is not the case, wait one minute and
rerun the two previous steps.
7. At the Cloud Shell command prompt, type in the following command and press Enter to delete the
deployment:
kubectl delete deployment azure-vote-front
8. At the Cloud Shell command prompt, type in the following command and press Enter to delete the
deployment:
kubectl delete deployment azure-vote-back
9. At the Cloud Shell command prompt, type in the following command and press Enter to verify that
the commands you ran in the previous steps completed successfully:
kubectl get pods
10. At the Cloud Shell command prompt, type in the following command and press Enter to delete the
AKS cluster:
az aks delete --resource-group AADesignLab0402-RG --name aad0402-akscluster
--yes --no-wait
14
1. At the Cloud Shell command prompt, type in the following command and press Enter to generate
the SSH key pair that will be used to authenticate when accessing the Linux VMs running the Jenkins
instance and Grafana console:
14 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#exercise-4-implement-devops-with-aks
15 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-1-deploy-devops-with-aks
●● When prompted to enter the file in which to save the key, press Enter to accept the default value
(~/.ssh/id_rsa).
●● When prompted to enter passphrase, press Enter twice.
2. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the public key of the newly generated key pair:
PUBLIC_KEY=$(cat ~/.ssh/id_rsa.pub)
3. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the public key of the newly generated key pair and which takes into
account any special character the public key might include:
PUBLIC_KEY_REGEX="$(echo $PUBLIC_KEY | sed -e 's/\\/\\\\/g; s/\//\\\//g;
s/&/\\\&/g')"
4. Note: This is necessary because you will use the sed utility to insert this string into the Azure Resource
Manager template parameters file. Alternatively, you could simply open the file and enter the public
key string directly into the file.
5. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the name of the resource group you will use for the deployment:
RESOURCE_GROUP='AADesignLab0403-RG'
6. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the Azure region you will use for the deployment:
LOCATION=$(az group list --query "[?name == 'AADesignLab0402-RG'].location"
--output tsv)
7. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new resource group:
az group create --name $RESOURCE_GROUP --location $LOCATION
8. At the Cloud Shell command prompt, type in the following command and press Enter to create an
Azure Active Directory service principal for the authentication of services and resources within the
sample solution:
SERVICE_PRINCIPAL=$(az ad sp create-for-rbac --name AADesignLab0403-SP)
9. At the Cloud Shell command prompt, type in the following command and press Enter to retrieve the
appId attribute of the newly created service principal:
APP_ID=$(echo $SERVICE_PRINCIPAL | jq .appId | tr -d '"')
10. At the Cloud Shell command prompt, type in the following command and press Enter to retrieve the
password attribute of the newly created service principal:
11. At the Cloud Shell command prompt, type in the following command and press Enter to create the
parameters file you will use for deployment of the sample solution and open it in the vi interface:
vi ~/parameters.json
12. At the Cloud Shell command prompt, in the vi editor interface, add the content of the sample
parameters file (\allfiles\AZ-301T03\Module_02\Labfiles\Starter\parameters.json):
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploy-
mentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"spClientId": {
"value": "$APP_ID"
},
"spClientSecret": {
"value": "$PASSWORD"
},
"linuxAdminUsername": {
"value": "Student"
},
"linuxAdminPassword": {
"value": "Pa55w.rd1234"
},
"linuxSSHPublicKey": {
"value": "$PUBLIC_KEY_REGEX"
}
}
}
13. At the Cloud Shell command prompt, in the vi editor interface, to save your changes and close the
file, press Esc, press :, type wq! and press Enter.
14. At the Cloud Shell command prompt, type in the following command and press Enter to replace the
placeholder for the appId attibute with the value of the $APP_ID variable in the parameters file:
sed -i.bak1 's/"$APP_ID"/"'"$APP_ID"'"/' ~/parameters.json
15. At the Cloud Shell command prompt, type in the following command and press Enter to replace the
placeholder for the password attribute with the value of the $PASSWORD variable in the parameters
file:
sed -i.bak2 's/"$PASSWORD"/"'"$PASSWORD"'"/' ~/parameters.json
16. At the Cloud Shell command prompt, type in the following command and press Enter to replace the
placeholder for the sshPublicKey parameter with the value of the $PUBLIC_KEY_REGEX variable in
the parameters file:
17. At the Cloud Shell command prompt, type in the following command and press Enter to verify that
the placeholders were successfully replaced in the parameters file:
cat ~/parameters.json
18. At the Cloud Shell command prompt, type in the following command and press Enter to deploy the
sample solution by using its Azure Resource Manager template residing in a GitHub repository:
az group deployment create --resource-group $RESOURCE_GROUP --template-uri
https://raw.githubusercontent.com/mspnp/solution-architectures/master/apps/
devops-with-aks/azuredeploy.json --parameters @parameters.json
19. Wait for the deployment to complete before you proceed to the next task.
20. Note: The deployment can take up to 15 minutes.
16
17
16 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-2-review-the-devops-with-aks-architecture
17 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#exercise-5-remove-lab-resources
18 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-1-open-cloud-shell
2. At the Cloud Shell command prompt at the bottom of the portal, type in the following command and
press Enter to list all resource groups you created in this lab:
az group list --query "[?starts_with(name,'AADesignLab04')]".name --output
tsv
3. Verify that the output contains only the resource groups you created in this lab. These groups will be
deleted in the next task.
19
19 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod02_
Deploying%20Managed%20Containerized%20Workloads%20to%20Azure.md#task-2-delete-resource-groups
Review Questions
Module 2 Review Questions
Infrastructure as a Service (IaaS)
What Azure architecture type provides automatic management of infrastructure? What Azure services are
built on this principle?
Suggested Answer ↓
Azure provides an Infrastructure-Backed Platform-as-a-Service (IaaS) architecture that can be used when
automatic management of infrastructure is required. There are several services that Azure offers built on
this architecture including Web Apps, Service Fabric Apps, and Container Services.
High performance computing
You are designing a solution for a company. The solution requires high performance and low latency.
Which Azure services support High Performance Computing?
Suggested Answer ↓
he Microsoft Azure platform has a large number of features that support HPC, including HPC Pack, Azure
Batch, and Stateless Component Workloads.
Migration strategies
You develop a solution to migrate your company architecture to Azure Resource Manager (ARM).
You need to move all on-premises and classic Azure resources.
What types of migration does Azure support? What service does Azure offer for virtual machines (VMs)?
Suggested Answer ↓
Microsoft Azure supports multiple types of migration strategies including on-premises lift and shift,
classic (Azure Service Manager) migration to ARM, and cloud to Platform-as-a-Service (PaaS). The Azure
Migrate service assesses suitability of workloads and environments for migration, and ensures that VM
sizing is optimized.
Flexibility
You can use a variety of integrated development environments (IDEs) and frameworks, such as .NET, Java,
PHP, Node.js, or Python, to develop your web applications that are eventually deployed to Azure Web
Apps. You can use Git and Kudu to deploy Node.js or PHP web applications. You also can deploy web
applications that are developed in Microsoft Visual Studio to Web Apps by using the File Transfer Proto-
col (FTP) or the Web Deploy protocol.
Scalability
Because Web Apps is a fully managed service implementation, you can focus on developing your applica-
tion and solving business problems instead of the hosting implementation and hardware scaling or
specifics. You can easily scale up a stateless web application by configuring autoscale in the portal.
Autoscale creates multiple instances of your Web App that are automatically load balanced so that your
application can meet potential spikes in demand.
Web App Containers
The Web Apps service is offered in both a Windows and Linux variant. The Linux variant specifically offers
the ability to host Docker containers directly using a Web App. The docker containers can be sourced
from Docker Hub, Azure Container Registry or GitHub. Containers can be deployed manually, as part of
the Web App deployment or deployed in a streamlined continuous integration process using Docker Hub
or GitHub.
API Apps
API and Mobile Apps are specialized version of Web Apps designed to server different purposes in an
all-up solution on Azure.
API Apps provide specific support for developing, hosting and securing your custom API’s in the context
of App. API Apps can run either custom code or can run dozens of pre-built software to connect to
existing popular Software-as-a-Service solutions. API Apps share a lot of the same features and support
as Web Apps.
Mobile Apps
Azure Mobile Apps is a component of Azure App Services offering designed to make it easy to create
highly-functional mobile apps using Azure. Mobile Apps brings together a set of Azure services that
enable backend capabilities for your apps. Mobile Apps provides the following backend capabilities in
Azure to support your apps:
• Single Sign On: Select from an ever-growing list of identity providers including Azure Active Directory,
Facebook, Google, Twitter, and Microsoft Account, and leverage Mobile Apps to add authentication to
your app in minutes.
• Offline Sync: Mobile Apps makes it easy for you to build robust and responsive apps that allow
employees to work offline when connectivity is not available, and synchronize with your enterprise
backend systems when devices comes back online. Offline sync capability is supported on all client
platforms and works with any data source including SQL, Table Storage, Mongo, or Document DB, and
any SaaS API including Office 365, Salesforce, Dynamics, or on-premises databases.
• Push Notifications: Mobile Apps offers a massively scalable mobile push notification engine, Notifica-
tion Hubs, capable of sending millions of personalized push notifications to dynamic segments of
audience using iOS, Android, Windows, or Kindle devices within seconds. You can easily hook Notification
Hubs to any existing app backend, whether that backend is hosted on-premises or in the cloud.
• Auto Scaling: App Service enables you to quickly scale-up or out to handle any incoming customer
load. Manually select the number and size of VMs or set up auto-scaling to scale your mobile app
backend based on load or schedule.
Mobile App endpoints are, at their simplest, REST APIs and can be used on a wide variety of platforms
and with a wide variety of devices. Client SDKs are available, however, if you like to connect your mobile
application to a Mobile App instance for its backend data.
Azure Functions
Serverless Processing
This section briefly introduces Azure Functions and the concept of Serverless processing.
After completing this lesson, you will be able to:
• Explain how serverless compute can potentially save costs.
• Describe the Azure Functions service.
Serverless Processing
Azure Functions are the newest kind of App available in App Services. Function Apps are designed to
make it faster to process events
and distribute output to bound services.
Note: Function Apps were implemented using the existing code and base functionality for Azure
WebJobs. To this end, you can go to GitHub and view the Azure WebJobs repositories to see the open-
source implementation of Function Apps.
Function Apps can be created using one of two models:
• App Service: The App Service model allows you to use the already familiar App Service Plan paradigm
with Function Apps. In this model, Function Apps exist as simply another kind of app within an App
Service Plan.
• Consumption: The consumption model allows you to pay for Function Apps based on execution time
as opposed to having a dedicated App Service Plan. Function Apps are billed at a rate specific to Giga-
byte Seconds after a specific free monthly allocation threshold has been met.
Function Apps share a lot of functionality with other App types such as Web Apps. You can configure App
Settings, Connection Strings, AlwaysOn, Continous Deployment and many other settings that are config-
urable in a Web App instance.
Note: In order to guarantee that your Function App will respond to requests as quickly as possible,
you should enable the AlwaysOn feature for your Function App whenever possible.
Event-Based Triggers
Azure Functions must be initiated in some way before they can begin running code or processing data. A
Trigger is anything that invokes an Azure Function.
Azure Functions have triggers for many different scenarios including:
• Creation of Blobs
Integration
API Management
This section introduces API Management and Logic Apps as integration solutions available on the Azure
platform.
After completing this section, you will be able to:
• Describe API Management in the context of a REST API B2B solution.
• Use Logic Apps for sophisticated integration among application components.
API Management
Azure API Management helps organizations publish APIs to external, partner and internal developers to
unlock the potential of their data and services. Businesses everywhere are looking to extend their opera-
tions as a digital platform, creating new channels, finding new customers and driving deeper engagement
with existing ones. API Management provides the core competencies to ensure a successful API program
through developer engagement, business insights, analytics, security and protection.
To use API Management, administrators create APIs. Each API consists of one or more operations, and
each API can be added to one or more products. To use an API, developers subscribe to a product that
contains that API, and then they can call the API's operation, subject to any usage policies that may be in
effect.
Logic Apps
Logic Apps are workflows, designed using JSON, that can connect various components of your applica-
tion together using minimal or no-code. Logic Apps can integrate with existing services using built-in
connectors. There are connectors available for popular services such as:
• SQL Server
• OneDrive
• Dropbox
• Twilio
• SendGrid
• Cosmos DB
• Event Grid
• Event Hubs
• Storage Blobs, Queues and Tables
• Mobile Apps
Logic Apps can also integrate with custom APIs that are deployed as API Apps in your subscription.
The main components of a Logic App are as follows:
• Workflow: The business process described as a series of steps, in an acyclic graph (loops are not
supported).
• Triggers: The step that starts a new workflow instance.
Scaling
In Azure App Service, when an administrator needs to increase the performance he can do it by changing
the number of instances running in the App Service Plan (scale out) or by changing to a higher pricing
tier (scale up). Scaling up provides more CPU, memory, disk space and features, like autoscale, deploy-
ment slots, etc. Scaling out increases the number of instances running the application. This scaling can be
manual, if you’re using the Basic Tier, or automatically, if you’re using the Standard or upper service tiers.
Standard tier allows to scale up to 10 instances and if you still need more instances you can go to the
Isolated tier where you can scale up to 100 instances. Scaling an application does not require you to
change your application code.
In this architecture we had separated our two applications tiers (Web app and an REST API) into different
App Service Plans. This way we can scale each tier individually. We had created a Web Job in order to pro-
cess long-running task in the background, this is also accomplished by using a Message Queue to control
the work to be done and already processed.
Traffic Manager
Using a multi-region architecture provides a higher availability of your applications. If there is an outage
in the primary datacenter, using the Traffic Manager service is possible to redirect the traffic to a second-
ary data center that is available, this way the application will not suffer an outage, reinforcing the overall
application uptime.
In a multi-region model, we have three main components:
• Active and Standby regions
• Traffic Manager
• SQL Database Geo-replication
In a multi-region model, we have higher global availability of our solutions. This is accomplished by
having our solution replicated in two regions and having the Traffic Manager routing incoming traffic to
the active region, but in case of failure of this region, this service will failover to the standby region. The
SQL Database active geo-replication feature also plays an essential role in this architecture. It creates a
replica in the standby region and if the primary database fails or needs to be taken offline, we can failover
to one of the up to four replicas.
concept apps for iOS and Android, and one of them is quite savvy with .NET and brings some backend
experience to the table. However, the executives all agree that this one developer cannot deliver the
entire backend alone, so they are looking for a solution that provides them a “back end in a box” as they
cannot afford to hire any more developers. Additionally, headquarters wants their IT team to have easy
visibility into the health of the system, and more importantly that the system can take care of itself.
Specifically, they are familiar with the notion of pay-as-you-go billing, and would love a solution that
operates at nominal cost during their average daytime load, but on Friday night and Saturday night
automatically handles the increased demand, albeit at an additional cost.
What Is the Customer's Goal?
FastRide is a software solution that the company has been planning to build that uses the GPS of 4G
enabled mobile devices in each Crazy Taxi to monitor the location of each vehicle in the Crazy Taxi fleet.
By being able to visualize how their fleet is moving throughout the city in real time, FastRide will allow
Crazy Taxi Cab Co. to optimize their driver coverage throughout the city. When a new customer calls in,
the telephone dispatcher enters their pickup location and the FastRide system identifies the closest
available driver, instead of requiring dispatch to manually poll all of the drivers over the radio. While
stationary, a driver accepts a fare using the FastRide app on his mobile device. FastRide will provide the
driver with the pick-up details such as location, passenger name and callback phone (if available). Upon
arrival the destination, the device will compute the fare automatically based on time in transit and
distance driven, all with intent of minimizing driver distraction while driving due to interacting with the
device. The fare information should be collected on the device and uploaded to a central database in
near real-time. Should the driver enter a pocket without cellular connectivity, the device should store the
data offline and sync it as soon as connectivity is restored.
The fare data is associated with each driver, who logs in in thru his or her app using his or her own
Microsoft Account, Google, Twitter or Facebook credentials. It is the intent that driver fare data will be
used to track the driver’s progress against established company goals, which both the company and
driver access in the form of reports. Because these reports may grow to involve more complex computa-
tions (such as comparing the driver’s selected route to similar routes taken by other drivers), these data
powering the reports will be computed nightly and made available the following day.
While initially notifications would be sent only to drivers about potential fares they can choose to accept,
Crazy Taxi is looking forward to when they can offer their patrons a mobile app that can receive notifica-
tions about when the driver is in route, ETA updates and any messaging from the driver to the customer.
They would like to be certain that the system they build on today has the capacity to meet those in-
creased demands in the future.
push notifications and services for login via a social identity provider. This was exactly the “back-end in a
box” that they were looking for.
Crazy Taxi Cab Co. leveraged the many features of Mobile Apps available to them with the Standard tier
in order to minimize their backend development burden and accelerate solution delivery.
The implementation of the proposed Azure Mobile Apps solution would create a strategic partnership
that will help Crazy Taxi Cab Co. to overcome its challenges with:
• Minimizing system downtime.
• Sending multiple user specific notifications to mobile devices.
• Managing user accounts leveraging social identity providers, such as Microsoft Account, Facebook, and
Twitter.
• 24/7 (secure) data accessibility throughout the Crazy Taxi Cab Co. network.
• Scalability in software solutions in an agile marketplace.
As the FastRide system continues to be improved upon, Mobile Apps will help to inject velocity into the
development cycle by providing a mobile back end to the application. Mobile Apps offers cross platform
compatible components, which gives Crazy Taxi Cab Co. the flexibility to change their mobile platform as
the needs of their business dictate. This “back-end as a service” approach will allow Crazy Taxi to focus on
building an app that merges the right functionality with a great user experience for each market the
operate in.
By utilizing push notifications, Crazy Taxi Cab Co. can optimize their customer pickup messages through
the FastRide app. This allows for faster, and more streamlined in-app communication. When a new fare’s
pickup address is entered into FastRide by a dispatcher, or the customer facing mobile app, Mobile Apps
will enable FastRide to automatically send a notification to the closest available driver—eliminating the
need for manual notifications. Since push notifications can be managed, each base will have control over
the messages sent to its drivers.
To propose a more complete solution and ensure deployment success, it would be helpful to know:
• Type and operating system of tablets being used.
• Expected product life of current tablet choice.
• Current number of dashboard tablets.
• Projected number of tablets after the planned expansion this year and next year.
• Current average number of fares completed per day, week, month, year.
• Projected average number of fares completed per day, week, month, year after the expansion into new
markets.
• Rate of growth across bases (customer and driver).
• Other software products used to operate the company.
Understanding these details and decisions will help identify the current and future software, hardware,
and infrastructure needs of Crazy Taxi Cab Co., and to provide solutions that are consistent with their
short and long-term business goals.
High-Level Architecture
Crazy Taxi Cab Co. leveraged the many features of Mobile Apps available to them with the Standard tier
in order to minimize their backend development burden and accelerate solution delivery.
• Authentication: Drivers login to the FastRide app on their device using their Microsoft, Google, Twitter
or Facebook credentials, the federated login process being handled by Mobile Apps in conjunction with
the aforementioned identity providers.
• Notifications: Once logged in, the app registers with Mobile Apps, associating the driver’s identity with
the Notification Hub (associated with the Mobile App). In this way, Crazy Taxi dispatch can send broad-
cast notifications to all drivers, but still be able to send targeted Fare Alert messages to a particular driver.
By having Mobile Apps in place with Push Notifications, Crazy Taxi Cab Co. is well positioned in the future
to light up the ability to deliver a customer-oriented app that deliver push notifications to customers
informing them of events relevant to their pickup.
• Offline Data: For the driver’s iOS and Android devices, in the construction of the FastRide app, they
leveraged the native client Offline Data Sync functionality for synchronizing Fare Data when temporarily
disconnected from the cellular network. This Fare Data is stored using Tables in Mobile Apps, which
ultimately rests as relational tables in a SQL Database. This SQL Database also stores the driver profiles
(that associate social credentials with driver profile information).
• Back End Custom Services: When a driver accepts or declines a fare received via a push notification,
that message is sent using a Custom REST API hosted by Mobile Apps and built using ASP.NET Web API.
• Front-End Website: Dispatch uses a website hosted in Azure Websites to manage the taxi cab dispatch
process. The Notification Hub is configured so that only the dispatch website is allowed to send push
notifications
to the drivers (the FastRide app for drivers is Listen only).
• Monitoring: Crazy Taxi corporate IT monitors the health of the solution using the Dashboard for the
Mobile App or Website in the Azure Portal. To assist the IT team with visibility into the health of the
system, they should configure monitoring endpoints, again using the Azure Portal, on their website and
Mobile Apps and enable e-mail alerts should the Response Time and Uptime metrics for those fall below
values they deem acceptable.
• Scaling Configuration: They have configured Autoscale on their Mobile App, via the Scale tab in the
portal, to double the number of instances it uses on Friday and Saturday night in order to handle the
increased load, then return back to their normal instance count for the rest of the week.
• Backend Jobs: They have also created a Mobile Apps Scheduled Job that processes the Fare Data on
nightly basis to generate the data sets that power the Fare Reports. This data is stored in the same SQL
Database that stores all the other data used by the solution.
Preferred Solution Diagram
Before we start
1. Ensure that you are logged in to your Windows 10 lab virtual machine using the following credentials:
●● Username: Admin
●● Password: Pa55w.rd
2. Review Taskbar located at the bottom of your Windows 10 desktop. The Taskbar contains the icons for
the common applications you will use in the labs:
●● Microsoft Edge
●● File Explorer
●● Visual Studio Code1
●● Microsoft Azure Storage Explorer2
●● Bash on Ubuntu on Windows
●● Windows PowerShell
3. Note: You can also find shortcuts to these applications in the Start Menu.
1 https://code.visualstudio.com/
2 https://azure.microsoft.com/features/storage-explorer/
3 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#exercise-1-create-web-app
4 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-1-open-the-azure-portal
3. If prompted, authenticate with the user account account that has the owner role in the Azure sub-
scription you will be using in this lab.
5 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-2-open-cloud-shell
6 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-3-create-an-app-service-plan
2. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the Azure region you will use for the deployment (replace the place-
holder <Azure region> with the name of the Azure region to which you intend to deploy resources
in this lab):
LOCATION='<Azure region>'
3. At the Cloud Shell command prompt, type in the following command and press Enter to create the
resource group:
az group create --name $RESOURCE_GROUP_APP --location $LOCATION
4. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new App Service plan:
az appservice plan create --is-linux --name "AADesignLab0502-$LOCATION"
--resource-group $RESOURCE_GROUP_APP --location $LOCATION --sku B2
2. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new variable which value is a randomly generated string that you will use as the name of a new web
app:
WEBAPPNAME1=webapp05021$RANDOM$RANDOM
3. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new web app using a unique name:
az webapp create --name $WEBAPPNAME1 --plan AADesignLab0502-$LOCATION
--resource-group $RESOURCE_GROUP_APP --runtime "DOTNETCORE|2.1"
4. Note: In case the command fails due to duplicate web app name, re-run the last two steps until the
command completes successfully
5. Wait for the deployment to complete before you proceed to the next task.
7 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-4-create-a-web-app-instance
3. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the Azure region you will use for the deployment:
LOCATION=$(az group list --query "[?name == 'AADesignLab0502-RG'].location"
--output tsv)
4. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new variable which value is a randomly generated string that you will use as the name of a new web
app:
WEBAPPNAME2=webapp05022$RANDOM$RANDOM
8 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-5-view-deployment-results
9 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#exercise-2-deploy-web-app-code
10 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-1-deploy-code-with-a-web-app-extension-using-an-azure-resource-
manager-template-and-github
5. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new web app using a unique name:
az webapp create --name $WEBAPPNAME2 --plan AADesignLab0502-$LOCATION
--resource-group $RESOURCE_GROUP_APP --runtime "NODE|9.4"
6. Note: In case the command fails due to duplicate web app name, re-run the last two steps until the
command completes successfully
7. In the Cloud Shell pane, click the Upload/Download files icon and, in the drop-down menu, click
Upload.
8. In the Open dialog box, navigate to the \allfiles\AZ-301T03\Module_03\Labfiles\Starter\ folder,
select the github.json file, and click Open. The file contains the following Azure Resource Manager
template:
{
"$schema": "http://schemas.management.azure.com/schemas/2015-01-01/
deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string"
},
"repositoryUrl": {
"type": "string"
},
"branch": {
"type": "string",
"defaultValue": "master"
}
},
"resources": [
{
"apiVersion": "2015-08-01",
"type": "Microsoft.Web/sites",
"name": "[parameters('webAppName')]",
"location": "[resourceGroup().location]",
"properties": {},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('we-
bAppName'))]"
],
"properties": {
"RepoUrl": "[parameters('repositoryUrl')]",
"branch": "[parameters('branch')]",
"IsManualIntegration": true
}
}
]
}
]
}
9. In the Cloud Shell pane, click the Upload/Download files icon and, in the drop-down menu, click
Upload.
10. In the Open dialog box, navigate to the \allfiles\AZ-301T03\Module_01\Labfiles\Starter\ folder,
select the parameters.json file, and click Open. The file contains the following parameters for the
Azure Resource Manager template you uploaded previously:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploy-
mentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"value": "$WEBAPPNAME2"
},
"repositoryUrl": {
"value": "$REPOSITORY_URL"
},
"branch": {
"value": "master"
}
}
}
11. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the name of the GitHub repository hosting the web app code:
REPOSITORY_URL='https://github.com/Azure-Samples/nodejs-docs-hello-world'
12. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the name of the GitHub repository hosting the web app code and
which takes into account any special character the URL might include:
REPOSITORY_URL_REGEX="$(echo $REPOSITORY_URL | sed -e 's/\\/\\\\/g;
s/\//\\\//g; s/&/\\\&/g')"
13. Note: This is necessary because you will use the sed utility to insert this string into the Azure Resource
Manager template parameters file. Alternatively, you could simply open the file and enter the URL
string directly into the file.
14. At the Cloud Shell command prompt, type in the following command and press Enter to replace the
placeholder for the value of the webAppName parameter with the value of the $WEBAPPNAME2
variable in the parameters file:
sed -i.bak1 's/"$WEBAPPNAME2"/"'"$WEBAPPNAME2"'"/' ~/parameters.json
15. At the Cloud Shell command prompt, type in the following command and press Enter to replace the
placeholder for the value of the repositoryUrl parameter with the value of the $REPOSITORY_URL
variable in the parameters file:
sed -i.bak2 's/"$REPOSITORY_URL"/"'"$REPOSITORY_URL_REGEX"'"/' ~/parame-
ters.json
16. At the Cloud Shell command prompt, type in the following command and press Enter to verify that
the placeholders were successfully replaced in the parameters file:
cat ~/parameters.json
17. At the Cloud Shell command prompt, type in the following command and press Enter to deploy the
GitHub-resident web app code by using a local Azure Resource Manager template and a local param-
eters file:
az group deployment create --resource-group $RESOURCE_GROUP_APP --tem-
plate-file github.json --parameters @parameters.json
18. Wait for the deployment to complete before you proceed to the next task.
19. Note: The deployment should take about a minute.
11
12
11 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-2-view-deployment-results
12 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-3-deploy-code-with-a-docker-hub-container-image
2. At the Cloud Shell command prompt, type in the following command and press Enter to create a
variable which value designates the Azure region you will use for the deployment:
LOCATION=$(az group list --query "[?name == 'AADesignLab0502-RG'].location"
--output tsv)
3. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new variable which value is a randomly generated string that you will use as the name of a new web
app:
WEBAPPNAME3=webapp05023$RANDOM$RANDOM
4. At the Cloud Shell command prompt, type in the following command and press Enter to create a
new web app using a unique name:
az webapp create --name $WEBAPPNAME3 --plan AADesignLab0502-$LOCATION
--resource-group $RESOURCE_GROUP_CONTAINER --deployment-container-image
ghost
5. Note: In case the command fails due to duplicate web app name, re-run the last two steps until the
command completes successfully
6. Wait for the deployment to complete before you proceed to the next task.
7. Note: The deployment should take less than a minute.
8. Close the Cloud Shell pane.
13
13 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-4-view-deployment-results
14
14 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#exercise-3-deploy-a-function-app
15 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-1-deploy-a-function-app-with-code-using-an-azure-resource-manager-
template
11. Wait for the deployment to complete before you proceed to the next task.
12. Note: The deployment should take about a minute.
16
17
3. Verify that the output contains only the resource groups you created in this lab. These groups will be
deleted in the next task.
16 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-2-view-deployment-results-1
17 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#exercise-4-remove-lab-resources
18 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-1-open-cloud-shell
19
19 https://github.com/MicrosoftLearning/AZ-301-MicrosoftAzureArchitectDesign/blob/master/Instructions/AZ-301T03_Lab_Mod03_
Deploying%20Serverless%20Workloads%20to%20Azure.md#task-2-delete-resource-groups
Review Questions
Module 3 Review Questions
Serverless computing
Suggested Answer ↓
Web Apps are a fully managed and low friction PaaS offering to host your web application in the Azure
platform. The serverless Azure App Services include Web Apps, Mobile Apps, and APIs.
Serverless computing (Azure Functions)
Which Azure service provides serverless processing? What are the two models for using this service?
Suggested Answer ↓
Azure Functions are designed to make it faster to process events and distribute output to services that
interact with the functions. You can create Function Apps that use the App Service or Consumption
models.
Integration offerings
You are designing a solution that integrates several different applications and services. You plan to
implement an Azure Platform-as-a-Service (PaaS) solution.
Suggested Answer ↓
Azure provides API Management and Logic Apps as integration PaaS solutions. Azure API Management
helps organizations publish APIs to external partner and internal developers. Logic Apps provide work-
flows, designed using JOSN, that can connect various components of your application together using
minimal or no code.