Home > Back-end >  Can we write C# console application and ASP.NET Core MVC web application using AWS Lambda
Can we write C# console application and ASP.NET Core MVC web application using AWS Lambda

Time:10-15

I am a bit new to AWS Lambda, and i am not sure if it is a deployment framework where we can host ASP.NET Core MVC web application inside it? or can call .NET Core console application? it is a hosting services. For example currently we have the following 2 main components:-

  1. ASP.NET Core Console application which runs on schedule basis using Windows tasks scheduler.

  2. ASP.NET Core MVC web application which is hosted inside IIS to host some API End Points.

So if we want to use AWS Lambda, in the above 2 components, which section/s it will replace ? For example for the first point, will it replace the Console application or the windows task scheduler? and for the second point, will it replace the ASP.NET Core MVC web application or IIS? Or AWS Lambda will not replace any thing but will/can integrate with the above components?

Thanks in advance for any help. and sorry if i do not have much knowledge in AWS Lambda.

CodePudding user response:

C# is not yet native language for lambdas. It is entirely possible to run a lambda with c#, but you have to use a custom docker.

Theoretically, you could make lambdas your controllers in an MVC application - in fact its actually a good design decision to do so. However, given ASP's nature this can become a little tricky first time. They would have to be behind API endpoints but with a little work in the configuraiton you can distribute the controllers across lambdas.

The scheduled tasks are perfect for lambda as well, but again - not c# native.

There is not any default Windows images in AWS. Honestly, if you are going to do a c# ASP app you may want to consider Azure instead, as it natively interacts with C# and ASP where you have to hack the options together in AWS

CodePudding user response:

In short, AWS Lambda or Azure Functions are special types of application models for the cloud based solutions, not traditional console or web apps. Don't make any attempt to associate them with each others, as they differ significantly.

Such cloud applications won't take place of tradition app models any time soon, as not everyone is moving to the cloud.

  • Related