az deployment group create command not working. Error message: Unable to retrieve url https://storage account name.file.core.windows.net/share1

Terrance Drakes 20 Reputation points
2025-11-21T11:01:13.4133333+00:00

AZ deployment group create command not working. Error message: Unable to retrieve url https://storage account name.file.core.windows.net/share1/file share name

Trying to run a template deployment from my local PC in Powershell. When I run the AZ deployment command I get the Error message: Unable to retrieve url https://storage account name.file.core.windows.net/share1/file share name

Command I am running: AZ deployment group create --resource-group myresource --template-uri https://storage account name.file.core.windows.net/share1/file share name


Moved from: Community Center | Discuss the Q&A site | Get started on Q&A

Windows for business | Windows Client for IT Pros | Devices and deployment | Configure application groups
0 comments No comments
{count} votes

Answer accepted by question author
  1. VPHAN 9,760 Reputation points Independent Advisor
    2025-11-27T20:30:52.2533333+00:00

    Good morning Terrance Drakes,

    The issue is not that your home PC lacks a "secure connection" to Azure. The issue is how the Azure Resource Manager (ARM) service interacts with Azure Files.

    When you run az deployment group create --template-uri ..., your local PC does not download that file. Instead, your PC sends that URL to the Azure control plane, and the Azure control plane tries to fetch the file. Azure Files shares (unlike Blob Containers) are not designed to serve files via simple HTTP/HTTPS GET requests unless explicitly authenticated. The error "Unable to retrieve url" is happening because the ARM service tries to hit that link, gets rejected (because there is no authentication token attached to the URL), and fails.

    Here are the two actual ways to fix this instantly without building network infrastructure:

    Option 1: The "Local File" Switch (Fastest)

    Since you are on your PC, you do not need to force Azure to fetch the template from a URL. Download the acrtemp.json file to your local desktop (or if you have it locally already). Change your command parameter from --template-uri to --template-file.

    Command: az deployment group create --resource-group myresource --template-file "C:\Path\To\acrtemp.json"

    This bypasses the storage account and URL issues entirely by uploading the script directly from your machine during execution.

    Option 2: The SAS Token (If you must use a URL)

    If you are required to keep the file in the cloud, you cannot just use the plain URL. You must append a SAS (Shared Access Signature) token. The ARM service is external to your storage account; it needs a "key" to get in.

    1. Go to your Storage Account > File Shares > share1.
    2. Right-click acrtemp.json and select "Generate SAS".
    3. Copy the Blob SAS URL (it will look like https://...json?sv=2020...).
    4. Paste that long URL into your --template-uri command.
    1 person found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Terrance Drakes 20 Reputation points
    2025-11-27T22:47:52.34+00:00

    Hi VPHAN,

    The option 1 was the initial command used but it did not work. Command: az deployment group create --resource-group myresource --template-file "C:\Path\To\acrtemp.json" I believe I got the same error message. Then I moved the file to the storage account, both commands not working. Saving the template locally on my PC or on the storage account.

    I will try option 2 to add a SAS token to the commands and I will let you know. Thanks.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.