Book Image

Implementing Microsoft Azure Architect Technologies: AZ-303 Exam Prep and Beyond - Second Edition

By : Brett Hargreaves, Sjoukje Zaal
Book Image

Implementing Microsoft Azure Architect Technologies: AZ-303 Exam Prep and Beyond - Second Edition

By: Brett Hargreaves, Sjoukje Zaal

Overview of this book

From designing solutions on Azure to configuring and managing virtual networks, the AZ-303 certification validates your knowledge and skills for all this and much more. Whether you want to take the certification exam or gain hands-on experience in administering, developing, and architecting Azure solutions, this study guide will help you get started. Divided into four modules, this book systematically takes you through the wide range of concepts and features covered in the AZ-303 exam. The first module demonstrates how to implement and monitor infrastructure. You'll develop the skills required to deploy and manage core Azure components such as virtual machines, networking, storage, and Active Directory (AD). As you progress, you'll build on that knowledge and learn how to create resilient and secure applications before moving on to working with web apps, functions, and containers. The final module will get you up to speed with data platforms such as SQL and Cosmos DB, including how to configure the different high availability options. Finally, you'll solve mock tests and assess yourself with the answers provided to get ready to take the exam with confidence. By the end of this book, you'll have learned the concepts and techniques you need to know to prepare for the AZ-303 exam and design effective solutions on Microsoft Azure.
Table of Contents (25 chapters)
1
Section 1: Implement and Monitor Azure Infrastructure
10
Section 2: Implement Management and Security Solutions
14
Section 3: Implement Solutions for Apps
18
Section 4: Implement and Manage Data Platforms
21
Chapter 17: Mock Exam Questions
22
Chapter 18: Mock Exam Answers

Utilizing log search query functions

Azure Monitor is now integrated with the features and capabilities that Log Analytics was offering. This also includes creating search queries across the different logs and metrics by using the Kusto Query Language.

To retrieve any type of data from Azure Monitor, a query is required. Whether you are configuring an alert rule, analyzing data in the Azure portal, retrieving data using the Azure Monitor Logs API, or being notified of a particular condition, a query is used.

The following list provides an overview of all of the different ways queries are used by Azure Monitor:

  • Portal: From the Azure portal, interactive analysis of log data can be performed. There, you can create and edit queries and analyze the results in a variety of formats and visualizations.
  • Dashboards: The results of a query can be pinned to a dashboard. This way, results can be visualized and shared with other users.
  • Views: By using the View Designer in Azure Monitor, you can create custom views of your data. This data is provided by queries as well.
  • Alert rules: Alert rules are also made up of queries.
  • Export: Exports of data to Excel or Power BI are created with queries. The query defines the data to export.
  • Azure Monitor Logs API: The Azure Monitor Logs API allows any REST API client to retrieve log data from the workspace. The API request includes a query to retrieve the data.
  • PowerShell: You can run a PowerShell script from command line or an Azure Automation runbook that uses Get-AzOperationalInsightsSearchResults to retrieve log data from Azure Monitor. You need to create a query for this cmdlet to retrieve the data.

In the following section, we are going to create some queries to retrieve data from the logs in Azure Monitor.

Querying logs in Azure Monitor

To query logs in Azure Monitor, perform the following steps:

  1. Navigate to the Azure portal by opening https://portal.azure.com.
  2. In the left-hand menu, select Monitor to open the Azure Monitor overview blade. Under Insights, select More. This will open the Log Analytics workspace that we created in the previous step.
  3. On the overview page, click on Logs in the top menu. This will open the Azure Monitor query editor:
    Figure 1.14 – Azure Monitor query editor

    Figure 1.14 – Azure Monitor query editor

  4. Here, you can select some default queries. They are displayed at the bottom part of the screen. There are queries for retrieving unavailable computers, the last heartbeat of a computer, and much more. Add the following queries to the query editor window to retrieve data:

    The following query will retrieve the top 10 computers with the most error events over the last day:

    Event | where (EventLevelName == “Error”) | where (TimeGenerated > ago(1days)) | summarize ErrorCount = count() by Computer | top 10 by ErrorCount desc

    The following query will create a line chart with the processor utilization for each computer from the last week:

    Perf | where ObjectName == “Processor” and CounterName
    == “% Processor Time” | where TimeGenerated between (startofweek(ago(7d)) .. endofweek(ago(7d)) ) | summarize avg(CounterValue) by Computer, bin(TimeGenerated, 5min) | render timechart

    Tip

    Be careful, Kusto is case sensitive!

    Important note

    A detailed overview and tutorial on how to get started with the Kusto Query Language are beyond the scope of this book. If you want to find out more about this query language, you can refer to https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/get-started-queries.

Log Analytics provides a powerful tool to explain what is happening within your Azure Infrastructure. Next, we will look at how we can use the built-in networking tools to help identify and resolve communication issues between components.