After some digging I thought I had to put the SAS token into quotes, and when looking into C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.8\RuntimeSettings\0.settings I found that it was a sensible solution. I could also copy the "commandToExecute" and run it and get the expected result. In the variables section I added a:
"variables": { "singlequote": "'",
And then put single quotes around the parameters('SASToken'). But no dice. The token was still getting truncated, this time with a 'in front...
So I decided to get rid of the '&', at least temporarily. base64 encoding to the rescue. And Luckily there is an ARM template function for just that. In the script I then added:
$SASToken = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($SASToken))
Problem solved!
Seems to me that there is something odd in how the custom script extension calls PowerShell in this particular instance.
Nice!!
SvarSletGRS shoes offers Mens shoes in varied designs and colors.
http://www.grsshoes.com/