Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
Lab 2: Creating an Azure Virtual Machine for Development and Testing
a.
b.
Sign in to the Azure Portal
1. On the Start screen, click the Internet Explorer tile.
2. Go to ( https://portal.azure.com ).
3. Enter the email address of your Microsoft account. Click Next. 4. Enter the password for your Microsoft account.
5. Click Sign In.
Create a Resource Group
Estimation time for this Section B: 10 minutes
In the navigation pane on the left side of the Azure Portal, click All services.
In the All services blade that displays, click Resource groups.
In the Resource groups blade that displays, view your list of resource groups.
At the top of the Resource groups blade, click the Add button.
In the Resource group blade, perform the following steps:
a) In the Resource group name dialog box, provide the value
b) In the Resource group location list, select the region that is closest to your current location. In the Resource group blade, click Create.
Level 3 Asia Pacific University of Technology & Innovation Page 1 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
c.
Create a Virtual Network
Estimation time for this Section C: 10 minutes
In the navigation pane on the left side of the Azure Portal, click All services.
In the All services blade that displays, click Virtual networks.
In the Virtual networks blade that displays, view your list of virtual network instances.
At the top of the Virtual networks blade, click the Add button. In the Create virtual network blade, perform the following steps:
a) In the Name dialog box, provide the value vnettp012345.
b) Ensure that the Address space field has the value 10.0.0.0/16.
c) In the Resource group section, select the Use existing option.
d) In the Resource group section, locate the dialog box and provide the value tp012345.
e) In the Location list, select the region that is closest to your current location.
f) Within the Subnet section, in the Name field, provide the value Apps.
g) Within the Subnet section, ensure that the Address range field has the value 10.0.0.0/24.
Click the Create button.
Summary
After completing this exercise, you will have a new virtual network and resource group in Azure.
Level 3 Asia Pacific University of Technology & Innovation Page 2 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
d.
Creating a Development Virtual Machine
Estimation time for this Section D: 50 Minutes
1.
Create a Storage Account
In the navigation pane on the left side of the Azure Portal, click All services.
In the All services blade that displays, click Storage Accounts.
In the Storage accounts blade that displays, view your list of Storage instances. At the top of the Storage accounts blade, click the Add button.
In the Create storage account blade that displays, perform the following steps:
a) In the Name field, provide the value stortp012345[your name in lowercase here].
b) In the Deployment model section, ensure that the Resource manager option is selected.
c) In the Account kind list, ensure that the Storage (general purpose v1) option is selected.
d) In the Location list, select the region closest to your current location.
e) Click on the Replication list and select the Locally-redundant storage (LRS) option.
f) In the Performance section, ensure that the Standard option is selected.
g) In the Secure transfer required section, ensure that the Disabled option is selected.
h) In the Resource group section, select the Use existing option.
i) In the Resource group section, locate the dialog box and provide the value tp0123456.
Click the Create button.
Note: Wait for Azure to finish creating the storage account prior to moving forward with the lab. You will receive a notification when the Storage Account is created and you will see the Storage Account’s blade.
Level 3
Asia Pacific University of Technology & Innovation Page 3 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
Level 3 Asia Pacific University of Technology & Innovation Page 4 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
2. Create a Virtual Machine.
In the navigation pane on the left side of the Azure Portal, click All services. In the All services blade that displays, click Virtual machines.
In the Virtual machines blade that displays, view your list of Virtual Machine instances.
At the top of the Virtual machines blade, click the Add button.
In the Create virtual machine blade that displays, click Basics and perform the
following steps:
a) In the Name dialog box, provide the value vmtp012345.
b) In the VM disk type list, select the value standard HDD.
c) In the User Name dialog box, provide the value tp012345.
d) In the Password and Confirm Password dialog boxes, provide the value AzurePa$$w0rd
e) In the Resource Group section, locate the Use existing option, and then select the tp012345
resource group.
f) In the Location list, select the region closest to your current location.
g) In the Public Inbound Ports, select Allowed Selected Ports, e.g. HTTP, HTTPS, SSH, RDP.
h) Click the OK button.
In the Create Virtual Machine blade, click Size and perform the following steps:
a) Locate the search field at the top of the blade and then enter the value DS.
b) Locate and select the Standard D1_v2 option.
c) Click the Select button.
d) Under the Use unmanaged disks section, select the No option
In the Create Virtual Machine blade, click Networking & Management Sections and perform the following steps:
a) Click the Virtual Network section and then select vnettp012345.
b) Click the Subnet section and then select Apps.
c) Leave default values for Public IP Address, Network Security Group (firewall),
Extensions and High Availability.
d) In the Enable auto-shutdown section, select the Off option and configure a shutdown time
that is after business hours in your location.
e) Under the Boot diagnostics section, select the Disabled option.
f) Under the Guest OS diagnostics section, select the Disabled option.
g) Scroll down and click OK.
In the Create Virtual Machine blade, click Summary and then click Create to create the virtual machine using your specified configuration.
Note: The creation of a new virtual machine can take anywhere between 10 to 15 minutes. You will see a notification on the Dashboard (home screen) when your virtual machine is created and running.
Look at next page for the complete details for this section.
Level 3
Asia Pacific University of Technology & Innovation Page 5 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
Level 3 Asia Pacific University of Technology & Innovation Page 6 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
Level 3 Asia Pacific University of Technology & Innovation Page 7 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
Select the newly created virtual machine from your Dashboard.
Select the Overview option to return to the vmtp012345 blade.
Level 3 Asia Pacific University of Technology & Innovation Page 8 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
Click Connect at the top of the screen.
In the Connect to virtual machine dialog that appears, click the Download RDP
File button.
In the Internet Explorer download dialog box, click Open.
In the Remote Desktop Connection dialog box, perform the following steps:
a) Click Don’t ask me again for connections to this computer to prevent this dialog box from displaying again.
b) Click Connect.
In the Windows Security dialog box, perform the following steps:
a) Click the More choices located at the bottom of the dialog box.
b) Click Use a different account that appears.
c) For the User name dialog box, provide the value, Student.
Note: If you computer is on a domain, you may need to add a backslash before the username
to “escape” the domain.
d) For the Password dialog box, provide the value, AzurePa$$w0rd.
e) Click the OK button.
When you are prompted to allow your network connection to discover external devices, click Yes.
Level 3
Asia Pacific University of Technology & Innovation Page 9 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
Level 3 Asia Pacific University of Technology & Innovation Page 10 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
e. Install IIS (Web Server) plus Web Management Service and ASP.NET 4.6
Estimation time for this Section E: 10 minutes
1. 2.
Open the Server Manager Dashboard Choose 2 Add roles and features
Accept the defaults and press Next three times to progress to the Server Roles section.
Select Web Server (IIS)
When prompted, confirm the additional installation of IIS Management Console Asia Pacific University of Technology & Innovation Page 11 of 18
3. 4.
Level 3
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
5. Press Next three times to progress to the Web Server Role (IIS) –> Roles Services section
6. Select Management Service, which is required to enable Web Deploy (through port 8172). When prompted, confirm the additional installation of ASP.NET 4.6.
7. Select Next to confirm the configuration, then Install to complete IIS setup.
Once installation completes:
IIS is installed and running with internal firewall rule created for port 80.
Web Management Service is installed with internal firewall rule created for port 8172.
[!Note]
Corresponding Firewall ports must be opened in the Azure portal before traffic can be routed to this VM.
Level 3 Asia Pacific University of Technology & Innovation Page 12 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
f. Install Web Deploy
Estimation time for this Section F: 10 minutes
1.
Disable IE Enhanced Security Configuration.
On the Start screen, click the Server Manager tile.
In the navigation pane on the left side, click Local Server.
In the Properties field, click the IE Enhanced Security Configuration option that is currently set to Off.
In the Internet Explorer Enhanced Security Configuration dialog box, perform the following steps:
a) Under Administrators, select Off.
b) Under Users, select Off.
c) Click the OK button.
2.
Download and Install Web Deploy.
Launch Internet Explorer.
Accept default security settings.
Download WebDeploy_amd64_en-US.msi from https://www.microsoft.com/en- us/download/details.aspx?id=4148
Allow pop-ups and Run the downloaded MSI
Follow installation steps for Web Deploy
Choose Complete option to install all components
Once Web Deploy is installed, open the Web Management Service from the IIS Manager and
start the service. Also, set the service to automatic startup.
Level 3 Asia Pacific University of Technology & Innovation Page 13 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
Now that the VM is set up to receive requests to the Web Server and the Web Management Service, the corresponding ports must be opened in the Azure portal.
Level 3 Asia Pacific University of Technology & Innovation Page 14 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
g.
Configure inbound firewall rules in the Azure portal
Estimation time for this Section G: 5 minutes
1. 2. 3.
Log in to the Azure portal
Open the VM and select the Networking section.
Select Add inbound port rule to create two new firewall entries.
a)
http – Port 80 (Priority 100)
b)
WebDeploy – Port 8172 (Priority 1010)
Level 3
Asia Pacific University of Technology & Innovation
Page 15 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
h.
Set up DNS name for the VM
Estimation time for this Section H: 5 minutes
To use the in-built web publishing wizard in Visual Studio, the virtual machine must be configured with a DNS name.
1. From the Azure portal, navigate to the Overview page of your virtual machine.
2. Under DNS name, click Configure
3. Provide a globally unique DNS name. (A green tick appears when the name is validated.)
4. Click Save to save the configuration.
Publish a web application from Visual Studio
Estimation time for this Section H: 10 minutes
1. Open your web app solution or create a new project in Visual Studio 2017.
2. Right-click the project in Solution Explorer and choose Publish…
3. Find Azure Virtual Machines and click on the Browse… button.
4. Choose the appropriate account (with Azure subscription connected to your
virtual machine).
a) If you’re signed in to Visual Studio, the account list is populated with all your
authenticated accounts.
b) If you are not signed in, or if the account you need is not listed, choose “Add an
account…” and follow the prompts to log in.
5. Select the appropriate VM from the list of Existing Virtual Machines.
6. Click OK to next step.
i.
Level 3
Asia Pacific University of Technology & Innovation Page 16 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
7. Before click the Publish.. button, open the Web Deploy.pubxml and attached the below code into xml file and save the file.
8. Click the Publish button to begin the publishing.
9. When prompted for credentials, supply the username and password of a user account on the target VM that is configured with publishing rights (typically the admin username and password used when creating the VM).
Level 3
Asia Pacific University of Technology & Innovation Page 17 of 18
Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Creating an Azure Virtual Machine for Development and Testing
10. Accept the security certificate.
11. Watch the Output window to check the progress of the publish operation.
12. If publishing is successful, a browser launches to open the URL of the newly published site.
13. Success! You have now successfully published your web app to an Azure virtual machine.
After completing this exercise, you learnt how to setup a virtual machine for hosting an Asp .NET website.
Summary
Level 3 Asia Pacific University of Technology & Innovation Page 18 of 18