I configured log analytics with Azure SQL Analytics (Preview) solution for monitoring the databases, servers and elastic pools.
For that, I followed the below links
Monitor Azure SQL Database using Azure SQL Analytics (Preview) in Log Analytics
Enable Azure resource metrics logging using PowerShell
I used below cmdlet for enable metrics and diagnostics for single database instead of all my databases.
Set-AzureRmDiagnosticSetting -ResourceId “/subscriptions/XXXXXX-XXX-XXX-XXX/resourceGroups/YYYYY/providers/Microsoft.Sql/servers/YYYY/databases/” -WorkspaceId “XXXXXX-XXX-XXX-XXX” -Enabled $True
But when I run the above cmdlet in PowerShell ISE with Administrator mode, I got the below error even I installed the Azure RM Modules.