How to enable SQL best practices assessments for SQL VMs via Powershell (not CLI)

Paul Sebestyen 0 Reputation points
2025-10-21T18:27:00.6333333+00:00

I am using Powershell and the Update-AzSqlVM cmdlet to enable the features included with the SQL Server IaaS extension. I have been able to successfully Configure Storage via -SqlManagementType 'Full' parameter, but having trouble with the Enable SQL best practices assessments option. Looking at the help, it would appear that -AssessmentSettingEnable is the parameter to use for this. However, there is a required Log Analytics workspace name in the configuration. I do not see an option for this in the help. Running the cmdlet with the -AssessmentSettingEnable switch parameter does not produce an error, but it does not enable this as expected either. Any help would be greatly appreciated.

SQL Server on Azure Virtual Machines
{count} votes

Your answer

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