"Invalid content link" when deploying through cloud shell

Eddie Ace 25 Reputation points

I'm deploying resources in using a script in cloud shell and get the following error message:

{"code": "InvalidContentLink", "message": "The provided content link 'Azure.Deployments.Core.Entities.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path."}

I can't find what part it is refering to.

I'm using the script in cloud shell:

az deployment group create --resource-group xx-xxx-test-rg --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx --name xx-xxx-test-Deploy-011 --template-file deploy_resources.json --par deploy_resources_parameter.json

Where the file deploy_resources_parameter.json contains a reference to files in a fileshare:

   "global.linkedTemplateBaseUrl": {
      "value": "https://xxxxx.file.core.windows.net/testfileshare/"
    "global.linkedTemplateSasToken": {
      "value": "sv=2021-12-02&ss=f&srt=o&sp=rl&se=2024-03-30T15:59:20Z&st=2023-03-30T06:59:20Z&spr=https&sig=xxxxxxxxxxxxxxx%3D"

Any ideas whats wrong?

Azure SQL Database
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,747 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,730 questions
{count} votes

Accepted answer
  1. ShaktiSingh-MSFT 13,911 Reputation points Microsoft Employee

    Hi Eddie Ace •,

    Welcome to Microsoft Q& A forum and thanks for using Azure services.

    As I understand, you are getting error when trying to execute az deployment group command in CLI as "Invalid Content Link"

    When referencing a file the value of uri can't be a local file or a file that is only available on your local network. Azure Resource Manager must be able to access the template. Provide a URI value that downloadable as http or https.

    Reference: Linked Template

    • I can see that you have specified template file as the blob path. As per the error message it looks like your ARM template that you are deploying might have reference from the local path.
    • Make sure if the URL path is publicly accessible and if you are using the storage URL then have you passed the SAS URL so it authenticates the request.
    • Also, please let us know if you are using Storage Account Level SAS token.? If yes, please try using Container Level SAS token if works.
    • Additionally, check if there are no firewall/network setting at the storage end that is blocking the request from your CI/CD pipeline.

    Hope this helps. If not, please share more inputs so that we can further assist you. Thanks.

0 additional answers

Sort by: Most helpful