Welcome to Microsoft Q&A Forum, thank you for posting your query here!
Since this "Linux diagnostic" extension helps you monitor the health of a Linux VM, we need this to be installed on the VM and up and running with the latest version.
However, in your scenario its running on lower version i.e 3.0.142.
Reason for the failure:
Since your extension is running on a lower version, it may require the higher version i.e., 4.0.x, to be installed on the VM to access the latest features and updates for monitoring and health. Although the extension can automatically upgrade to a newer version, but for you the automatic upgrade option is currently disabled, causing the current extension version to fail.
How to fix the issue:
Before going to upgrade the extension to please met the prerequisites first https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/diagnostics-linux?tabs=powershell#prerequisites
then Install the extension by using Azure CLI or in Azure PowerShell
Set-AzVMExtension -ResourceGroupName <resource_group_name> -VMName <vm_name>
-Location <vm_location> -ExtensionType LinuxDiagnostic -Publisher Microsoft.Azure.Diagnostics
-Name LinuxDiagnostic -SettingString $publicSettings
-ProtectedSettingString $protectedSettings
-TypeHandlerVersion 4.0
Once you install the 4.0.x. version, enable the Automatic Extension Upgrade feature:
You can refer to the below doc for better understanding.
Hence, moving forward you will be having the latest version extension.
Hope this helps!
Please reply if you there are any challenges.
Please do not forget to "Accept the answer” and “upvote it” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.
Thanks