ERROR

“Unable to download deployment content” when using Az.Storage 6.0.0 PowerShell module with artifacts generated by Cloud Builder 11.2 and earlier

Last Published: May 16, 2024

Error Message

When using Microsoft Az.Storage 6.0.0 or later Powershell with an automation artifact generated from ArcGIS Enterprise for Microsoft Azure Cloud Builder 11.2 or earlier to launch an ArcGIS deployment on Microsoft Azure, the following error message is returned:

New-AzResourceGroupDeployment : <TimeStamp> - Error: Code=MultipleErrorsOccurred; 
Message=Multiple error occurred: BadRequest,BadRequest. Please see details.
New-AzResourceGroupDeployment : <TimeStamp> - Error: Code=InvalidContentLink;
Message=Unable to download deployment content from '<SASURL>***Sanitized Azure Storage Account Shared Access Signature***'. The tracking Id is '<Tracking-Id>'. Please see https://aka.ms/arm-deploy-resources for usage details.

Cause

A change in the New-AzStorageContainerSASToken cmdlet starting with 6.0.0 removed the leading question mark (?) in the SAS token. Automation artifacts generated from older Cloud Builder releases do not account for this change.

Solution or Workaround

Edit the Deploy-AzureResourceGroup.ps1 or Upgrade-AzureResourceGroup.ps1 automation artifact before you deploy. Replace the existing $OptionalParameters line shown in Example 1 with the text shown in Example 2, and save the artifact file.

Example 1

$OptionalParameters[$ArtifactsLocationSasTokenName] = ConvertTo-SecureString -AsPlainText -Force `
            (New-AzStorageContainerSASToken -Container $StorageContainerName -Context $StorageAccount.Context -Permission r -ExpiryTime (Get-Date).AddHours(4))

Example 2

$SASToken = (New-AzStorageContainerSASToken -Container $StorageContainerName -Context $StorageAccount.Context -Permission r -ExpiryTime (Get-Date).AddHours(4))
if(-not($SASToken.StartsWith('?'))){
    $SASToken = '?' + $SASToken
}

$OptionalParameters[$ArtifactsLocationSasTokenName] = ConvertTo-SecureString $SASToken -AsPlainText -Force

Article ID: 000032660

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options