0

I have the following error trying to pubblish on Azure App Service on a non-production deployment slot:

2>Start Web Deploy Publish the Application/package to https://appservicename-preprod.scm.azurewebsites.net/msdeploy.axd?site=appservicename__preprod ...

2>Adding ACLs for path (appservicename-preprod) 2>Adding ACLs for path (appservicename-preprod)

2>Updating file (appservicename-preprod\bin\Antlr3.Runtime.dll).

2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.targets(4284,5): Error ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER: Web deployment task failed. (Unable to perform the operation ("Create File")
for the specified directory ("D:\home\site\wwwroot\bin\Antlr3.Runtime.dll"). This can occur if the server administrator has not authorized this operation for the user credentials you are using. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER.)

2>Publish failed to deploy.

I'm owner of the subscription where the app service is hosted. If I try to access via FTP I see the wwwroot empty but from VS on Cloud Explorer under the appservicename/Deployment Slots/appservicename-preprod/Files I can locate the files. If I try to publish a zip file on KUDU Zip Push Deploy it returns me the error at 50% : [object Object] - Error while calling ZipDeploy.

Any suggestions?

ShamaIT
  • 11
  • 2
  • 4

2 Answers2

5

You should create it using publish Profile, it has all the necessary details for deployment:

  • In the Azure portal, open the Azure App Service.

  • Go to Get publish profile and save the profile locally.

    enter image description here

  • On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose Publish.

  • If you have previously configured any publishing profiles, the Publish pane appears. Click Create new profile.

  • In the Pick a publish target dialog box, click Import Profile.

    enter image description here

  • Navigate to the location of the publish settings file that you created in the previous section.

  • In the Import Publish Settings File dialog, navigate to and select the profile that you created in the previous section, and click Open.

    Visual Studio begins the deployment process, and the Output window shows progress and results.

  • If you get an any deployment errors, click Settings to edit settings. Modify settings and click Validate to test new settings. If the host name is not found, try the IP address instead of the host name in the Server and Destination URL fields.

    enter image description here

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Harshita Singh
  • 4,590
  • 1
  • 10
  • 13
  • I used the pubblishing profile already and imported or connected through the target Azure where the appservicename-preprod is located. Both solutions not working and give me the same error. If I validate the connection is working. If I use "Preview Changes" is working and show me what are the file to add/update. I think there is some issue with write permissions. – ShamaIT Feb 10 '21 at 08:42
  • I think it is Auth error then, the account which you are using in VS 2019 and Azure CLI - is that given appropriate access to the subscription? – Harshita Singh Feb 10 '21 at 08:45
  • Check out this issue: https://stackoverflow.com/questions/34613147/azure-web-app-deployment-error-via-msdeploy-error-insufficient-a-ccess-to-site Perform the steps mentioned by David and let me know if it works. – Harshita Singh Feb 10 '21 at 08:49
  • Does this answer help you? – Harshita Singh Feb 11 '21 at 18:11
  • No, i found the issue that was related to the publish mode configured using WEBSITE_RUN_FROM_PACKAGE – ShamaIT Feb 12 '21 at 09:40
0

remove WEBSITE_RUN_FROM_PACKAGE from azure appservice>Configuration>Application Settings

if u ever linked ur appservice to devops or github then fist disconnect that too. Appservice(ur app)>Deployment Center>check the linked