How to link automation account to Log Analytics workspace

Userss12 0 Reputation points
2024-10-16T14:05:35.87+00:00

I a have created a new automation account and Log Analytics workspace, but there is no way to link them. I have found some steps, but the option from update management is not availible anymore.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,323 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Dan Rios 2,005 Reputation points MVP
    2024-10-16T18:59:21.87+00:00

    You can create diagnostic settings on the Azure Automation Account using this guide:

    https://learn.microsoft.com/en-us/azure/automation/automation-manage-send-joblogs-log-analytics

    Once you have set this up, selecting all the diagnostic information you want to pipe to Log Analytics it should start to populate the workspace with data when your jobs start triggering.

    please mark as accepted answer if this helped solve your issue!


  2. Userss12 0 Reputation points
    2024-10-17T10:11:07.16+00:00

    i have created a Diagnostic setting connected to te new law with al settings (and Send to Log Analytics workspace). Created a new runbook to check al vm in the law, but the text is still : This Automation account is not linked to a Log Analytics workspace. Or does it take some time?

    0 comments No comments

  3. Userss12 0 Reputation points
    2024-10-17T11:22:59.7666667+00:00

    can be removed. Double message.

    0 comments No comments

  4. Karni Gupta (MSFT) 85 Reputation points Microsoft Employee
    2025-03-03T14:18:41.3733333+00:00

    Hi @Userss12 ,

    Incase you are still looking for this information -
    If you want to associate LAW as a "linked resource" to Automation Account, it can be done via Azure CLI as all the other features have now been deprecated.

    Sample command -

    az monitor log-analytics workspace linked-service create -g myresourcegroupname -n automation --workspace-name myloganalyticsname --write-access-resource-id resourceidofAA
    

    For more details, please refer to https://learn.microsoft.com/en-us/cli/azure/monitor/log-analytics/workspace/linked-service?view=azure-cli-latest#az-monitor-log-analytics-workspace-linked-service-create

    If you find my answer helpful, please consider marking it as the ‘Answer’ and giving it an ‘Upvote’ using the thumbs-up option. This can also benefit other community members who may have the same question.

    Thanks,

    Karni.G

    0 comments No comments

  5. Karni Gupta (MSFT) 85 Reputation points Microsoft Employee
    2025-03-03T14:21:52.95+00:00

    Hi @Userss12 ,

    In case, you are still looking for an answer -

    If you want to link LAW as a "linked resource" in your Automation account, Azure CLI can be used now that most of the features have been deprecated.

    Sample Command -

    az monitor log-analytics workspace linked-service create -g myresourcegroupname -n automation --workspace-name myloganalyticsname --write-access-resource-id resourceIDofAutomationAccount
    

    More details - https://learn.microsoft.com/en-us/cli/azure/monitor/log-analytics/workspace/linked-service?view=azure-cli-latest#az-monitor-log-analytics-workspace-linked-service-create

    If you find my answer helpful, please consider marking it as the ‘Answer’ and giving it an ‘Upvote’ using the thumbs-up option. This can also benefit other community members who may have the same question.

    Thanks,

    Karni.G

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.