hands-on lab

Exploring Query Statement and Function Types in Kusto Query Language (KQL)

Up to 1h
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.


Kusto Query Language (KQL) is a powerful pipeline-driven, read-only query language that enables the queries against the azure logs to be easier and straightforward. Query statements are a core functionality that provides rich log search capabilities to understand the captured raw data. The statements in KQL support many constructs that help you create maintainable and reuseable queries.

In this hands-on lab, you will learn how to write let statements in the KQL editor and create stored functions. You will then use the stored function to build the final query.

Learning Objectives

Upon completion of this intermediate-level lab, you will be able to:

  • Understand KQL query let statements
  • Understand expressions supported by let statements
  • Understand different functions types supported by KQL
  • Create stored functions and use them as a reference

Intended Audience

  • Candidates for Azure Administrator Exam
  • Cloud Architects
  • Data Engineers
  • Software Engineers


Familiarity with the following will be beneficial but is not required:

  • Azure Log Analytics
  • Understanding SQL or similar query commands

The following lab can be used to fulfill the prerequisite:


May 27th, 2022 - Updated the instructions and screenshots to reflect the latest UI

Environment before

Environment after

About the author

Learning paths

Parveen is an Azure advocate with previous experience in the professional consulting services industries. He specializes in infrastructure and DevOps with a wide range of knowledge in security and access management. He is also an Azure Certified - DevOps Engineer Expert, Security Engineer, Developer Associate, Administrator Associate, CompTIA Certified - Network+, Security+, and AWS Cloud Practitioner.
Parveen enjoys writing about cloud technologies and sharing the knowledge with the community to help students upskill in the cloud.

Covered topics

Lab steps

Logging in to the Microsoft Azure Portal
Creating Query using Let Statement in KQL
Creating Reusable Log Analytics Query Function