Home Forums Programming Powershell Need help with file not found error message. RE: Need help with file not found error message.

  • The issue I have is that although during debugging the Parameter value is correct, the script keeps looking at the local disk for the .json template.

    New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $HDIURI -TemplateParameterUri $HDIURI;

    $uatstgkey = (Get-AzureRmStorageAccountKey -ResourceGroupName "myresourcegroup" -Name "mystorageaccount").Value
    $context = New-AzureStorageContext -StorageAccountName "mystorageaccount" -StorageAccountKey $uatstgkey.GetValue(0)
    $sasToken = New-AzureStorageContainerSASToken -Name "containername" -Context $Context -Permission r -ExpiryTime ([DateTime]::Now.AddHours(1.0)) -FullUri
    $HDITemplate = Get-AzureStorageBlob -Blob "template.json" -Container "containername" -Context $Context
    $HDIParameters = Get-AzureStorageBlob -Blob "parameters.json" -Container "containername" -Context $Context
    $HDIURI = "https://mystorageaccount.blob.core.windows.net/input"

    Getting the following error:

    Error: Code=InvalidContentLink; Message=Unable to download deployment content from 'https://storageaccountname.blob.core.windows.net/containername/template.json'

    I just cant figure out why it cant download the .json files. This is driving me up the wall.

    Regards,
    Paul.