1

I have the following asp.net web application:-

enter image description here

and using this command, i deploy the web application to azure web app:-

az webapp deployment source config-zip --resource-group "PUS"  --name "TDMGroupPUSRER" --src "C:\pus\bin.zip"

now when i try to edit the .svc file or delete it i will get "File not found error",as follow:- enter image description here

So can anyone advice on this?now inside my web application this file contain this code:-

<%@ ServiceHost Language="C#" Debug="true" Service="ProjectUpdateSystem.RER" CodeBehind="RER.svc.cs" %>
Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
John John
  • 1
  • 72
  • 238
  • 501
  • Did you have WEBSITE_RUN_FROM_PACKAGE=1 in your web app setting? If so, it is mounting zip as readonly virtual file system (files will not be writable). – Suwat Ch Jan 30 '20 at 07:47
  • Looks like there is an [open issue](https://github.com/projectkudu/kudu/issues/2872) for that in kudu github. – Reza Aghaei Feb 03 '20 at 18:21

1 Answers1

1

It's Kudu's problem and there is an open issue for that in in Kudu's github repository.

As an alternative you can use either of the following options for file operations:

  • Use Azure App Service Editor (Preview)
  • Use a workaround in PowerShell or command inside Kudu environment

Azure App Service Editor (Preview)

You can find App Service Editor (Preview) under the Development Tools category of your app service blade or you can add /dev at the end of kudu URL. Assuming your application URL is https://myapp.azurewebsites.net/, then it's App Service Editor URL is:

  • https://myapp.scm.azurewebsites.net/dev/

Then you will be redirected to App Service Editor. Then you can choose the file from the file explorer at left and edit, rename of delete it.

enter image description here

PowerShell

To edit, not a very beautiful workaround, but working:

  1. Kudo → Debug Console → PowerShell
  2. Run the command: Rename-Item sample.svc sample.svc.txt
  3. Edit the file using kudu UI and save changes.
  4. Run the command: Rename-Item sample.svc.txt sample.svc

To delete:

  1. Run the command: Remove-Item sample.svc

To create:

  1. Run the command: New-Item sample.svc
Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
  • thanks foer the reply . so my `.svc` is not having any problem, and the issue is that i can not edit it using kudu? but the `.svc` should be hosted and working fine? – John John Feb 03 '20 at 22:08
  • I tried by a svc file having dummy contents. You may want to check if your real svc is working. It should work well. – Reza Aghaei Feb 03 '20 at 22:15
  • @testtest I tested using a real svc file and everything works well. Just created a simple web form application, added a service having a hello function, then deployed on app service. Turned off https only, connected through a client and everything was working well. – Reza Aghaei Feb 04 '20 at 11:25