Run WCF (Core WCF) service in App Service (.NET 6) on Azure

505 views Asked by At

We're very excited to see the CoreWCF project moving well. Right now we're trying to deploy a WCF service writen in CoreWCF to an Azure App Service using .NET 6. Deployment succeeds, but the WCF endpoints don't work.

Could you let me know if this feature is supported at this moment? If it is, do you have instructions on how to do it?

Thank you very much, really appreciate your work!

Ellen

1

There are 1 answers

0
Rajesh  Mopati On

Azure App Service does not support NetTcpBinding. Run WCF (Core WCF) service in App Service (.NET 6) on Azure

It is possible to deploy a WCF service in corewcf to Azure App Service (Net 6).

As per Azure App Service operating system functionality documentation, Azure App Service supports named pipes as an inter-process communication (IPC) mechanism between different processes that collectively run an app.

Use named pipes instead of NetTcpBinding in your WCF service.

Steps to deploy a WCF service in corewcf to Azure App Service (Net 6)

  1. Create a new ASP.NET Core Web Application project in Visual Studio. And add a WCF service to the project using the corewcf template.

enter image description here

  1. And update the appsettings.json file as below.
{
  "AllowedHosts": "*",
  "Wcf": {
    "Endpoints": {
      "Http": {
        "Url": "http://localhost:4000/MyService"
      }
    }
  }
}

  1. Update the Startup.cs file with below code:
public void ConfigureServices(IServiceCollection services)
{
    services.AddWcf();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseRouting();

    app.UseEndpoints(endpoints =>
    {
        endpoints.MapWcfService<MyService>();
    });
}

  1. Publish the project to Azure, in the Azure portal and go to the Configuration tab and add an application setting with the key "WEBSITE_LOAD_USER_PROFILE" and the value "1". And restart the App Service.

For more information refer to the MSDoc and MSDoc.