question

TomaszChmuraSPARKIT-2294 avatar image
0 Votes"
TomaszChmuraSPARKIT-2294 asked AnuragSingh-MSFT commented

Deleting on-prem servers from Azure Auto Updates

Hello,
I have Automation Account with several on-premise servers connected to it. How can i remove device/agent from management? I found a solution:
https://docs.microsoft.com/en-us/azure/automation/update-management/remove-vms?tabs=non-azure-machine#to-remove-your-vms
but in Log Workspace in Computer Groups i don't have any group to change query.
Devices are connected by manually installing agent. Now i do not have access to some servers so i want to remove them from management list.

azure-automation
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AnuragSingh-MSFT avatar image
0 Votes"
AnuragSingh-MSFT answered AnuragSingh-MSFT commented

Hi @TomaszChmuraSPARKIT-2294

Welcome to Microsoft Q&A! Thanks for posting the question.

I understand that you are trying to remove on-premise agents configured for Azure Automation Update Management. Since you mentioned that you are not able to View any Computer Groups, please ensure that you are looking under the correct Workspace. A Log Analytics workspace connected to Azure Automation Update Management will show the Automation Account name as shown below:

175668-image.png

To be able to edit the saved search query, please find below the detailed steps (these are identical to the one mentioned in the article with a slightly different approach of reaching to the saved query):

1. In your "Log Analytics" workspace (connected to Azure Automation Update Management), click on Logs under General

2. Click on Functions and expand Workspace functions.

3. Hover your mouse pointer on Updates__MicrosoftDefaultComputerGroup and click on the Load the function code. Once you have the code loaded in wokspace query window, remove the VMUUIDs corresponding to the machines which are no longer required. (You can get the VMUUID of all the non-Azure machines using the query Heartbeat | where ComputerEnvironment == "Non-Azure" | summarize by Computer, VMUUID)

4. Once you have updated the VMUUIDs in the query, click on Save. Ensure that the name is Updates__MicrosoftDefaultComputerGroup --> Click on Save. This would show a message that you will be overwriting the existing function. Click Save again.

The image below summarizes the steps:

175659-image.png


Please let me know if you have any questions.


Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.



image.png (90.8 KiB)
image.png (26.2 KiB)
· 14
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @AnuragSingh-MSFT , thanks for your reply.
Unfortunately, there is no Workspace functions in my Log Analytics:
175737-image.png


0 Votes 0 ·
image.png (27.6 KiB)
AnuragSingh-MSFT avatar image AnuragSingh-MSFT TomaszChmuraSPARKIT-2294 ·

@TomaszChmuraSPARKIT-2294, thank you for the reply. Based on the screenshot above, this particular "Log Analytics" workspace does not seem to be the one connected to Azure Automation Update Management. To verify that, please check the "Automation Account" option under Related Resources on this workspace. If it is connected to an Azure Automation Account, it should show the following details (including the name of Azure Automation Account name):


175767-image.png

Please note, a machine can be connected to more than 1 Log Analytics workspace at a time. You should be following the steps to remove the machine, from update management, from the workspace which is connected to Automation account.


Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.




0 Votes 0 ·
image.png (24.5 KiB)

@AnuragSingh-MSFT , workspace is connected to automation account:
175679-image.png


0 Votes 0 ·
image.png (65.6 KiB)
AnuragSingh-MSFT avatar image AnuragSingh-MSFT TomaszChmuraSPARKIT-2294 ·

@TomaszChmuraSPARKIT-2294, thank you for the confirmation. Is it possible that the saved function got deleted from the portal by accident? I deleted the function by hovering over it and selecting delete and it was gone, including the Computer Group. To recreate it, please follow the steps below:

1. Click on Logs in Log Analytics workspace and paste the following the query

 Heartbeat | where Computer in~ ("") or VMUUID in~ ("VMUUID of computers") | distinct Computer

2. Click on down arrow (176415-image.png) on Save button and select "Save as function".

3. Mention Function Name as "Updates__MicrosoftDefaultComputerGroup", Legacy category as "Updates" and ensure that "Save as computer group" is selected as shown below:
176377-image.png

4. Save it. After a few seconds, refresh the page and you should see the group under "Functions" as well as the computer group under "Computer Groups" option in Log Analytics.

5. Run the query below to get all the computers VMUUID and update it in the query (you might have to set the time range to more than 24 hours):

 Heartbeat
 | distinct VMUUID
 | project pack_array(VMUUID)

6. Ensure that the VMUUIDs of not-required machines have been removed.


Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.

0 Votes 0 ·
image.png (4.1 KiB)
image.png (17.8 KiB)

Thanks @AnuragSingh-MSFT for your reply. If i understand it correctly, here:
5IhIwxPSiflo


should be VMUUIDs of all computers, which i want to manage. So i need to place them manually? And when i no longer want to manage one machine, should i delete her VMUUID? What if i add another computer to management, do i need to place new VMUUID manually?

0 Votes 0 ·