Closed gustavo-vargas-leon closed 6 years ago
I am also experiencing the same issue. I know these templates have worked before, however when I attempted to deploy them into a new Azure tenant (accounting for the change in environmental variables) I reached this same error message.
I face the same error when I use the file from existing storage account or even from Git. Any comments?
@jfuller28495, @patild05 : What worked for me at the end was to upload the script file into an Azure Storage blob and to use a sasKey like this:
{
"name": "customScript",
"properties": {
"publisher": "Microsoft.Compute",
"settings": {
"fileUris": [
"[concat(parameters('_artifactsLocation'), parameters('scriptFileName'))]"
]
},
"typeHandlerVersion": "1.8",
"autoUpgradeMinorVersion": true,
"protectedSettings": {
"commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -File MyScript.ps1",
"storageAccountName": "[parameters('storageAccounts_customscriptteststorage_name')]",
"storageAccountKey": "[parameters('sasKey')]"
},
"type": "CustomScriptExtension"
}
}
@mdverde it does not work for me .i tried same thing what you have suggested .
Hi, I have the same problem.
I generate the SAS token using the cmdlet "New-AzureStorageBlobSASToken", and when I try to update my scale set with it, it fails. Generally it works once or two times, but after that, it starts to raise the error: "The remote server returned an error: (403) Forbidden". (PS.: Every time that I try to execute the update, I use a brand new SAS token, its not the same).
If I take the same SAS token and try it on browser, it starts the download normally.
@dopic did you get it to work for you?
I am also facing same issue! Is there any resolution for this issue or closed without resolution!
Fixed this on my end by going to blob container --> Overview --> Change access level --> Container (anonymous read access for containers and blobs)
Fixed this on my end by going to blob container --> Overview --> Change access level --> Container (anonymous read access for containers and blobs)
doing this will show others your script. it's not a recommended way. the storage account name and key here are design to avoid this.
any update here ? /reopen
I resolved the issue just append the SAS token with fileUris.
Solution is to use protectedsettings
instead of settings
. Only fileUris
and commandToExecute
are supported in the settings
section...
The error message one receives is very bad IMHO and the documentation could be better, but it actually contains it as of today (28.05.2024):
You can set the following values in either public or protected settings. The extension rejects any configuration where these values are set in both public and protected settings.
- commandToExecute
- fileUris
service-fabric-secure-cluster-5-node-1-nodetype https://github.com/Azure/azure-quickstart-templates/tree/master/service-fabric-secure-cluster-5-node-1-nodetype
I need to deploy an Azure Service Fabric cluster and execute a custom script in the VM Scale set, so I added the "customScript" extension to the Microsoft.Compute/virtualMachineScaleSets section of the template. But when I try to deploy it I always get this error:
This is the section on the template
This is the folder where the template is, and inside the scripts folder is the MyScript.ps1 file.
This is the Powershell command I'm using to deploy:
And for I what I've read there no need to previously upload the scripts to an Azure Storage.
I've spent lots of hours trying different things and now I'm stuck. Am I doing something wrong?
Thanks in advance.