The problem is very simple when Visual Studio is building the project, it doen't copies the script files in the build folder (in this case bin\Debug\Staging\). Tell us about your experience at the script is failling with Get-ChildItem because my script is missing?! I looked in the folder D:\Dev\local\TestARMProject\TestARMProject\bin\Debug\staging\TestARMProject, and indeed the files are missing! Fixing this is in fact really simple fortunately. Deploying template using PowerShell script failed. FullyQualifiedErrorId : PathNotFound, ![]() CategoryInfo : ObjectNotFound: (D:\Dev\local\Te.zuredeploy.json:String), ItemNotFound RmResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseNa. At D:\Dev\local\TestARMProject\TestARMProject\bin\Debug\staging\TestARMProject\Deploy-AzureResourceGroup.ps1:108 'D:\Dev\local\TestARMProject\TestARMProject\bin\Debug\staging\TestARMProject\azuredeploy.json' because it does not ResourceId : /subscriptions/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/TestARMProject VERBOSE: 7:06:33 - Created resource group 'TestARMProject' in location 'eastus' VERBOSE: Performing the operation "Replacing resource group. TenantId : xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ![]() SubscriptionId : xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 'D:\Dev\local\TestARMProject\TestARMProject\bin\Debug\staging\TestARMProject\Deploy-AzureResourceGroup.ps1' -StorageAccountName '' -ResourceGroupName 'TestARMProject' -ResourceGroupLocation 'eastus' -TemplateFile 'D:\Dev\local\TestARMProject\TestARMProject\bin\Debug\staging\TestARMProject\azuredeploy.json' -TemplateParametersFile 'D:\Dev\local\TestARMProject\TestARMProject\bin\Debug\staging\TestARMProject\' -ArtifactStagingDirectory '.' -DSCSourceFolder '.\DSC' Launching PowerShell script with the following command: Project "ployproj" (ContentFilesProjectOutputGroup target(s)): Project "ployproj" (StageArtifacts target(s)): The following parameter values will be used for this operation: Then when I try to right-click and do a Deploy. In a solution, I added a simple Azure Resource Group deployment project just like this one. ![]() However, this issue was not usual of Visual Studio, so I decided to see what was the problem and try to fix it. First, I didn't care since I didn't have time to investigate and also because most of the time using PowerShell or Azure CLI. Lately, I've been having some trouble when deploying from Visual Studio.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |