- Lab
- A Cloud Guru
Manage Events with Azure Event Grid and Azure CLI
In this lab, using both the Azure portal and Azure CLI in Cloud Shell, you will create an event-driven solution, with a topic on a storage account, then the subscription with a storage queue as the event handler. To test your new solution, you will upload at least one file to a Blob storage container and then check for a message in a storage queue. Students with experience in Azure CLI will have the best opportunity to complete this lab without assistance, but the lab guide and solution videos are available to guide any motivated student to successful completion.
Path Info
Table of Contents
-
Challenge
Housekeeping
- Open an incognito or in-private window and log in to the Azure portal using the user name and password provided in the lab environment.
- From within the portal, initiate the Cloud Shell to select Bash (versus PowerShell) and set up with new backing storage — do not use the existing storage account deployed into the lab environment. You will need both storage accounts to complete the lab.
-
Challenge
Create a System Topic Using Azure CLI
- From the Azure portal, open Cloud Shell. If you need assistance, see the prior objective and associated Housekeeping video.
- Use Azure CLI to create an Event Grid system topic, using any name you like, on the storage account already deployed into the lab environment. The correct storage account has a name that starts with pslab, followed by a few random characters. Do not use the storage account you created as backing for Cloud Storage.
-
Challenge
Create a Subscription on the System Topic
Using the Azure portal:
- Navigate to the storage account already deployed into the lab environment. The correct storage account has a name that starts with pslab, followed by a few random characters. Do not use the storage account you created as backing for Cloud Storage.
Tip: Check that a queue has already been created for you. If it has not, then create a queue, using any name you like.
- Create a subscription on the system topic you created in the previous objective, with the following properties:
- Events should get pushed to your destination whenever a blob is created or deleted.
- The destination (or endpoint) is the storage queue that you just confirmed or created in the pslab... storage account.
- Leave any other properties not mentioned as their defaults.
Note: Security constraints in the lab environment will not allow you to create a subscription using Azure CLI.
- Navigate to the storage account already deployed into the lab environment. The correct storage account has a name that starts with pslab, followed by a few random characters. Do not use the storage account you created as backing for Cloud Storage.
-
Challenge
Test the Topic and Subscription Data Flow
- Upload a blob to a container in the storage account associated with the system topic created in the prior objective.
- Confirm that a
PutBlob
message has arrived in the Azure Storage queue associated with the subscription created in the prior objective.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.