Hello @Fabrice ,
Welcome to the MS Q&A forum.
I suspect the root cause could be the script itself. I noticed you are using the publisher name "Microsoft.EnterpriseCloud.Monitoring" while setting up the "ExtensionName" parameter. This one should be "MicrosoftMonitoringAgent" or "omsagentforlinux" depending on the OS.
As example, check this code snippet below: Log Analytics virtual machine extension for Windows
As additional if above doesn't help to resolve the issue, please kindly share what is VM OS, your end goal, and if you are following up any specific public article to deploy the extension.
--------------------------------------------------------
Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.