OpenTelemetry for WCF services hosted in IIS and Windows Services - c#

Currently, we have Thick Client (WPF application run in customer environment) and WCF services hosted in Cloud (as IIS/Windows services applications).
Thick Client runs from customer environment. It is always a pain to track issues related to Thick Client customer-facing issues. We are thinking to implement OpenTelemetry to tracking the end-to-end tracing/logs (WPF -> WCF) and also standardize the logging.
Is it a good idea to implement OpenTelemetry? I have seen a lot of samples related .net core but not WCF Services hosted in Windows Services. Please share any reference articles and best OpenTelemetry samples related to WPF -> WCF end-to-end tracing.

Related

Host legacy WCF services in Azure

Does anyone know what the options are for hosting legacy .NET4+ WCF services in Azure?
I have heard that App Services are not to be used, but I have trouble finding any sources.
You can host your WCF services in multiple ways
on IIS
as Windows Service
as Console App
For the windows Service / Console App, you can:
Setup a VM and also install it
For the other options:
You can deploy on App Service or also on a VM with IIS installed.
More info:
https://aspdotnetcodehelp.wordpress.com/2017/11/13/hosting-wcf-in-azure-app-service/
The basic areas to consider when migrating an existing .NET application to Azure are:
https://learn.microsoft.com/en-us/dotnet/azure/migration/choose
Compute choices
Database choices
Networking and security considerations
Authentication and authorization considerations
To host a WCF service in Azure, you can check out the following tutorials.
Expose an on-premises WCF service to a web application in the cloud by using Azure Relay
Deploying an existing WCF service to Azure

WebAPI as Micro service in Cloud

Can we host the normal Asp.Net MVC WebApi built with c# code and not in .net core in Azure or AWS micro service platform?
Depends on what you mean micro service. Microservices is mostly an architecture and not a specific platform. They are related to containers in a sense, but it's not the same thing.
Based on this: https://azure.microsoft.com/en-us/solutions/microservice-applications/, related technologies include:
Service Fabric
Get automatic scaling, rolling upgrades, and self-healing from faults with a custom-built microservices framework.
Azure Kubernetes Service (AKS)
Use a fully managed Kubernetes service to handle provisioning, upgrading, and scaling cluster resources on demand.
Azure Functions
Build apps with simple, serverless functions that scale on demand based on the number of executions—without managing infrastructure.
API Management
Expose and publish specific parts of your applications as an API no matter where the implementation is hosted.
Kubernetes and ServiceFabric support containers which can be hosted on windows with iis, so the answer is yes.
The api management is agnostic and is used to expose, secure e.t.c your APIs.
You can even host .net web api on app service: https://learn.microsoft.com/bs-latn-ba/dotnet/azure/dotnet-howto-migrate-app-service?view=azure-dotnet
In app service you can scale up and scale out.
Functions are serverless and they are not related to MVC api, they need new implementations.

Scalable WCF Web Service

I have written a stateless WCF REST Web service. The main consumer of this web service will be a mobile app. There could be 1000's of clients connecting to the web service simultaneously. And this number will increase in the future.
How do I deploy the WCF web service so that it scales nicely. I am guessing the web service will be hosted in multiple servers and a load balancer will distribute the traffic among there servers. Can anyone suggest a load balancer typically used for such a scenario?
Is there any other recommended way to deploy the web service for scalability?
Frankly speaking I haven't tried this... So this only a thought
I would Install Microsoft Azure Service Bus for Windows Server and then connect/setup all available instances of Web Service to the Service bus endpoint.
There is a buildin load balancer.
Pros:
There is a build in Load Balancer, easy.

Can I use WCF RIA Services with existing web APIs?

I'm new to this kind of development, and so far I've only seen tutorials on WCF RIA services which create new ADO.Net data models from a database.
However I am working with a system which provides you with web APIs for interacting with the data (which I am able to contain and use in my own web service, which will in turn interact with my silverlight application).
Is it possible/sensible to use WCF RIA services in this case? Or shall I just use a regular WCF Service which uses these APIs?
Thanks!
I think you should first really understand the power of WCF RIA Services as explained in the msdn documentation http://msdn.microsoft.com/en-us/library/ee707344(v=vs.91).aspx
"A common problem when developing an n-tier RIA solution is coordinating application logic between the middle tier and the presentation tier. To create the best user experience, you want your RIA Services client to be aware of the application logic that resides on the server, but you do not want to develop and maintain the application logic on both the presentation tier and the middle tier."
So, as soon as you are in the domain service, you are in a classic WCF Service, so here you could interact with possibly anything you wish (including external web API).
Though, the avantages to use WCF RIA Services is smaller if the logic of your application is already embed in a Web API.

What is the preferred method for building web services in .Net?

I am confused as to what is the best method for building a web service in .net. Giving the fact that it needs to be highly scalable. Any suggestions?
If your consumers are all .NET, look at WCF:
http://msdn.microsoft.com/en-us/library/ms731082.aspx
Otherwise, plain old SOAP services are good. Both are scalable.
IIS is designed for scalability, so I'd definitely consider using ASP.NET web services rather than hosting my web service within a windows service using WCF.
Of course, you can host your WCF web service within IIS. Here's an article on how to do this.
This article is a little old, but it details the benefits of hosting your web service in IIS within the Recommendations section:
Scalability—It is very easy to scale out a Web service using load-balancing technology such as Windows Network Load Balancing, or hardware devices from vendors such as Cisco and F5. More on this subject to follow.
Availability—ASMX Web services can be configured to be highly available using a combination of technologies such as load-balancing combined with the powerful capabilities of the IIS6 infrastructure built into Windows 2003 Server (such as automatic recycling and restarting of failed services).
I guess the point is no matter if you want to use ASP.NET web services or WCF, definitely host it in IIS.
We use WCF. You can also use Spring.Services very powerfull framework.
What stragedy you whant to use service-first or contract-first?
As per as i know it totally depend on the what kind of web services u want to develop....
if u want to secure,state management and other facilities that can be required for web services ....i prefer WCF (Window communication foundation).
The global acceptance of Web services, which includes standard protocols for application-to-application communication, has changed software development. For example, the functions that Web services now provide include security, distributed transaction coordination, and reliable communication. The benefits of the changes in Web services should be reflected in the tools and technologies that developers use. Windows Communication Foundation (WCF) is designed to offer a manageable approach to distributed computing, broad interoperability, and direct support for service orientation.
for more information about and Problem Example
Use WCF.
It allows you to expose a service using multiple protocols and multiple security contexts.
A very good resource for learning WCF is Michele Bustamante's book Learning WCF.
http://www.amazon.com/Learning-Hands-Michele-LeRoux-Bustamante/dp/0596101627
Note: If you do get this book, she has an updated version of Chapter 1 and an appendix on her website.
Her website is also a good source of up-to-date information: http://www.dasblonde.net/default.aspx

Categories

Resources