Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Yes You Can! Develop on AWS Using .NET

DZone's Guide to

Yes You Can! Develop on AWS Using .NET

You may be surprised to see just how much AWS supports .NET-based projects, even for serverless applications. We take a look at just how far support for .NET has come in AWS.

· Cloud Zone ·
Free Resource

Insight into the right steps to take for migrating workloads to public cloud and successfully reducing cost as a result. Read the Guide.

About a year ago I've started working with a client that had his several ASP.NET websites running in AWS, at the time it seemed like a wrong decision — when we think about ".NET" and "Cloud" Amazon's Web Services (AWS) does not sound like the first choice. In fact, one of the ideas we had is to try and move the client's code to a more ".NET'ty" environment (rhymes with "B-zure").

But we didn't have time to start schlepping code between cloud providers. We had our hands full — we've wanted to modernize the code base, break it into microservices and create complete CI/CD pipeline. Luckily for us, just as we were starting the projects things have started to change, which made AWS a .NET friendly cloud.

The first piece of good news was the introduction of .NET Core, it meant that we could write .NET code and run it inside a Docker container, it also meant that the code we've developed on our Windows machines run flawlessly on Linux servers hosted in AWS.

But that was just the beginning, because AWS has started to become a very .NET friendly place first by introducing the AWS SDK for .NET and the AWS Toolkit for Visual Studio.

By using the AWS SDK (via NuGet) we could now write code that uses AWS services from the comfort of our .NET Code:



AmazonSQSClient sqs;
receiveMessageRequest = new ReceiveMessageRequest
{
    QueueUrl = queueUrl,
    MaxNumberOfMessages = 1
};
var response = await sqs.ReceiveMessageAsync(receiveMessageRequest);

var message = response.Messages[0];

string result = message.Body<

Using the AWS Toolkit we could create new AWS projects and administer our account(s) from within Visual Studio — which helped us quite a bit, especially when our project started heading down the serverless road:

That's right — we can write AWS Lambdas using .NET Core, which can outperform Lambdas written using other languages such as node.js, Python and Java.

With the new .Net Core 2.0 support (starting 2018) we were able to share code between our servers, Lambdas and legacy systems and it worked beautifully.

So there you have it — just because you have .NET code (and .NET developers) it does not necessarily means you cannot be productive in the AWS cloud.

If you want to learn more about .NET and AWS I have a talk " Harnessing the power of AWS using .NET Core" in the upcoming Cloud Developers Days - it has an amazing agenda of all things cloud and from my experience will be an amazing conference.

If you're around come by and say hi!

And until then, happy coding...

TrueSight Cloud Cost Control provides visibility and control over multi-cloud costs including AWS, Azure, Google Cloud, and others.

Topics:
cloud ,.net ,aws ,lambda ,c# ,.net core ,web dev

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}