Azure Virtual Desktop | Sessionhosts monitoring

Sessionhostmonitoring
Reading Time: 3 minutes

On August the 31th , Microsoft is deprecating the Log Analytics Agent which was announced at August 19th of 2021. It was announced in this statement: We’re retiring the Log Analytics agent in Azure Monitor on 31 August 2024 | Azure updates | Microsoft Azure. With the retirement of the Log Analytics Agent you will need to migratie to the Azure Monitor Agent (AMA). This will not be installed by default but can be automated with an Azure Policy.

Using a Data Collection Rule and the Azure Monitor Agent, you will get insights in the health of a virtual machine. Performance metrics and Windows Eventlogs will be collected to the Log Analytics Workspace and the Monitor agent will give a good overview. If a virtual machine is not compliant by having for example the Azure Monitor Agent, the policy will fire a remediation task and will connect the virtual machine to the data collection rule.

Set it up

First we will create a Data Collection Rule. Browse to Monitor – Microsoft Azure

Image 1

Add a resource. We set it to the subscription level because Microsoft states that a proper Azure Virtual Desktop setup must be located in its own subscription.

Image 2

Add a data source

Image 3

Add a destination

Image 4

Add Windows Event Logs and Performance Counters

Image 5

After creating the Data Collection Rule, we need to save the id of it because we need to add that to the azure policy.

Image 6

Browsing to the Data Collection Rule, you will find the JSON VIEW button at the Overview page. This will popout the ResourceID which must be copied.

Azure Policy

Browse to the Azure policy Compliance page: Policy – Microsoft Azure

Image 8

Choose for Assign initiative

There is a initiave called: Configure Windows machines to run Azure Monitor Agent and associate them to a Data Collection Rule

Add resource selector which it a Microsoft.Compute/virtualMachines

Image 9

Now we need to fill in the resourceId of the Data Collection Rule

Image 10

We choose to create a remediation task to use AMA with a system-assigned managed identity and we let the initiave create that identity

Image 11

Next we provide a Non-Compliant message and select all the policys

Image 12

After the creation we wait for a few minutes and it will appear in the dashboard as not started

Image 13

Now we wait until the policy kicks in.

To make sure that every virtual machine gets the AMA, you can create a remediation task which installs the AMA on the virtual machines.

Image 14

After a while (could take up some time) you can check if everything is oke.

Image 15

Share and Enjoy !

Shares
Designer (23)

Stay close to the action—follow GetToThe.Cloud across social!
Deep dives and hands‑on how‑tos on Azure Local, hybrid cloud, automation, PowerShell/Bicep, AVD + FSLogix, image pipelines, monitoring, networking, and resilient design when the internet/Azure is down.

🔗 Our channels
▶️ YouTube: https://www.youtube.com/channel/UCa33PgGdXt-Dr4w3Ub9hrdQ
💼 LinkedIn Group: https://www.linkedin.com/groups/9181126/
✖️ X (Twitter): https://x.com/Gettothecloud
🎵 TikTok: https://www.tiktok.com/@gettothecloud
🐙 GitHub: https://github.com/GetToThe-Cloud/Website
💬 Slack: DM us for an invite
📲 WhatsApp: DM for the community link

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners. View more
Cookies settings
Accept
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Who we are

Our website address is: https://www.gettothe.cloud

Comments

When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection.An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.

Media

If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.

Cookies

If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed.If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.

Embedded content from other websites

Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.

Who we share your data with

If you request a password reset, your IP address will be included in the reset email.

How long we retain your data

If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.

What rights you have over your data

If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.

Where we send your data

Visitor comments may be checked through an automated spam detection service.
Save settings
Cookies settings