We have requirement to migrate a TCP WCF Service which is hosted as Windows Service in an on-premise environment to windows azure.
I know, we can go with IaaS(Infrastructure as a Service) in windows azure and host the application in some Azure Virtual Machine and work the same way it was working in on-premise. I am curious to know, if there can be any options available with PaaS (Platform as a Service) or SaaS (Software as a Service) features of windows azure upon this requirement.
Related
Background: We have developed a Windows Service in C# .NET 4.5. The service does two jobs at once.
It communicates with LDAP and reads the user statuses and updates in the Database.
It communicates with the Database and rolls out items to users.
Requirement: We have got the opportunity to rewrite the service in .NET Core. We need to write the service to achieve the following targets.
The old clients who are using their own infrastructure could install and use the service like they are doing now.
The clients who are using CLOUD should be able to install it on the cloud. But I don't think for a single service we are required to use VM. Is there a better way to handle this scenario?
The service's 1st part is communicating with LDAP. Clients who are using the cloud, definitely have the database hosted on the cloud along with the other Web Applications but where should be the service installed so it can easily communicate with the LDAP as well as with the database (2nd part)?
I heard about the background worker process. Does the windows service be used as a background worker process and as a windows service at the same time?
For .NET Core take a look at Microsoft.Extensions.Hosting.BackgroundService for windows services.
As far as the Cloud issue I assume it would depend on how the customer is setup. If LDAP is still on-prem, I assume it would be easier to have the service running on-prem as they would probably have a connection to the VPC on the Cloud where the database is hosted.
If everything exists on the Cloud then I assume it would the depend on the provider how you can run the service? Small EC2 instance on Amazon, on Azure you might have to use a VM or maybe look at a WebJob on an AppService, not very familiar with Google.
Hope this helps.
I have some console applications that communicate using WCF over TCP. Is it possible/easy to port a console application to Windows Azure, or must the application be hosted in IIS/asp .net?
Since you do not really log into a Windows Azure machine and see the screen as you could do with a local server in your network I guess you should only develop server side components or IIS Hosted services and web applications exactly as you said.
you could get the Windows Azure SDK: Windows Azure SDK and explorer the available templates and alternatives locally in your machine.
A console application can be started from a role - web or worker - and communication to that app can be via the InputEndpoint (HTTP, HTTPS or TCP).
I worked on a project that spawned a console app from a worker role, the role fed workloads read from storage queues direct to a WCF service hosted in the console application - using tcp.
I found that you can use startup tasks in the config file for Azure. That works.
I have a desktop and web application connected to same database.
Which is the most preferred method to make them communicate with each other?
You should use SOA and then both your desktop app and web app should communicate with the Service.
And the Service will be responsible for communicating with the database.
I know (Windows Activation Service) WAS is advertised as part of Windows 2008/Vista/7 but since it appears under .NET 3.5 framework components in Control Panel Windows Components, I was wondering if anyone knows/has managed to run in under Windows 2003 as well.
I'm trying to host a WCF server in WAS under Windows 2003 (written in .NET C#)
Alternatively, does anyone know of any good open source application servers out there that can be used to host .NET servers? (TomCat for .NET?!)
WAS is a part of IIS7, which is available on Vista and Win Server 2008 and up only.
On Win Server 2003, you can either host your WCF service in IIS - which limits you to just http (basicHttp or wsHttp), or - my preferred way - you can host your WCF service yourself.
Typically, you would host your WCF service in a console app for testing/debugging purposes, and then put it inside a Windows NT Service for production - this runs around the clock, with no one logged in, and it supports ALL the WCF bindings (not just http, but also Net.TCP, NetNamedPipe, MSMQ and so on).
Marc
You can always roll your own WCF host. I've used this concept as an example.
http://www.codeproject.com/KB/WCF/generic_wcf_host.aspx
You can host a WCF service in IIS on Windows 2003, if you use basichttpbinding or wshttpbinding.
You could also host a WCF service as a windows service on windows 2003.
WAS is not available on Windows 2003.
What are the various methods of hosting a WCF service?
There are four common ways, all of which are outlined nicely on MSDN: Hosting WCF Services.
Hosting in IIS.
Hosting in WAS.
Hosting in a Windows service.
Hosting in an application (aka "self-hosting").
For right now, everything that's been said is correct.
Hosting in IIS6 only support HTTP protocols and "on-demand" activation
Hosting in IIS7 / WAS (only on Vista / Server 2008 and up) supports all protocols and "on-demand" activation
Self-Hosting in a console app or Windows service supports all protocols, but doesn't support on-demand activation (e.g. your service must be up and running all the time, it cannot be magically activated when a request comes in)
What's not been mentioned is what the .NET 4.0 wave later this year (2009) will offer - there's a new add-on server component called Dublin which is said to offer a rich and managed hosting environment for both WCF services as well as WF workflows.
Marc
You can host it in an IIS application or in your own executable. Typically the executable would be a windows service application.
Any Windows process can be used to host a WCF service. There are practically no restrictions on this - a process can host multiple WCF services and the same WCF service type can be hosted across multiple processes simultaneously.
From Juval Lowy's book Programming WCF Services, hosting can be provided by
Microsoft Internet Information Server (IIS)
Self-hosting within a Windows Forms application, Windows service, or console app
Windows Activation Service (WAS)