I've tried to run a custom script to install software silently to my Windows Scaleset Here is my configurations Arm template added to virtualMachineProfile like child resource to ExtensionProfile here is the code
{
"name": "InstallSomeCoolStuffs",
"properties":{
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.10",
"autoUpgradeMinorVersion": true,
"settings": {},
"protectedSettings": {
"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File myscript.ps1",
"managedIdentity": {},
"fileUris": ["https://someblob.blob.core.windows.net/src/myscript.ps1"
]
}
}
},
The problem was when I tried to Deploy the ARM template with enabled managed identity and add Contributor role to Storage Account failed with message:
"message": "VM has reported a failure when processing extension 'MyScript'. Error message: \"Failed to download all specified files. Exiting. Error Message: The remote server returned an error: (403) Forbidden.\"\r\n\r\nMore information on troubleshooting is available at https://aka.ms/VMExtensionCSEWindowsTroubleshoot "
Thank you!
I found a solution if someone gets the same problem.