Infrastructure to .NET CORE projects - c#

I haven't been able to find any information on what is required to deploy a .NET CORE solution to a linux environment. I was asked to specify and detail on the requirements to go to production.
We are developing a .NET CORE Web API wich hits a SQL Server database, the client will be an Angular 2 app. I read about .NET CORE is cross-platform, so besides to Windows one could deploy to Linux and OS X. I guess Kestrel is the main piece here, but I'm not very sure of what is the correct infrastructure to deploy.
Do I need multiple servers?, one for the API, one for the DB since SQL Server isn't cross-platform, one for the client app? Additionally, do the severs will need any special configuration?
Shortly: What do I need to ask to our company infrastructure team in order to avoid any misconfiguration when going to prod?
Thanks in advance.

Do I need multiple servers?, one for the API, one for the DB since SQL Server isn't cross-platform, one for the client app?
If you host MSSQL Server on Windows - yes, you would need at least 2 machines. One with Windows and one with Linux, given that you must host your API on Linux. For the client app you do not need a separate server and you can host it on the same server as API.
Also, you can host everything on Windows (MSSQL Server, API, Angular app).
You can take a look at MSSQL Server preview for Linux. MSSQL Server on linux
Additionally, do the severs will need any special configuration?
No, you can just build your .net core api for linux and copy it to the linux server and it will work. For the web server you would need any reverse proxy like NGinx or HAProxy. Here is a good tutorial from Microsoft Linux environment + nginx

Related

lightweight framework for automatic IIS deployment

Some background:
I'm a Java server developer and works mostly for Linux server
I use python as major scripting language for all trivial tasks, as well as deployment
Now I'm going to move to a project using C# on Windows.
What's feature I like for fabric:
fabric is lightweight, and easy for small team to learn
python can do a lot of things than some deployment framework. For example, we manage hundreds of machines via a internal management portal, a lot of specified configurations and functionalities. We implemented the portal using Java and some fancy web framework. I use python to access the rest API from the server and retrieve server address/port and other information for deployment. The most convenient way to get it done is using a real programming language.
with fabric, I can run any command on remote server. With this I can easily have workarounds for some unusual cases.
again, python is really good to do customization work for servers, e.g. build an init.d script from template.
What I have checked for windows:
Windows Deployment Kit
Ansible
Chef
(The list above may cost me too much to learn to get the right choice. I didn't dig into them.)
I also think about installing a ssh server software on windows. But I'm looking for a Windows way for Windows deployment.
The question is:
Is there an easy to learn and lightweight script framework for windows server deployment? my goal is to automatic everything for deployment to multiple IIS instances, and also, handle some daily/weekly ops tasks.
My Final solution that works pretty well:
install cygwin on windows server
install sshd as service
use python fabric to handle deployment
run commands on server using fabric
sync files using rsync
steps of uploading files
upload a random password file to server
start rsync daemon on remote server
upload file with modification check and compression using rsync
stop rsync daemon on remote server
server provision

C# web application without IIS

For web application development using C#, IIS seems to be the standard choice of web server. But are there any other options? I want to use Linux for my web server.
As far as I can see the other options are:
Make your web server program handle the IIS stuff yourself. (As long as you don't need a lot of IIS features, this won't be too expensive)
Use XSP
Use Apache Tomcat with mod_mono
Use another web server like nginx or lighttpd (Is this even possible with C#?)
Use that OWIN stuff (Are there implementations of this which are mature enough to consider yet?)
Something else I haven't considered ... ?
Which of these options is the most viable for a web application in the long term?
I'm mostly concerned about the long term maintainability of the project, rather than the server being able to handle high volume loads.
Option 1
Install Mono+XSP
Launch ASP.NET web-app using XSP on different port e.g. 8001
Proxy this port through nginx to 80
Option 2 (Better)
Wait for ASP.NET 5 (MVC6) release with complete Linux support
Use standalone-application approach (OWIN-Like) on different port e.g. 8001
Proxy this port through nginx to 80
On both ways you will need to install Mono, and I recommend installing latest one, not the one that, for example, Ubuntu PPA gives.
Also, since you are concerned about long-term you should really wait for Option 2 since it's going to be released in next couple of months.
If you really cannot wait those months and do not want to work on beta-product and then migrate to stable only option I see is NancyFX which is web-app framework written in C# that has full Linux support now.

Accessing ASP.NET web application that only runs on a local machine

So I have zero experience with deploying software or putting something live. The situation is like this:
I have developed a dashboard web application on a laptop. This application uses a microsoft SQL database that also runs locally. When I run it, it's a localhost address. Now, I need to be able to access my web application from other PCs within my company's network. This way I can do some user testing. What are ways to do this? I searched and things confuse me to no end.
I use:
.NET Framework 4.5
Visual Studio Ultimate 2012
IIS7
Thanks
There are a few things you'll need to do to make your local application visible on the network. I'm assuming you want your app running on something like http://foobar/myapp where foobar is the name of your machine
Here is what you need to do:
Add a URL reservation so your machine will allow IIS to serve content on the url http://foobar/myapp
Create an inbound rule in Windows Firewall to allow incoming connections on port 80
You can find the exact commands you need to run on Scott Hanselman's excellent blog post. Of course, he's focusing mainly on getting SSL to work with IIS Express, but it has enough pointers to get you going, too.
look at msdn.microsoft.com
you can learn about:
Prerequisites
Creating the Web Site
Creating a Test Page and Class
Publishing the Web Site
Testing the Published Web Site
Next Steps

Application Server equivalent on Windows

I have a question regarding how to write a windows server side application.
We have now have a system whose client is .NET 4.0 based and a server side application running on jboss on Linux. The server application talks to an Oracle DB.
I am now thinking to move the server side to Windows and DB to SQL server. The server application should be written in C# on .NET as well. However, there seems no Application Server equivalent on Windows. How is a server application normally written and deployed on Windows?
Many thanks
There are a few options, but the very basics would be
Host WCF web services in IIS and take advantage of the management IIS offers, you can bring AppFabric into the picture for more robust and manageable hosting.
Self host your service in a Windows Service.
If it suites your application I would say the AppFabric solution is worth looking at. But this is not a 1-to-1 with with a Java Application Server.
Update
Self hosting WCF is as simple as the follow
host = new ServiceHost(typeof(YourWcfService));
host.Open();
This assumes that you have defined a service called YourWcfService'. The above code in theOnStart` of a Windows Service will start accepting requests to your service. Of course this still requires all the basic configuration in the app.config file.
AppFabric, however gives you a nice environment to manage and monitor your services, so not to sound like a broken record, but I would look into it to see if it is possibly a good fit for you.
Update 2:
I did a quick bing and found this MSDN post, it is oldish but looks like a good example.
http://msdn.microsoft.com/en-us/library/bb332338.aspx
It's not exactly true, there are couple of almost unknow but powerful tools that you can use free:
NetFluid: http://www.netfluid.org/
Service Stack: http://www.servicestack.net

Web server integration in Windows application

I am developing a Windows application using the .NET framework. I am exploring the best ways to integrate a web server in my application that listens to localhost:8080 (or whatever port). I do not want to compromise on the security of the user so I would like to use some library or existing web server application that is secure and does not have vulnerabilities.
So I rounded myself to 2 ways -
1) Using a popular web-server like nginx or apache - and invoking it through the application (and running it as a process with CreateNoWindow = true;).
2) Using a web server written in C# or C++ like WebServer.
What would be the best way to do it? I am open to more suggestions.
I have done this 3 ways in .NET
If it's a web service or Data service your can use the ServiceHost to host your own endpoints
IIS Express is probably the most robust and "proper" solution, unfortunately it's still in beta. You can get it by downloading Webmatrix. http://www.asp.net/WebMatrix
The source code for the webserver embedded in Visual studio is available, it's called Cassini. I've used it on a few projects. It's available as source or even packaged:
http://code.google.com/p/cassini/
http://ultidev.com/Products/Cassini/

Categories

Resources