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