Porting existing console application to Windows Azure - c#

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.

Related

Writing Windows Service in C# .NET Core for Windows & Azure Cloud

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.

Migrating windows service hosted TCP WCF service to windows azure

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.

Creating a Web Server container to emulate an IIS server

Okay, I'm a very green developer (co-op student) so I'll try my best to make sense. Currently I have a web application (call it "Updater") that is an aspx and runs through IIS. My boss has asked my to look into creating a program (exe or command line) that can run the app through created encapsulated web server that can act like IIS. This is so that I can run the exe during an installer procedure on a client's machine so that the updater can configure the client's program.
So Far I've looked into sources upon sources on how to create a self hosted web server to handle a web app and I've managed to do the following:
-Create a command line server hosted at a given port #######.
-Use a StreamReader to read an html file
-Use HttpResponseMessage to set the Content to this html page.
Obviously this is very rudimentary, but I couldn't understand how to switch the app over to the server I created rather than the IIS.
Any help ont he matter would be appreciated, like I said I'm still quite new.
You can use OWIN to self host from within a console application.
Look for 'Self-Host OWIN in a Console Application' in the following link:
http://www.asp.net/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana
You need to start you self host server with the address your app is trying to contact. If your IIS is running with the default settings it should be http://localhost:80. Before you start the self host server you need to shut down your IIS website that is running on port 80. Two applications can not listen on the same port at the same time.
What you ask is a redistributable web server for ASP.NET. So, you might find interesting the UltiDev Web Server, formerly known as Cassini web server.
From their website:
UltiDev Web Server Pro (UWS) is an advanced, redistributable web server for Windows that can be use as a regular web server to host web sites and ASP.NET applications, or packaged with your ASP.NET web application and installed on your customers' systems along with your web app or site.

How can you host a desktop application in cloud?

I have created a windows(desktop) application (large) using C#.Net, VB.Net & SQL Server 2005.
I need to move this application to cloud platform. I've not much knowledge regd Cloud.
Every thing I read about cloud, hints that applications developed using ASP.Net
or Web applications/sites can only be hosted on cloud.
Since, my application is using WinForms (desktop),
I am doubtful whether the application will work on cloud platform.
Can this application be hosted in Cloud?
Or should I recreate the entire application using ASP.Net to run in Cloud?
You can deliver this on Amazon Cloud using Citrix XenApp. AWS has Citrix XenApp AMI's in its marketplace. You can host your C#/VB.net on Amazon EC2, upgrade and migrate your MSSQL to 2012/2008 and host it on another Amazon EC2. Have Citrix XenApp installed on AWS and deliver your desktop app to your customers via Xenapp.
it would be more interesting if you moved only the DATA components of the App to the cloud, so your (heavy) clients could use the cloud as a LAN extension. Cheaper and no code impact, just addressing the dat source in the new location.
Hope this helps,
I think you're getting confused as to what actually gets hosted "in the cloud" (a term I really despise, to be honest). Essentially your desktop application remains a regular desktop application, but you can offload data and/or processing "to the cloud" and your desktop application accesses it, usually using a web service.
See the Amazon E3 overview for more information.
Few options to host windows(WinForms/WPF) app in cloud are -
Appstream2 (AWS)
Windows Virtual Desktop (Azure)
Citrix Virtual Apps and Desktops

What are the various methods of hosting a WCF service?

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)

Categories