Enable Change Tracking and Inventory

Cristiano 0 Reputation points
2023-09-06T10:02:26.4533333+00:00

I have created a PowerShell script to deploy Azure Automation Account along other resources.

This is the cmdlet I have used:

New-AzAutomationAccount -ResourceGroupName $ResourceGroupName -Name $AutomationAccountName -Location $Location

However, I have not found a cmdlet to perform the steps described in the following link:

https://learn.microsoft.com/en-us/azure/automation/change-tracking/enable-from-automation-account#enable-change-tracking-and-inventory

So after creating the Azure Automation Account via PowerShell I still have to perform the following steps manually:

# => In Azure portal, check the Automation Account is linked to the WorkSpace:
#    Navigate to your "Automation account" and select either "Inventory" or "Change tracking" under "Configuration Management".
#    Choose the "Log Analytics workspace".
#    To enable "Change Tracking and Inventory", click "Enable".
#    You should get the message "The Change Tracking and Inventory solution was enabled".

Do you know what cmdlet I could use for that?

Set-AzDiagnosticSetting is deprecated and New-AzDiagnosticSetting has not worked for me.

Besides it I couldn't find any cmdlet for that here: https://learn.microsoft.com/en-us/powershell/module/az.automation/?view=azps-10.2.0#automation

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,037 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,196 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,556 Reputation points
    2023-09-13T11:46:11.68+00:00

    Cristiano Welcome to Microsoft Q & A Community Forum. Kindly note that New-AzDiagnosticSetting only creates or updates diagnostic settings for the specified resource. It does not enable Change Tracking within automation account.

    You can try enabling Change Tracking solution using New-AzMonitorLogAnalyticsSolution. Here is blog related to a community member on enabling solutions within log analytics workspace.

    0 comments No comments