Trying to deploy a blank template file to an Azure Resource Group, not understanding the path referenced

Tiaan Venter 10 Reputation points
2025-07-01T12:28:36.7466667+00:00

I'm going through the following article:
https://learn.microsoft.com/en-us/training/modules/create-azure-resource-manager-template-vs-code/2-explore-template-structure?tabs=azure-powershell

It provides the following code at some point:
$templateFile = "{provide-the-path-to-the-template-file}"
New-AzResourceGroupDeployment -Name blanktemplate
-ResourceGroupName myResourceGroup `
-TemplateFile $templateFile

What I'm not understanding is "{provide-the-path-to-the-template-file}". Is this Template File variable supposed to be pointing to a local directory and file, e.g. "C:\dir\dir\file.txt" or is it some other kind of path being mentioned? When I try and use a local path/file, ps gives me the following error:

New-AzResourceGroupDeployment : 14:27:18 - Error: Code=InvalidDeployment; Message=The deployment 'blanktemplate' must have either the TemplateLink or Template property

set. Please see https://aka.ms/arm-module for usage details.

At line:2 char:1

  • New-AzResourceGroupDeployment -Name blanktemplate -ResourceGroupName ...
  • 
        + CategoryInfo          : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
    
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
    
     
    
    

New-AzResourceGroupDeployment : The deployment validation failed

At line:2 char:1

  • New-AzResourceGroupDeployment -Name blanktemplate -ResourceGroupName ...
  • 
        + CategoryInfo          : CloseError: (:) [New-AzResourceGroupDeployment], InvalidOperationException
    
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
    
Azure | Azure Training
{count} votes

4 answers

Sort by: Most helpful
  1. Rhoan, Julian 5 Reputation points
    2025-11-05T21:43:22.7333333+00:00

    One of Microsoft’s tutorial sites helped. It walks you through a basic tutorial template. After doing that, the original code worked. The site: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-tutorial-create-first-template?tabs=azure-powershell

    Hope it helps.

    1 person found this answer helpful.

  2. Tiaan Venter 10 Reputation points
    2025-07-01T12:48:14.32+00:00

    Will try doing this using Azure CLI and not local Azure Powershell.


  3. Frederik Hotovčín 0 Reputation points
    2025-10-08T12:22:21.5966667+00:00

    I have the very same issue and I am struck on this very start of course. I followed all steps from the course, but I am still getting error: **'[Errno 2] No such file or directory: 'C:\dir\dir\Documents\MS-trainings\azuredeploy.json'
    **
    As you can see I have defined above path for .json template. I can confirm the file is existing, saved and path is correct, but azure is unable to recognize it. I cannot move forward in training therefore. Is there any fix/suggestion or solution for this? Is it possible the course is inaccurate?

    0 comments No comments

  4. James Sullivan 0 Reputation points
    2025-11-28T14:01:02.3266667+00:00

    Make sure azuredeploy.json is populated

    0 comments No comments

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.