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. Q&A Assist
    2025-11-21T11:01:31.7433333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message you are encountering, "Unable to retrieve url https://storage account name.file.core.windows.net/share1/file share name," typically indicates that there is an issue with accessing the specified URL for your template. Here are some common reasons and troubleshooting steps:

    1. Check Storage Account Name and URL: Ensure that the storage account name and the file share name in the URL are correct. The URL should not contain spaces; if there are spaces, replace them with %20 or ensure the URL is properly encoded.
    2. Access Permissions: Verify that you have the necessary permissions to access the storage account and the file share. Ensure that the storage account is not restricted by any firewall rules or network configurations.
    3. File Existence: Confirm that the file you are trying to access actually exists in the specified file share. You can do this by navigating to the Azure portal and checking the contents of the file share.
    4. Network Issues: Check for any network issues that might be preventing your local machine from accessing Azure resources. Ensure that your internet connection is stable.
    5. Correct Command Syntax: Ensure that the command syntax is correct. The command should look like this:
         az deployment group create --resource-group myresource --template-uri https://<storage-account-name>.file.core.windows.net/<share-name>/<file-name>
      
      Replace <storage-account-name>, <share-name>, and <file-name> with the actual names without spaces.

    If you've checked all the above and the issue persists, consider using Azure CLI's --debug flag to get more detailed error messages that could help in diagnosing the problem further.

    0 comments No comments

  2. VPHAN 9,760 Reputation points Independent Advisor
    2025-11-21T11:36:06.59+00:00

    Good morning Terrance Drakes,

    The error your're facing probably comes from an invalid URL containing spaces and missing authentication for the Azure File Storage share. To fixx this, encode the URL by replacing all spaces with "%20" and generate a SAS token for the file via the Azure Portal under the file share's "Shared access tokens" blade. Append the SAS token to the template URI as a query parameter. The corrected command should be: az deployment group create --resource-group myresource --template-uri "https://storageaccount.file.core.windows.net/share1/file%20share%20name?sv=..." with the SAS token included. If the storage account has firewall rules, ensure your local IP is allowed in the storage account's network settings.

    I hope you are clear with the information. Should you have any more questions, feel free to leave a message. If everything is fine, it's really appreciated of you to accept the answer to help build the community by sharing your experience with the issue. Thanks!

    VP


  3. VPHAN 9,760 Reputation points Independent Advisor
    2025-11-22T02:11:41.5633333+00:00

    Hi Terrance Drakes,

    Did you find the answer useful? Do you need further assistance? In case everything has been fine, it's appreciated of you to accept the answer so that it could be spread further to those in need too. Thank you.

    VP

    0 comments No comments

  4. Terrance Drakes 20 Reputation points
    2025-11-27T19:42:45.4466667+00:00

    Hi, VPHAN

    No answer yet to my issue. I am working from my home PC and trying to run AZ deployment group create template commands where the template file is located in my Azure storage account. Getting error " Unable to retrieve url https://tdrakesstore1.file.core.windows.net/share1/acrtemp.json"

    No issue with spaces. Or no permission issues or firewall or network access issues. I believe I do not have a secure connection to Azure and that is why I am not able to access the storage account and why the " AZ deployment group create" command is not able to run and deploy my new resource in Azure. In process trying to setup a application gateway with a public IP to connect to the back end storage account. So my AZ deployment group create command will work and deploy my new resource. I already tried a point 2 site configuration but access was denied. I have to find a way to make a secure connection to Azure so my deployment commands will work to deploy my resources into Azure. Thanks for any help.


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.