I am working on developing post-deployment Pester validation script for my project. I need to push pester scripts into the VM as custom script extension using Azure CLI.
Following is the command I executed:
az vm extension set --resource-group SomeRG--vm-name SimpleVM --name
customScript --publisher Microsoft.Azure.Extensions --settings '{"fileUris":
["https://github.com/myname/DSCConfig/blob/master/pester.ps1"],
"commandToExecute":"powershell -ExecutionPolicy Unrestricted -File
pester.ps1"}' --version 2.0
and I got the below error in the Linux interface after executing above command:
Deployment failed. Correlation ID: 8ba16fc0-fea6-4650-bb0a-2b73c9613dfe. Handler 'Microsoft.Azure.Extensions.customScript' has reported failure for VM Extension 'customScript' with terminal error code '1007' and error message: 'Install failed for the plugin (name: Microsoft.Azure.Extensions.customScript, version 2.0.6) with exception The specified executable is not a valid application for this OS platform.'
And while checking the extension on VM saw the status as "Transitioning " and details as Install failed for the plugin (name: Microsoft.Azure.Extensions.customScript, version 2.0.6) with exception The specified executable is not a valid application for this OS platform)
Alternatively I tried with other publishers: Microsoft.Compute and Microsoft.OSTCExtensions
Unfortunately, none of them worked. I have been stuck at this step for past two days. Any help is much appreciated.