In this IT Pro Challenge, learners will understand how to create an Azure Storage Account and add and configure a new connection string for a Web Application using the Azure portal. Learners will use a test application to verify that the Web Application loaded rows in a Storage and table and also read those rows. Learners will use the Azure Command Line Interface (CLI) to verify that logging is active and to download the log file(s). The skills acquired in this lab are useful for careers as a network or system administrator.
The scenario for this virtual lab is that you are a system administrator, and your company is migrating its document processing system from their on-premise data center to Azure. Your job is to create an Azure Storage Table that will store the document processing history. To do this, you need to create an Azure Storage Account, create an Azure Storage Table within that Storage Account, and activate logging. Then, you need to add a connection string for the Storage Account to a Web Application (provided with the lab). As a proof of concept, you will test the Storage Table you create with the Web App and verify that activity is being logged by viewing the $logs file.
Create a Storage Account
To begin this virtual lab, you first need to sign in to the Azure portal and create an Azure storage account. Then you will add a Storage Table (history) to that storage account, navigate to the Diagnostics logs window of the blade for a provided storage account, and activate read and write logging for the history Storage Table under Table properties.
Update the Web App
Next, you will navigate to the Access Keys page of the storage account that you created in the previous step and copy the connection string for the key1 Access Key. Then you will navigate to the provided Web App blade, open the Application settings page, and add/configure a new connection string (storageConnection). This new connection string is now part of the Web App and has the value of the Storage Account connection string.
Test the Storage Table
Finally, you will test the Storage Table you created and configured (history) by opening a test web page that is provided with the lab. You will load the Storage Table, and you should see that the Web App loaded rows to the Storage Table. You will then verify the Storage Table; you should see that the Web App has read rows from the Storage Table.
Then, you will go back to the Azure portal, launch a Cloud Shell session, and choose Bash (Linux) as the shell type. You will then use the advanced settings to verify that the existing Resource group and Storage account are selected. Then you will create a new File share (bash) and use the following Azure Command Line Interface (CLI) command to verify that logging is active for the Storage Account: key=$(az storage account keys list -n [Storage Account name] -g [resource group name] --query "[*] | .value") az storage container show --account-name [Storage Account name] --account-key $[key name] --name "$logs"
NOTE: Storage Account logs are written to a container named $logs, which is hidden unless you specifically identify it on the CLI.
Finally, you will download the Storage Account log file(s) by running the az storage blob download-batch --destination . --source "$logs" --account-name [Storage Account name] --account-key $[key name] command. If you were successful, you should see log data in the $logs file.
By taking this virtual lab, you will learn how to provision an Azure Storage Account, create a table in that Storage Account, update a Web Application to use a new connection string that works with the Storage Account, and test the table with the custom Web app by viewing the $logs file.
See the full benefits of our immersive learning experience with interactive courses and guided career paths.