Logic App Consumption deployment error: Unable to copy file Deploy-AzureResourceGroup.ps1. Access to the path is denied.

And I was thinking that this only happened with BizTalk Server… Yesterday, I opened Visual Studio 2019 to modify and deploy a Logic App Consumption project to our DEV environment to test our changes and, later on, plan to deploy it to production. However, when I tried to deploy the solution through Visual Studio into our DEV environment, I got the following error:

Unable to copy file “E:\Source…\LA-Project-name\Deploy-AzureResourceGroup.ps1” to “bin\Debug\staging…\Deploy-AzureResourceGroup.ps1″. Access to the path ‘bin\Debug…\Deploy-AzureResourceGroup.ps1’ is denied.
Done building project “LA-Project-name-DEV.deployproj” — FAILED.

I was slightly surprised since my team has deployed the solution many times to the DEV environment without any issues.


With this error message, I quickly remembered my experience with BizTalk Server projects and an error that I had published quite a while ago: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) while trying to deploy a BizTalk Solution from Visual Studio

To be honest, this behavior has become frequent with all security features implemented in the operating system, especially after Microsoft introduced User Account Control. This means that you run all programs as a standard user, even if you are an administrator. But there are many things that we need to do in Visual Studio that require us to run as an admin, not a standard user. 


To solve this issue, you should run Visual Studio as an administrator. To do that, you need the following:

  • Select the Start button, and then in the Search box, type Visual Studio.
  • Next, right-click Visual Studio 2019 and select More > Run as administrator.

Open your BizTalk Visual Studio Solution and try to build and deploy it. It worked for me!

I hope you find this helpful! If you liked the content or found it helpful and want to help me write more content, you can buy (or help buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to Top