Search code examples
asp.netazureazure-web-app-servicekudusvc

Unable to edit or delete .svc inside Azure.Error 404 not found


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" %>

Solution

  • 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