To add a additional a log analytics workspace to linux vm through powershell script

Azure-learning 56 Reputation points
2022-11-14T15:06:31.417+00:00

add additional workspace to linux vm through powershell script.

azure vm is linked to an log analytics workspace .we are using update management to patch the vm. and we are not able to add the vm because it's already added to another workspace.

Please let me know can we update the vm workspace through powershell script and add the workspace of automation account ?.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,111 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,355 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Manu Philip 16,966 Reputation points MVP
    2022-11-14T15:41:37.613+00:00

    The Log Analytics agent for Linux does not support reporting to multiple workspaces like windows machines. You can see the following reference:

    log-analytics-agent

    ----------

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    2 people found this answer helpful.
    0 comments No comments

  2. Andrew Blumhardt 9,491 Reputation points Microsoft Employee
    2022-11-14T20:11:46.783+00:00
    2 people found this answer helpful.
    0 comments No comments

  3. Carlos Villagomez 1,031 Reputation points Microsoft Employee
    2022-11-16T23:07:42.887+00:00

    Hello @Azure-learning ,

    Thanks for your post! I just wanted to clarify in case there is any confusion on the 2 previous answers that they are in fact both correct. In this case, given that Microsoft Monitoring Agent (MMA) does not support multiple log analytics workspaces in Linux, per the note by @Manu Philip above we know that would not be appropriate for your scenario.

    However, the Azure Microsoft Agent (AMA) does in fact support dual homing in Linux as indicated by @Andrew Blumhardt .

    An important deadline to note, is that the legacy Log Analytics agent will be deprecated by August 2024. Migrate to Azure Monitor agent before August 2024 to continue ingesting data. You can reference the following document here for more information on how to perform the migration.

    In addition, I have included the following document referenced here for a side-by-side comparison between the AMA and Log Analytics Agent.

    Please let us know if this helps answer your questions and we are more than happy to assist you further.

    Thanks!
    Carlos V.

    ----------

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.