Вы находитесь на странице: 1из 10

Lab Answer Key: Module 6: Planning and implementing storage,

backup, and recovery services

Lab: Planning and implementing Azure Storage


Exercise 1: Creating and configuring Azure Storage
Task 1: Create a storage account
1. Ensure that you are signed in to MIA-CL1 as Student with the password
Pa55w.rd and that the setup script that you ran in the previous demonstration
to prepare the environment has completed.

2. Start Microsoft Edge, and then browse to https://portal.azure.com. When


prompted, sign in by using the Microsoft account that is the Service
Administrator of your Microsoft Azure subscription.

3. In the hub menu, click + Create resource, and then click Storage.

4. On the Storage blade, click Storage account - blob, file, table, queue.

5. On the Create storage account blade, apply the following settings, and then click
Create:

• Name: a valid, unique name consisting of between 3 and 24 lower case


characters or digits

• Deployment model: Resource Manager

• Account kind: Storage (general purpose v1)

• Performance: Standard

• Replication: Locally-redundant storage (LRS)

• Secure transfer required: Disabled

• Subscription: the name of your Azure subscription

• Resource group: ensure that Create new is selected and, in the textbox below,
type 20533D0602-LabRG.

• Location: the same Azure region that you chose when running the provisioning
script at the beginning of this module

• Virtual networks (Preview): Disabled


• Pin to dashboard: clear the check box

6. Wait until the storage account is provisioned.

7. In the hub menu, click All services, and then, in the list of services, click
Storage accounts.

8. On the Storage accounts blade, click the storage account that you just created.

9. On the storage account blade, click the Blobs tile.

10. On the Blob service blade, click + Container in the toolbar.

11. In the New container section, specify the following settings, and then click OK:

• Name: asset-images

• Access type: Private (no anonymous access)

Task 2: Install AzCopy


1. In Microsoft Edge, open a new tab, and then browse to http://aka.ms/AzCopy.

2. In the Download and install AzCopy section, click the latest version of
AzCopy on Windows link.

3. When prompted, click Save. Wait until the download completes and then click
Run. This will automatically launch the setup wizard. Use the wizard to install
AzCopy with the default settings. During the setup, when prompted, in the User
Account Control dialog box, click Yes.

4. On the taskbar, right-click Windows PowerShell, and then click Run ISE as
Administrator. When prompted, in the User Account Control dialog box, click
Yes.

5. In the Administrator: Windows PowerShell ISE window, if the script pane is


not visible, click View and then, in the View menu, click Show Script Pane.

6. In the script pane, type Set-Location -Path 'C:\Program Files


(x86)\Microsoft SDKs\Azure\AzCopy' and then press the F5 key.

7. In the console pane, type .\AzCopy /? and then press Enter.

8. Scroll through the syntax information displayed in the console pane.

Task 3: Use AzCopy to upload blobs


1. In the Administrator: Windows PowerShell ISE window, in the script pane,
type:
.\AzCopy.exe /Dest:https://<storage-account-
name>.blob.core.windows.net/asset-images /destkey:<access-key>
/Source:E:\Labfiles\Lab06\Starter\asset-images
2. Switch to the Microsoft Edge window displaying the Azure portal, scroll back to
the blade for your storage account, and click Access keys.

3. On the access keys blade, click the Click to copy icon next to Storage account
name. If prompted to allow access to Clipboard, click Allow access.

4. Switch to the Administrator: Windows PowerShell ISE window and replace


the <storage-account-name> entry with the content of Clipboard.

5. Switch to the Microsoft Edge window and, on the access keys blade, click the
Click to copy icon next to key1.

6. Switch to the Administrator: Windows PowerShell ISE window and replace


the <access-key> entry with the content of Clipboard.

7. Press the F5 key to execute the command in the script pane.


Note: If you execute the command and it fails, make note of the error message and the directory in which
the journal files are located. Temporary data files are put into the journal file folder with the default path
“%LocalAppData%” and need to be deleted before running the command again.
8. Examine the output in the console pane and verify that the content of the
E:\Labfiles\Lab06\Starter\asset-images folder was copied to the Azure
Storage account container asset-images.

9. In the Azure portal, on the storage account blade, click Overview.

10. In the Services section of the blade, click the Blobs tile.

11. On the Blob service blade, click the asset-images container.

12. On the asset-images blade, verify that there are six new blobs.
Result: At the end of this exercise, you should have created a new Azure storage account with a container
named asset-images and copied files from your local computer to that container by using the AzCopy
utility.

Exercise 2: Using Azure File storage


Task 1: Create a file share and upload files
1. Switch to the Administrator: Windows PowerShell ISE window.

2. In the Windows PowerShell Integrated Scripting Environment (ISE), in the


console pane, type the following cmdlet and then press Enter:
Add-AzureRmAccount

3. In the sign-in windows that appears, sign in by using the Microsoft account that
is the Service Administrator of your Azure subscription.
4. If you have multiple subscriptions associated with your Microsoft account, to
identify the subscription in which you are going to create a virtual network,
type the following command, and then press Enter:
Get-AzureRmSubscription

5. Note the value of the Id property for each subscription in the output of the
previous command. To specify the subscription in which you are going to create
a virtual network, type the following commands, and then press Enter (replace
SubscriptionId with the actual SubscriptionId property of that subscription):
Set-AzureRmContext -SubscriptionId 'SubscriptionId'

6. Click File, and then click Open.

7. In the Open dialog box, browse to E:\Labfiles\Lab06\Starter\, click New-


20533D06FileShare.ps1, and then click Open.

8. In the script pane, in the $storageAccountName variable declaration at the


beginning, replace the <storage-account-name> value with the name of the
Azure storage account that you created in the previous exercise.

9. Review the script, noting that it:

• Sets the values of variables named s h a r e N a me∗¿ a n d∗¿ directoryName


for the file share and the directory to create in the Azure Storage account

• Uses the Get-AzureRmStorageAccountKey cmdlet to retrieve the access key


for your storage account.

• Uses the New-AzureStorageContext cmdlet to create a security context for


connections to the target storage account based on the key you retrieved

• Uses the New-AzureStorageShare cmdlet to create an Azure Storage account


file share

• Uses the New-AzureStorageDirectory cmdlet to create a directory in the share

• Sets the location of the folder hosting source files to be copied to the Azure
Storage file share directory

• Loops through the files in the source folder and uses the Set-
AzureStorageFileContent cmdlet to copy each of them the folder in the Azure
file share.

10. Save the script and then press the F5 key.

11. Observe the script as it runs, and then view the output. When you finish, close
Windows PowerShell ISE.
Task 2: Access a file share from an Azure VM
1. From the MIA-CL1 lab VM, in Microsoft Edge, on the Azure portal, click All
services, click Virtual machines.

2. On the Virtual machines blade, click ellipsis to the right of the 20533D0601-
vm1 entry and click Connect.

3. When prompted, click Save and then click Open.

4. If a Remote Desktop Connection warning message displays, select Don’t ask me


again for connections to this computer, and then click Connect.

5. In the Windows Security dialog box, type the following credentials, and then
click OK:

• User name: Student

• Password: Pa55w.rd1234

6. If another Remote Desktop Message displays, select the Don’t ask me again for
connections to this computer checkbox, and then click Yes.

7. If prompted in the Remote Desktop session whether to allow your PC to be


discoverable, click No.

8. Wait for the Server Manager window to open, then click Local Server, on the
Local Server page, click the On link next to the IE Enhanced Security
Configuration entry, click Off for Administrators, and then click OK.

9. In the 20533D0601-vm1 Remote Desktop window, click the Internet Explorer


icon on the taskbar. If prompted to set up Internet Explorer, ensure that the Use
recommended security, privacy, and compatibility settings option is
selected, and then click OK.

10. Browse to https://portal.azure.com, and then sign in by using the Microsoft


account that is the Service Administrator of your Azure subscription.

11. In the hub menu, click All services, and then click Storage accounts.

12. On the Storage accounts blade, click the storage account that you created in
the previous exercise, and then on the blade for your storage account, click the
Files tile.

13. On the File service blade, click assets.

14. On the assets blade, click Connect in the toolbar.

15. On the Connect blade, click the Click to Copy icon next to the code appearing in
the Connecting from Windows section. If prompted whether to allow the
webpage to access your Clipboard, click Allow access.
16. Click Start, right-click Windows PowerShell ISE, in the right-click menu, click
More and click Run as administrator.

17. In the Administrator: Windows PowerShell ISE window, if the script pane is
not visible, click View and then, in the View menu, click Show Script Pane.

18. In the script pane, paste the content of Clipboard.

19. In the command line you copied, replace [drive letter] with Z: (if it is not
already replaced).
Note: If your key (password) has a / in it, the copy to clipboard will escape this character and replace it
with \/. This will cause the command to fail. Correct the escaped characters or copy the key directly from
Azure.
20. Run the command by pressing the F5 key

21. Start File Explorer, click This PC, and verify that the command executed
successfully, resulting in creation of the Z: drive mapping.

22. Back in the Windows PowerShell ISE window, in the console pane, run the
following command to view the contents of the invoices folder on the Z: drive,
which is now mapped to the assets file share that you created in a previous
task:
Get-ChildItem -Path 'Z:\invoices'

23. Verify that invoice documents are listed.

24. Close the Windows PowerShell ISE window and Internet Explorer, and then
sign out of the Remote Desktop session to 20533D0601-vm1.
Result: At the end of this exercise, you should have created an Azure storage account file share named
assets that contains a folder named invoices with copies of invoice documents. You should have also
mapped a drive from an Azure VM to the file share.

Exercise 3: Protecting data with Azure Backup


Task 1: Create a recovery services vault
1. On the MIA-CL1, in the Azure portal displayed in Microsoft Edge, in the hub
menu, click + Create resource, on the New blade, click Storage, and, on the
Storage blade, click Backup and Site Recovery (OMS).

2. On the Recovery services vault blade, specify the following settings and click
Create:

• Name: vault20533D06

• Subscription: the name of your Azure subscription


• Resource group: ensure that Create new is selected and, in the textbox below,
type 20533D0603-LabRG

• Location: the same Azure region that you chose when running the provisioning
script at the beginning of this module

• Pin to dashboard: ensure that the check box is cleared

3. Wait until the vault is provisioned.

Task 2: Configure the vault for on-premises backup


1. In the hub menu, click All services. In the search text box, type Recovery
Services vaults and, in the list of results, click Recovery Services vaults.

2. On the Recovery Services vaults blade, click vault20533D06.

3. On the vault20533D06 blade, click + Backup.

4. On the Backup goal blade, specify the following settings:

• Where is your workload running?: On-premises

• What do you want to back up?: Files and folders

5. Click Prepare Infrastructure.

Task 3: Install and configure the Azure Recovery Services Agent


1. In the Azure portal, on the Prepare infrastructure blade, click the Download
Agent for Windows Server or Windows Client link.

2. When prompted, click Save. Once MARSAgentInstaller.exe finishes


downloading, click Run.

3. If prompted, in the User Access Control dialog box, click Yes. This will start
Microsoft Azure Recovery Services Agent Setup Wizard.

4. On the Installation Settings page of the Microsoft Azure Recovery Services


Agent Setup Wizard, click Next.

5. On the Proxy Configuration page of the Microsoft Azure Recovery Services


Agent Setup Wizard, click Next.

6. On the Installation page of the Microsoft Azure Recovery Services Agent


Setup Wizard, click Install.

7. Click Proceed to Registration. This will start Register Server Wizard.

8. Switch to Microsoft Edge displaying the Azure portal and, on the Prepare
infrastructure blade, click Download after you selected “Already downloaded
or using the latest Recovery Services Agent”.
9. When prompted, click Save. This will save the vault credentials file to your
Downloads folder.

10. Switch back to the Register Server Wizard and, on the Vault Identification
page, click Browse.

11. In the Select Vault Credentials dialog box, browse to the Downloads folder,
click the .VaultCredentials file you downloaded, and click Open.

12. Click Next.

13. On the Encryption Setting page of the Register Server Wizard, click
Generate Passphrase.

14. On the Encryption Setting page of the Register Server Wizard, next to the
Enter a location to save the passphrase, click Browse.

15. In the Browse For Folder dialog box, navigate to E:\Labfiles\Lab06\Starter\


and click OK.

16. Click Finish and wait for the registration to complete.

17. On the Server Registration page of the Register Server Wizard, ensure that
the Launch Microsoft Azure Recovery Services Agent checkbox is selected
and click Close. This will automatically open the Microsoft Azure Backup
console.

Task 4: Create a backup schedule


1. In the Microsoft Azure Backup console, in the Actions pane, click Schedule
Backup.

2. In the Schedule Backup Wizard, on the Getting started page, click Next.

3. On the Select Items to Backup page, click Add Items.

4. In the Select Items dialog box, expand **E:\Labfiles06*, select the following
folders, and then click OK:

• asset-images

• invoices

5. On the Select Items to Backup page, click Next.

6. On the Specify Backup Schedule page, ensure that the Day option is selected,
in the first drop-down list box below the At following times (Maximum
allowed is three times a day) box, select 4:30 AM, and then click Next.

7. On the Select Retention Policy page, accept the defaults, and then click Next.
8. On the Choose Initial Backup type page, accept the defaults, and then click
Next.

9. On the Confirmation page, click Finish. When the backup schedule is created,
click Close.

Task 5: Run a backup


1. In the Microsoft Azure Backup console, in the Actions pane, click Back Up
Now.

2. In the Back Up Now Wizard, on the Confirmation page, click Back Up.

3. When the backup is complete, click Close, and then close Microsoft Azure
Backup.

4. Switch to the Azure portal, navigate back to the Recovery Services vault blade
and click Backup items.

5. On the Backup items blade, click Azure Backup Agent.

6. On the Backup Items (Azure Backup Agent) blade, verify that there is an
entry referencing the E:\ drive of mia-cl1..

Task 6: Stop backups and delete the Azure Recovery services vault
1. On the Backup Items (Azure Backup Agent) blade, click the entry referencing
the E:\ drive of mia-cl1..

2. On the E:\ on mia-cl1. blade, click the mia-cl1. link (under the Computer Name
section).

3. On the mia-cl1. blade, click Delete.

4. On the Delete blade, in the TYPE THE SERVER NAME text box, type mia-cl1.
and click Delete.
Note: Don’t forget to add the dot at the end of the server name.
5. Navigate back to the recovery services vault blade and click Overview.

6. Click Delete. When prompted to confirm, click Yes.

Task 7: Remove the lab environment


1. On MIA-CL1, close all open windows without saving any files.

2. On the taskbar, right-click the Windows PowerShell icon, and then click Run
as Administrator. In the User Account Control dialog box, click Yes.

3. Type the following command, and then press Enter:


Remove-20533DEnvironment
4. When prompted, sign in by using the Microsoft account that is the Service
Administrator of your Azure subscription.

5. If you have multiple Azure subscriptions, select the one you want the script to
target.

6. If prompted, specify the current lab number.

7. When prompted for confirmation, type y.

8. Start Microsoft Edge, browse to the Azure portal at https://portal.azure.com,


and sign in by using the Microsoft account that is the Service Administrator of
your Azure subscription.

9. In the Azure portal, click Edit dashboard.

10. Right-click unoccupied area of the dashboard and, in the right-click menu, click
Reset to default state. When prompted to confirm, click Yes.

11. Click Done customizing.

12. Close all open windows.


Result: At the end of this exercise, you should have created an Azure Recovery Services vault in your
subscription, downloaded vault credentials, and installed the Azure Recovery Services agent on the MIA-
CL1 lab computer. You should have backed up the contents of the asset-images and invoices folders to the
Recovery Services vault.

©2016 Microsoft Corporation. All rights reserved.


The text in this document is available under the Creative Commons Attribution 3.0
License, additional terms may apply. All other content contained in this document
(including, without limitation, trademarks, logos, images, etc.) are not included
within the Creative Commons license grant. This document does not provide you
with any legal rights to any intellectual property in any Microsoft product. You may
copy and use this document for your internal, reference purposes.
This document is provided “as-is.” Information and views expressed in this
document, including URL and other Internet Web site references, may change
without notice. You bear the risk of using it. Some examples are for illustration only
and are fictitious. No real association is intended or inferred. Microsoft makes no
warranties, express or implied, with respect to the information provided here.

Вам также может понравиться