100% found this document useful (2 votes)
1K views22 pages

Project - Automating Workloads With ARM Templates: Exercise 1: Define The Network

The document discusses automating workloads with ARM templates at Rand Enterprises. It describes defining a networking architecture, creating a storage account and VM, and implementing Azure CDN for image storage. The exercises guide creating these resources with ARM templates to test infrastructure as code.

Uploaded by

Avik Mandal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
1K views22 pages

Project - Automating Workloads With ARM Templates: Exercise 1: Define The Network

The document discusses automating workloads with ARM templates at Rand Enterprises. It describes defining a networking architecture, creating a storage account and VM, and implementing Azure CDN for image storage. The exercises guide creating these resources with ARM templates to test infrastructure as code.

Uploaded by

Avik Mandal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Project - Automating Workloads

with ARM Templates


Business Scenario
The Rand Enterprises Corporation’s wants to test ARM template to bring infrastructure as code
into practice. They have decided to work on project RandEnt to verify the functionality.

The operations team at Rand decides to define entire networking architecture using ARM
template, once that’s in place they intended to create the storage account along with virtual
machine housing their application.

As Rand Enterprises works extensively on delivering Image based content for their global
audience, they are seeking to improve the performance on that aspect. To facilitate the same,
they have decided to introduce Azure CDN of Standard_Akamai SKU.

Expectation of the operation team is to Rather than deploying resources in Azure


independently, they should leverage Azure ARM templates to deploy and provision all resources
in templatize format.

Overview
The main tasks for this exercise are as follows:
1. Define the network
2. Extend that with Compute & Storage
3. Create the Storage account for Images & implement CDN

Exercise 1: Define the network


Create a virtual network template using Visual Studio and deploy it to your Azure
subscription.

Task 1: Deploy a virtual network with a template


1. Log in to the Azure portal using subscription credentials - Azure portal
2. Open Visual Studio. The shortcut should be available on the desktop.
3. Choose File, New Project, then choose Cloud, and then Azure Resource
Group.

4. Name the project RandEntARM and specify E:\Setup-Provision for the location

and click OK.


5. On the Select Azure Template dialog box choose the Blank Template and
click OK. Scroll down to the end to select this option.
6. In the Solution Explorer open the azuredeploy.json.

7. The file should contain four different sections: parameters, variables,


resources, and outputs. On the left side a new window called JSON Outline
should have been opened as well. If this was not the case, go to the View
menu->Other Windows and choose JSON Outline. The window should look
like this:

8. On the JSON Outline window click the Add Resource button in the upper-
left corner, or right-click the resources and choose Add New Resource.

9. On the Add Resource dialog box choose Virtual Network, enter


RandEntVnet in the Name field, and click Add.
10.Go to the azuredeploy.json file, and inspect its content. Review the
variables section. It should look like this:
"variables": {
" RndEntVnetVnetPrefix": "10.0.0.0/16",
" RndEntVnetSubnet1Name": "Subnet-1",
"RndEntVnetSubnet1Prefix": "10.0.0.0/24",
"RndEntVnetSubnet2Name": "Subnet-2",
"RndEntVnetSubnet2Prefix": "10.0.1.0/24"
}

11.Change the name of Subnet-1 to FrontEndNet, and the name of Subnet-2


to DatabaseNet.
" RndEntVVnetSubnet1Name": "FrontEndNet",
" RndEntVnetSubnet2Name": "DatabaseNet",

12.Deploy the template by right-clicking the RndEntARM project and choosing


Deploy->New.
13.If you did not log on to your Microsoft Azure account already, you will be
asked to do so now.
14.First fill in the email address associated with the Azure account and then click
Continue.
15.Second, you might have to choose between a Work/School account, or
Microsoft account. Microsoft account refers to a LiveId account, so depending
on what kind of account you have, you should choose one or the other.

16.Enter your password and click Sign In.


17.If you have several subscriptions, choose the one that you want your VNet to
be deployed to, and on the Resource Group choose Create New.
18.On the Create Resource Group dialog box accept the default value for the
name; and for the location, choose the closest location to you, and click
Create.
19.When you are back on the Deploy to Resource Group dialog box, click Deploy.
After about a minute, your virtual network will be deployed to Azure.
20.View the created resource group and virtual network in the Azure
Management Portal by clicking the Resource Groups button and clicking the
name of your resource group.

Summary
In this exercise, team has created a new virtual network with two different subnets.
To verify this, log on to the Microsoft Azure portal and go to Virtual Networks.
Your new network should be listed there.
Exercise 2: Extend with Compute
In this Exercise team will continue the work they started in the previous task by
creating a storage account and adding virtual machine for the web application.

Task 1: Add an Azure Storage Account


1. On the JSON Outline window click the Add Resource button in the upper-left
corner, or right-click the resources and choose Add New Resource.

2. Add a new Storage Account resource to the template named rndent


Task 2: Add a virtual machine
1. Add a new Windows virtual machine called RNDEntVM and choose rndent as
the Storage account and FrontEndNet subnet as the Virtual network/subnet.
The FrontEndNet is the value of RndEntVnetSubnet1Name variable.

2. A Network Interface Card called RNDEntVMNic was automatically added to


the configuration when the virtual machine resource was added to connect
the virtual machine to the virtual network. Add a public IP address called
RndEntPublicIP to the RNDEntVMNic. This will allow you to connect to the
machine using Remote Desktop Client, or to access the web server.
3. Save and close the file and go back to the azuredeploy.json template file.

4. Add a new parameter to the end of the parameters section of the


azuredeploy.json file.

5. In the “variables” section change the value of RNDEntVMVmSize to "


Standard_D2_v2"
Task 3: Execute
1. Create a new deployment again to the same resource group as the previous
exercise. Ensure you click New Deployment to preserve your deployment
history.
On the Deploy to Resource Group dialog box, click Edit Parameters and
populate the empty values.

 RndEntPublicIPDnsName: Choose a unique looking DNS name


 RNDEntVMName: armapp
 RNDEntVMAdminUserName: demouser
 RNDEntVMAdminPassword: demo@pass1
click Deploy.

2. Launch the Azure Preview Portal and navigate to the resource group you
deployed to. Click the virtual machine for the web server and then click the
public IP.

3. Copy the DNS Name and navigate to it in the browser.


Exercise 3: Create the Storage
account for Images & implement
CDN
In this Exercise team will continue the work they started in the previous task by
creating a storage account and implementing Azure CDN for that.

Task 1: Add an Azure Storage Account


1. On the JSON Outline window click the Add Resource button in the upper-left
corner, or right-click the resources and choose Add New Resource.

2. Add a new Storage Account resource to the template named rndimg


Task 2: Add the CDN Profile
1. On the JSON Outline window click the Add Resource button in the upper-
left corner, or right-click the resources and choose Add New Resource.

2. Add CDN Profile


Task 2: Add CDN EndPoint
1. On the JSON Outline window click the Add Resource button in the upper-
left corner, or right-click the resources and choose Add New Resource.

2. Create a new CDN Endpoint


3. Remove the originUrl from parameter section (right click and delete)-
4. Update the sku to “Standard_Akamai”

5. Update the properties and origin sections-


Final Result-

You might also like