Sunteți pe pagina 1din 7

20533 - Module 1, Lab Answer Key

Module 1
Lab: Introduction to Azure
Scenario
A. Datum is investigating the potential for Azure to host IT infrastructure and application
services. You have been tasked with exploring the Azure environment and familiarizing
yourself with its management tools so that you can perform simple demonstrations during a
presentation on Azure to the board of directors.
Exercise 1: Using Azure Portals
Task 1: Use the Full Azure Management Portal
1. Ensure that the 20533B-MIA-CL1 virtual machines is running in "Learn on Demand", and then log on to 20533BMIA-CL1 as Student with the password Pa$$w0rd.
2. Start Internet Explorer, browse to http://manage.windowsazure.com, (the Classic Portal) and sign in using the
Microsoft account that is associated with your Azure subscription. (NOTE: ignore any links or references to the "new"
portal)
3. In the pane on the left, click WEB APP. Then at the bottom of the websites page, click NEW, and click CUSTOM
CREATE.

4.

In the Create Web App dialog box, apply the following settings and click the Next icon.
URL: A unique valid name
WEB HOSTING PLAN: Create new web hosting plan
REGION: The region closest to your current location
DATABASE: Create a free 20 MB SQL database
DB CONNECTION STRING NAME: DefaultConnection
Publish from source control: Clear

5.

On the Specify database settings page, apply the following settings and click the Complete icon:
NAME: AssetsDB
SERVER: New SQL database server
SERVER LOGIN NAME: Student
SERVER LOGIN PASSWORD: Pa$$w0rd
CONFIRM PASSWORD: Pa$$w0rd
REGION: The same region you chose for the website
CONFIGURE ADVANCED DATABASE SETTINGS: Clear

6. Wait for the new website to be created and its status to change to Running. Then in the pane on the left click SQL
DATABASES and verify that the AssetsDB database you specified has also been created.
7. Click the name column of the AssetsDB database, and then in the assetsdb page, click the DASHBOARD tab and
view the summary information there.

Task 2: Use the New Azure Preview Portal

1. Open a new tab in Internet Explorer. Go to portal.azure.com (the new Azure portal)
2. When the new portal is loaded, view the tiles in the Startboard, noting the service health of the Azure datacenters and
the billing status for your subscription.

3. In the hub menu, click BROWSE and then click Resource Groups.
4. In the Resource groups blade, note the resource groups that were created automatically for the website and SQL
database you created in the previous task. These should have names similar to Default-SQL-SelectedRegion and DefaultWeb-SelectedRegion.

5. Click the Default-SQL-SelectedRegion resource group and verify that it contains the AssetsDB database you created
previously.
6. In the hub menu, click NEW, and then in the search bar type "storage".
7.
8.

Your goal will be to create a new storage account


click Storage Account, select the "classic" model and then click Create.

9. In the Storage account blade, enter the following settings and click Create:
STORAGE: A valid unique name
PRICING TIER: Standard-GRS
RESOURCE GROUP: Default-SQL-SelectedRegion
SUBSCRIPTION: Your subscription
LOCATION: The same region as your website and SQL database
DIAGNOSTICS: Not configured
Add to Startboard: Clear
10. In the hub menu, click NOTIFICATIONS, and view the progress of the Creating Storage task. This may take a few
minutes.
11. When the storage account has been created, close the Notifications pane. Then in the hub menu, click BROWSE,
click Resource Groups, and in the Resource groups blade, click the Default-SQL-SelectedRegion resource group and
verify that this resource group now contains both the AssetsDB database and the new storage account you just created.
12. In Internet Explorer, switch to the tab containing the full Azure portal and in the pane on the left, click the ALL
ITEMS icon. Then refresh the page and note that the storage account you created in the preview portal is listed in the all
items page.

Task 3: Manage Your Azure Subscription


1.

At the top-right of the Microsoft Azure classic portal, click "credit status".

2.
3.

Click "view more details"


Challenge > Find subscription details in the new portal

Exercise 2: Using Azure PowerShell


Task 1: Connect PowerShell to Your Azure Subscription
1. On the taskbar, right-click Microsoft Azure PowerShell and click Run ISE as Administrator. Click Yes when
prompted.

2. In the PowerShell ISE, in the command prompt pane, enter the following command to add an Azure account to the
local PowerShell environment:
Add-AzureAccount

3. When prompted, sign in using the Microsoft account associated with your Azure subscription.
4. In the PowerShell ISE, in the command prompt pane, enter the following command to view the Azure accounts in
your local PowerShell environment, and verify that your account is listed:
Get-AzureAccount

5. Enter the following command to view the subscriptions that are connected to the local PowerShell session, and verify
that your subscription is listed.
Get-AzureSubscription

Task 2: Manage Azure Services


1.
2.
3.

In the Windows PowerShell ISE, click File and then click Open.
In the Open dialog, browse to D:\Labfiles\Lab01\Starter, click ExampleCommands.ps1 and then click Open.
In the Script pane, locate and select the following code:

<# Insert a command that gets all storage accounts here#>

4.

Replace the selected code with the following code:

Get-AzureStorageAccount

5.

Locate and select the following code:

<#Render the storage account name here#>

6.

Replace the selected code with the following code:

$store.StorageAccountName

7.

Locate and select the following code:

<#Render the status of the primary replica here#>

8.

Replace the selected code with the following code:

$store.StatusOfPrimary

9. Select the entire foreach statement that you edited.


10. On the toolbar, click the Run Selection button and wait for the script and its results to be displayed in the command
prompt pane. The results should list the name and status of the storage account you created in the previous exercise.
11. In the Script pane, locate and select the following code:
<#Insert a command that gets all websites here#>

12. Replace the selected code with the following code:


Get-AzureWebsite

13. Locate and select the following code:


<#Render the website name here#>

14. Replace the selected code with the following code:


$web.Name

15. Locate and select the following code:


<#Render the website state here#>

16. Replace the selected code with the following code:


$web.State

17. Select the entire foreach statement that you edited.


18. On the toolbar, click the Run Selection button and wait for the script and its results to be displayed in the command
prompt pane. The results should list the name and state of the website.
19. In the Script pane, locate and select the following code:
<#Insert a command that gets all database servers here#>

20. Replace the selected code with the following code:


Get-AzureSqlDatabaseServer

21. Locate and select the following code:


<#Insert a command that gets all databases for the current $sql server here#>

22. Replace the selected code with the following code:


Get-AzureSqlDatabase ServerName $sql.ServerName

23. Select the entire foreach statement that you edited.


24. On the toolbar, click the Run Selection button and wait for the script and its results to be displayed in the command
prompt pane. The results should list the name of each database server and the name and size of each database.
25. In the command prompt pane, enter cls and press Enter to clear the screen.

Task 3: Manage Resource Groups


1.

In the Windows PowerShell ISE, in the Console pane, type the following command, and then press Enter:

Switch-AzureMode Name AzureResourceManager

2.

In the Script pane, locate and select the following code:

<#Insert a command that gets all resource groups here#>

3.

Replace the selected code with the following code:

Get-AzureResourceGroup

4. Select the entire foreach statement that you edited.


5. On the toolbar, click the Run Selection button and wait for the script and its results to be displayed in the command
prompt pane. The results should list all the resource groups in your subscription.
6. Close the Windows PowerShell ISE without saving any files.

Task 4: Reset the Environment

1. On the taskbar, right-click Microsoft Azure PowerShell, and then click Run as administrator. In the User Account
Control dialog, click Yes.
2. Type the following command, and then press Enter:
Reset-Azure

3. When prompted, sign in using the Microsoft account associated with your Azure subscription.
Note: This script may remove Azure services in your subscription. It is therefore recommended that you use an Azure trial
pass that was provisioned specifically for this course, and not your own Azure account.
The script will take 5-10 minutes to reset your Microsoft Azure environment, ready for the next lab.
The script removes all storage, VMs, virtual networks, cloud services, and resource groups.

Important: The script may not be able to get exclusive access to a storage account to
delete it (you will see an error, if this occurs). If you find objects remaining after the reset
script is complete, you can re-run Reset-Azure script, or use the full Azure Management
Portal to manually delete all the objects in your Azure subscription, with the exception of the
default directory.

S-ar putea să vă placă și