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,366 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Karni Gupta (MSFT) 95 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

    1 person found this answer helpful.

  2. Dan Rios 2,020 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!


  3. Karni Gupta (MSFT) 95 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

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.