asp.net mvc in container in an azure windows app service - asp.net

Is it possible to run a full ASP.NET MVC application (not .NET Core) in a Docker (or other) container in an Azure App Service, and if so, what are pointers to documentation for such?
This says yes on ASP.NET MVC in a container:
Can we deploy an asp.net mvc 4 app to docker with windows container?
And this says yes on .NET Core in a docker container in a linux App Service
https://blogs.msdn.microsoft.com/webdev/2016/11/16/new-docker-tools-for-visual-studio/
However I haven't been able to find a yes on:
ASP.NET MVC + Container + App Service
Or can the two references above be combined to safely infer that the configuration I'm looking for is possible?

I'm pretty sure Windows App service is not offering containers, but why would you need a container, when basically it is a container (sort of). It's a PaaS service, where you have no control over the IIS which is offered as a service to you. But if you really want containers use Azure Container Service or Virtual Machines. To be honest, I do not see any reason to use containers if you are aiming at Azure App Service, why introduce another management level?

Azure App Service Linux (Preview) provides Container support on Linux VMs.
You can follow this post: https://blogs.msdn.microsoft.com/webdev/2016/11/16/new-docker-tools-for-visual-studio/
You can try to run Asp.Net MVC in a container and post the result here.
http://www.hanselman.com/blog/PublishingAnASPNETCoreWebsiteToACheapLinuxVMHost.aspx

Definitive answer from Microsoft
"As of today (1/5/17), App Service doesn’t support containers on Windows, but it does on Linux (which is in preview) and the only version of ASP.NET that supports Linux is ASP.NET Core."
https://social.msdn.microsoft.com/Forums/azure/en-US/3688feb3-3df1-4822-aab1-03c8271e16bf/aspnet-mvc-container-in-an-azure-app-service?forum=windowsazurewebsitespreview

Related

Web API as a windows service

So I'm creating a new .Net Framework 4.8 Web API in Visual Studio 2019 and I'm wanting to know how to create the API as a windows service? I can't seem to find any examples or online resources to do so. I can run the API locally in VS and it opens Chrome and shows the responses under the local IIS Server it spins up. How do I take this same project and compile it as a windows service while still using HTTPS?
Web API is fully capable of being self hosted on top of OWIN, and does not require IIS to run.
Web API self hosted is basically just a console app. So the techniques for turning a Web API console app into a Windows Service are the same as for any other .NET console app. You can use a service manager such as NSSM, or create a Windows service project directly (by inheriting from the appropriate classes, pretty messy) or use a library like TopShelf.
Note that it's generally not a good idea to directly expose this self hosted app directly to the public. IIS provides a lot of security benefits out of the box designed to protect against malicious requests. If you're planning to publicly expose it, make sure you stick a proxy in front of it that will fulfill those security needs.

How do I put an ASP.Net Framework API made in C# onto Pivotal Cloud Foundry?

I created a RestAPI in ASP.Net and need to put it on Cloud Foundry. This is not .NET Core, it is .NET Native. If someone could point me in the right direction that would be great!
Pivotal Cloud Foundry has now came up with windows native tile for PCF Runtime for Window. Your PCF operator needs to add this tile and then you can host .net native api on to PCF.
After above setup, developers simply “cf push” their app to Windows Server or Linux and PCF does the routing to ensure their code runs in a container, on the right OS. For .NET developers this means full PCF support pushing full, native .NET applications onto Windows
For more info please follow this
Apart from that you can simply use Hosted Web Core Buildpack to run your core .net app.

Service Fabric reliable service with .NET Core

So I am playing around with Service Fabric for rolling out a system to the cloud, and so far I have most of the stateless services ported over and running well using ASP.NET Core.
I have another set of services that need to be stateful, and I would like to leverage .NET Core for those services as well. For those I will need to run a custom TCP protocol, not HTTP/WebAPI/WCF.
So the question is; is this possible? The templates only have a ASP.NET Core stateless service template. Can I build something like a .NET Core console application to run as a "Reliable Service"? If so, is there any documentation on how to do this?
Yes, it's possible.
You can create the .NET 4.5.1 stateful service via the template, and then port that project to .NET Core - we've done this and it works just fine.
There doesn't appear to be any official documentation on this process.

Why use an Azure Cloud Service Project instead of an ASP.NET project with the Azure SDK?

I'm playing with Azure asp.net development. I use Visual Studio 2010, with Azure SDK and I'm a newbie to Azure cloud.
I created several apps and deployed them to my testing Azure Web Site. Everything works fine - ASP.NET Web Page, ASP.NET MVC3, even simple GridView binding to an Azure SQL database, which I created earlier and that I manage with Microsoft SQL Management Studio, using ADO.NET. It's really simple.
Now, I learned from some tutorials, that I need to use a Windows Azure Cloud Service Project to make sure that my application will work. But it works without this project, too. So what exactly do I need such a project in my solution for?
There are actually three different ways you could have gotten your ASP.NET app over to the cloud, and the confusion comes because you are seeing elements of two of those options.
A Windows Azure Web Site is just a single ASP.NET application running in Microsoft's data centers (versus on premises) so all of the configuration it needs is already part of the project itself (primarily the web.config), some being exposed via the Azure portal. In many ways, this is similar to web hosting providers.
A Windows Azure Cloud Service is a collection of multiple services, which could be web sites/services (Web Roles) or backend code (Worker Roles). The code for your Azure Web Site could also have been deployed exactly as is as a Web Role, but in that case it would be part of a larger application that potentially contains additional Web and Worker Roles. It's the Cloud Service project itself that provides the additional configuration of those web and worker roles (even if you have just a single role in the cloud service). The Cloud Service offering is considered Platform as a Service.
The other option, for completeness, is to create a Virtual Machine image yourself, install your ASP.NET site, and then have Windows Azure host the Virtual Machine. It's at the opposite end of the 'make it simple to deploy' spectrum, but you get a lot of control over what exactly is on the VM that you deploy. This is the Infrastructure as a Service offering from Azure.
I'm going to assume you're developing for Windows Azure Cloud Services (the foundation PaaS solution of Windows Azure). The Cloud Service project defines your application to the Windows Azure Fabric. If you don't already have one, then odds are your are running your application outside of the local Development Emulator. If you are going to deploy your solution to Windows Azure Cloud Services, you will need to create this project for your application so Windows Azure's Fabric (the secret sauce that will manage your application) knows how to manage the application.
And I'm going to assume the opposite to #BrentDaCodeMonkey - that you're developing for Azure Web Sites, and not Cloud Services - in which case you may have confused yourself with the tutorials, as I don't believe a Cloud Services Project is either necessary or advisable.

Difference between Window Service, WCF Service application and ASP.NET web service application?

I don't know this is a right forum for my question or not?
I am new in Web Services. Today i just open VS2008 and found 3 type of SERVICE project
Window Service
WCF Service application
ASP.NET web service application
Please help me to find out the difference between these three projects?
When should we decide which type of project?
Very short explanation:
Windows service is as it states a service running on Windows OS. For example, indexing service running on Windows machine is a Windows service.
Asp.NET Web Service is a service that can only be used via http and is hosted on server.
WCF is a framework, layer or platform that enables you to create multiplatform services that can communicate with each other. WCF services supports more protocols. Can be hosted by server, application or used by other services. You can use WCF to create a web service or a windows service.
A newer and easier approach for creating lightweight web services is the stateless Web API. I suggest you download VS 2017 Community Edition, so you are not stuck with only those choices.

Resources