Digging into .NET in AWS - .NET 188

All cloud service providers have a learning curve and AWS is no exception. Garo Yeriazarian has been working with AWS for a couple of years now and has a lot of practical advice for working with .NET in AWS. AWS doesn't necessarily make it easy for you to get started but following Garo's advice should help flatten the learning curve. Once you have familiarized yourself with AWS you will find that there is a lot of parity with Azure. Who knows, after listening to Garo you might be tempted to try AWS out for yourself.

Special Guests: Garo Yeriazarian

Show Notes

All cloud service providers have a learning curve and AWS is no exception. Garo Yeriazarian has been working with AWS for a couple of years now and has a lot of practical advice for working with .NET in AWS. AWS doesn't necessarily make it easy for you to get started but following Garo's advice should help flatten the learning curve. Once you have familiarized yourself with AWS you will find that there is a lot of parity with Azure. Who knows, after listening to Garo you might be tempted to try AWS out for yourself.

Sponsors


Links


Picks

Transcript


Hello, and welcome to another episode of adventuresin.net. I'm Sean Kleber, your host. And with me today are cohost, Wai Lu. Hello. How are you doing?

Hey. Good. How's your weekend? It's starting out well. Yeah.

It's been really cold, though. If you can see my massive jumper that I'm wearing. So Yeah. Being very cold here. So And then we got Caleb Wells.

Are you flooding away there, Caleb? It's it's pretty nasty down here. It's been a very wet spring, and Baton Rouge got destroyed, for lack of a better word, earlier this week. Lots of flooding. New Orleans, right, we're kinda used to it.

So it's it's been very wet, but it's alright. We're we're good. We're safe. So Alright. Good.

Good. Good. Good. Alright. Our guest today, Gaurav Uriasarian.

Here he is. Garav. Glad to be here. Glad to be here. Thank you, John.

Thank you for joining us. Thanks for inviting me. Yep. We'll see if you might be back after this. What are you gonna do?

Why don't you tell us a little bit about yourself? First, just how you got into development and how you got into dot net and what you do now. So I've I'm in Houston, Texas. I was born in Houston, Texas, went to school in Houston, Texas. Working in Houston, Texas.

And currently in Houston, Texas. And so the University of Houston is interesting because we had this, like, Microsoft came. This was 2002, and they're like, hey.net. And we looked at it. We're like, that's nice.

I know Java. How is this different? And I didn't really think too much of it at the time, but then when I started working full time, you know, I guess, we had this big kinda desktop project we were gonna do. And the developer said, no. We're gonna do it in dot net.

I was like, okay. This sounds like a good thing to learn. And that's just kind of alright. Learn it and do it. So Visual Studio 2,002, that was a bb.net project because, apparently, bb.net was better at the time.

And then c sharp caught up, and now c sharp is quite better at the time. So c sharp is the way to go, and and that just kinda took off. And that's what we use for a lot of projects going forward. I got into development really early age, but I think it was I don't know how old it was. I was probably 10.

And my dad got this computer, and, you know, he's learning how to do computer stuff, and and he found some games from his coworkers. I'm sure they were legally purchased. I'm not sure. And they were like, oh, no. I'm playing games.

He said, alright. 1st, you have to learn it. So he gave me this book on DOS, and he's like, learn this book. I'm I'm, like, 10 years old. I'm like, okay.

Let's do that. So turns up, I get really good at it. And so whenever he is talking to friends, they say they have a computer problem. He gives the phone to me and says, no. You you go ahead and figure out what's going on with this.

So here's me, 10, 11, 12 years old troubleshooting over the phone, doing tech support with all my dad's friends. So it's, fast forward They paid you. Right? What is it? They paid you for that.

Right? What? You guys paid for doing that? What? What?

He's like, I I helped you. I closed you, and I feed you. Do this tech support for me. Like, okay. I enjoyed it too.

Sometimes I did too much. Because, like, we go to a family friend's house, and and, it'd be like, they have a computer, and they're like, oh, yeah. Garlic's computer's here. I was like, okay. They're like, oh, stop fixing their computer.

Like, no. The memory the memory is, you know, old dock, you know, dust, systems, and you have, like, the lower memory and high memory and everything. I'm like, your memory is not optimized. I have to fix this. I had a touch on your hard drive.

Yeah. Exactly. It's like, you had 12 viruses on here. Did you know that? I can't find them any frustrating than, than troubleshooting things while while like, with my parents, like, on the phone.

It's just like, you know, click this button or which button is it? Is there a thing on the left hand side of the screen? Oh, yeah. I'm lucky. My my parents I live down the street from my parents.

So if I need to, they're like Oh. Pay this thing. And I'm like, okay. I'm just gonna walk over. This is this is gonna be a joke.

But it when my worst time was when my parents first got on to the Internet, like, really, truly. Like, I got on the Internet first. Me and my brother did. Right? So America Online.

You know? And then they get on the Internet once we have cable and everything, and that's when it's like, no. You don't have a security problem. That that's a pop up. Like, no.

But it's telling me that there it's detected viruses on my machine. Like, it hasn't. Just close it, please. Don't click anything. I clicked it.

Like, why? Question. Oh, yeah. Yep. It's funny.

Most of my family has moved to Apple and Macs. And I told them, I don't work on Macs. I have before. I will not do it again. You're on your own.

I really have not used Apple and since the Apple 2 days. You know, I never really got into Macs. But in in junior high and high school, it was all Apple 2. Even in college, Apple 2 Apple 2. And then my personal computers that I bought at that time were an Amiga.

So just for playing games and things like that. So that was a lot of fun. And then I got into video production, but it was still PCs and, Amigas. Nice. Actually, this so so this is my first MacBook of all time.

I just my work laptop was just cycled out. New one came in and, like, alright. Well, all we got is MacBook. And I'm like, okay. Let's try it out.

It's been interesting. I think with with dotnet where it is talking about dotnet again. With dotnet where it is now, like, getting it on the Mac and running it, running Rider, it's just running that native on macOS is very clean experience so far. And we're we're it's been a really fun time to try to take take kind of my old muscle memory of, like, Visual Studio and Sharper and bring it into Mac and just trying to to get it right. So we still have a lot of projects that are that are full framework, and so the VM comes on or boot camp and full Visual Studio comes up.

And so but it's it's it's been nice. It's been it's not as nice. It's been a new experience that's been enriching to to see how we shift back and forth and and how dynamic development on Mac is actually quite good. Are you just using Versus Code? Yeah.

I I tried Versus Code with c sharp. I didn't like it, personally. Yeah. Of course. Yeah.

I think c sharp is one of those things, but v s p like, Visual Studio still benefits, I think. But, you know, using 100% agree. 100% agree with you. I think the Visual Studio definitely is the best with c sharp, but I I think Rider Rider's pretty good. I think it's they have the benefit of being able to say, okay.

Let's let's start over and say, well, I wanna build an ID. I don't I wanna just build an ID. I wanna start from a Sharper and then build file safe around it and add a text editor. And now we have writer. And suddenly, it's like the tooling has simplified to the point where you don't have to go through 6 different points.

In Rytr? Rytr, r a e r. JetBrains. We actually we well, I think we did an episode on this. You may not have been on there, but we actually dug into how JetBrains developed Rytr Uh-huh.

And and how it's grown and how they're they had to take ReSharper and they're, like, IntelliJ and other stuff and, build into their own, IDE. So Yeah. I actually I generally really like IntelliJ's, the the IDE, actually. Years ago, I was using WebStorm. I think they they created that.

So Yeah. For for PHP, WebStorm is is great. We have a we have a client we're working with that they they're doing a lot of Go development, and then, Jeff Raines has one called Golang, which is their go their go version of the IDE. But, yeah, Roger's Roger's pretty good. I mean, it's an IDE, and it works really well, and it was really easy for me to take the project I built in visual studio in dot net core.

It was a Azure function project and just open it up in write our solution and everything, and it worked. I shouldn't sound so surprised, but it's, like, oh my gosh. I'm like, the year is 2021, and I'm able to open dotnet some stuff across solutions. Like, this is crazy. So, talking about running dotnet in non, you know, customary environments, I think according to you, you don't have to use Azure to run dotnet.

Don't have to use Azure. I know this is crazy. Right? Yeah. You can run dotnet on non Microsoft platforms.

So trivia point, I was running dotnet on Linux in some projects I was doing in on, 2015, 14. I mean, 20 2013 to 14. We were actually running, we had these embedded Linux Raspberry Pi style ARM boards. They're called BeagleBone, and they ran Deviant. And so because they're running stock Deviant, I can install mono, and we're running c sharp code, ASP dot NET web web API running on mono on the Raspberry on the we call it a Raspberry Pi, more or less Raspberry Pi system.

And so we built all we developed all our stuff on Windows, and then I'd compiled in Windows, and then I just secure shell the binaries across into the device. And, of course, portable PE format, it would just work. And it was great. Like, super productive. I didn't have to mess with a bunch of native code.

And so cross platform dot net is was a thing from way back way back in the net. Now with dotnetcore, it's just so much easier to to make it across platforms. But like you said, Sean, the Azure is not really required. You can run dotnet pretty much anywhere. Half container will travel in a lot of ways.

Right? If you just have a all the dotnet file containers, even a 3 one containers are all available on Microsoft's registry, which is the Docker registry, and you just load up your code and execute in a Linux environment. So usually, they're Debian or even Alpine has a dot net, image you can use as well. So alphine Linux is kind of lightweight Linux distribution for container based application. And so the base OS size is about 10 to 15 megabytes.

And what I found was that that runs really well. I can run most of the dot net stuff in that small form factor, and I can run on Azure. I can run on AWS. I can run it natively. I can run it in whatever I want.

So how do you get started with dot net and in Eddie AWS? I well, I've dotnet was my main background. It's kinda where our default, you know, for projects and things. And so we had a client that all their things are in AWS, and so we needed to build an AWS application. So my first thought was, okay.

Well, is there something easy that I can jump into and do? Because Azure has app service. And app service is very easy. If you follow the happy you know, if you if you do the happy path on Windows and you you upload everything exactly how the defaults are, then app service is great. Amazon didn't really have a happy path.

Going through it, it's a lot of research to figure out, how do I deploy dynamic code in Amazon, in AWS, and how do I do it easily? Because we had a single ASU Net Core application. I don't need a huge infrastructure to run this. I should be able to just run something. So what I found was Elastic Beanstalk.

And AWS Elastic Beanstalk is it's a set of patterns for regular application, where if you just have a single application or a few applications that need to interact with each other, it helps you build the common patterns, and it sets up everything for you. So you say this is a dot net application. I need the well, so it offers you a database, but the rule number 1 of Elastic Beanstalk is thou shalt not take the database Elastic Beanstalk offers you. So it's funny because every tutorial I read says it has this. Do not any under any circumstances, use that data.

Because if you click the wrong thing, it will decommission the database for you and rebuild it from scratch, which is never what you want to do. So that was a quick one in all the how to guides. And so it it will build a load balancer. It will build the EC 2 instance for you, which is their compute VM. It will manage it does a lot of management around it too.

It's really cool stuff where it'll it'll swap out the operating system for you and upgrade it and keep things fresh and clean, connect you to the log. It it just it's app service, but you get to peek a little bit under the covers of how app service would work. So if you imagine that I have a a virtual machine that I put in the cloud, I have the core operating system. I have dotnet runtime on top of it. I have my application running on top of that.

Then I wanna have the load balancer in front of it. I need to set up scaling rules. I need to set up logging. I need to set up kind of deploying the versions of my application. And so it it gives you the scaffolding that it manages using the other AWS tools and does it pretty nicely.

I know with Azure, like you said, if you're starting out, they make it super simple and super easy, especially, like, if you're using Visual Studio with the new published stuff. Well, absolutely. But, right, the the bigger your app grows, the more you need to do, the more complicated it gets. And it can it can be a little obtuse. Right?

And you have to go digging. For instance, we were figuring out firewalls and, limiting access to Cosmos DB by using the the I'm roles and all that stuff. Security is a beast, I think, in any platform. How does that compare to AWS, or how does it work in AWS? Funny enough, I I found AWS was easier to understand than Azure when it came to security.

And I think part of it is you hear a lot about how the AWS teams are organized when they have this I think they call it white spacing or or segregation of the teams, and and there's the whole, like, Jeff Bezos says, thou shalt use APIs for everything. And it what's what's interesting is that it it's very easy to see. Here's the API that the service is using, and here's how it communicates between these two parts. And so you can actually learn how this one service functions. And you can observe the services it uses and see, okay.

How are these things related? And and understand how it's put together. So when it comes down to security, it's very clear, like, this it's gonna touch your API call is made. 1st, it's gonna verify on your IAM credentials, whatever you're using to call the API. Are you allowed to call that API?

And then on the receiving side, it says, is this person allowed to call me? And so when both sides agree, then the API call succeeds. If they disagree, then you have you have an opaque failure that says, something went wrong. Go figure it out. So there is that same, you know, Azure and AWS agree on that one where it says something went wrong.

Go back go pound sand and figure it out. Come back to me when you fix it. So but what's interesting was in AWS, once you get past that, the API stuff, and you see there's tools for you to check-in. There's CloudTrail, which lets you see the API calls that are being made. And so you can see all of the services that are being called.

And if you have something that errors out, you can actually troubleshoot that in a not completely easy way, but in a possible way. So, like, I haven't used AWS. So you're saying that when you actually make a call on, or when you have an operation within the, like, their their portal, it will actually show you the the rest API calls to them? Yes. Oh, that that would be really interesting.

I've always wondered, like, when like, in in especially in the Azure portal, like, if if I just create a, like, an app service or something, it it would have been really good if it actually shows you the actual, like, the CLI command or something, because I hate going through that portal and clicking, like, multiple clicks. It'd be good if you I can just create a I know you can export it into a template and all that stuff, but, you know, that CLI is so useful. It'd be good if you just showed me the command to create a VM or whatever in exactly the specification I wanted. Yeah. It it's definitely useful if you're trying to learn.

So Mhmm. I think it's useful if you're trying to learn AWS, but first, you have to learn that CloudTrail is there. You have to learn how the IAM, the identity access management works. You have to know to do these things, and that's that's kind of like step 0 that when you're getting into AWS, it's it's not something that you can go into Visual Studio and say, make it all work for me, and it hasn't happened. With with AWS.

You have to initiate your security settings in AWS first. So if you don't have that user set up with in AWS with the access that you want, it's not gonna work at all. Like, it can't it won't communicate. Nothing will work. It'll say you need to create a user.

You need to create a profile. Mhmm. And until you get that, you don't really know what's happening. So the developer story to get started is very different. But once you get into the middle of it and you learn the basics of how IAM works in AWS, then it it's a lot easier and natural to to start troubleshooting things and to see how services work and checking permissions and policies and understanding how they'll be communicating.

So in Azure, it's very easy to spin up a bunch of different services and have them talk to each other and not really factor in security upfront. Right? They they may give you warnings to say, oh, we we suggest you don't do this or you should do that, but you you can go ahead and do it. So what you're seeing with AWS from the get go, they're they're basically saying, you need to make this secure or secure as you can before you even get started. Yeah.

It's a little bit weird for because, you know, dot net developers are used to Visual Studio and Azure and Microsoft's happy path. And it's like, oh, I'll just go ahead and do that for you. In AWS, it's okay. This is a this is a secure environment. So if if you even try to use the the main account you use to access your AWS account, if you try to use that those credentials in Visual Studio or in other places to access your account, there's a bunch of red flags.

Like, hey. You should not be using your root account, the your login and password to access any of these things. And every single page on AWS has that warning. It says don't do this. Don't do this.

You should not do this. And they make it hard for you to use that too so that it's you there's no question that you're doing the wrong thing. And even once you get into it, it does spin up resources. By default, there's no access. By default, it's it's completely locked down.

I can create a VM, and I can't secure shell into it. Yeah. I can't talk to anything. It spins up, and it says, I'm starting to bill you even though you can't see what's going on inside of here. I'm you're you're starting to pay me money.

So you figure out what you need to do to actually talk to the VM. So you need to make sure you have the secure shell key pair set up. You need to make sure the networking is set up so that you can actually go step by step to talk to the the VM. And then the VM talking to the database, same thing. The networking steps in between, you have to make sure that each step is configured so that you can have the 2 pieces talk to each other, which is good because it does teach you to do things the right way.

It really nudges you away from the okay. Just open up all the security and just let everything talk to everybody. Just just put the database on the Internet. Don't worry about it. Yeah.

One of the things I did in a recent project. Right? It was it was the opposite. And I'm not saying Azure is not secure. I'm just saying you have to go through more steps typically to to lock it down and make it secure.

Right? And so the team I joined have been working on our project. Right? And it was head down. We gotta get this stuff done.

We gotta get this stuff done. And then 8 months later, their internal IT team did a security op, and they're like, this is a problem. This is a problem. This is open. We can access this.

What's and, of course, we gave them, basically, our root account to look at everything. They're like, none of this looks right. And so we spent 2 months back and forth off and on tightening things up and and securing stuff. I like the I like the perspective AWS takes once you know what you're doing. I can imagine this frustrating in the beginning when you don't know what you're doing.

It can get definitely get extremely frustrating. I know that I I had to sit down and psych myself up to to get back into it and say, you know, I'm an experienced developer. Like, why is this so hard? Why can't I understand how this works? Like, trying to set up a cloud formation template, which is the kinda like, on templates for Azure.

This is the built in templating for Amazon, AWS. And it's very low level. It's okay. Here's the VM. Okay.

Now security group rules. Okay. Now I'm policies and groups and and on all the pieces. I'm like, I there's no way for me to tell how these pieces really fit together just jumping into it. And so I can't start there.

Luckily, there is a better option now for people getting started, which is, Amazon, has a thing called CDK, the Cloud Development Kit. And it's similar to it's similar to, if you've heard of Pulumi, where you're using either TypeScript or c sharp code or Python or JavaScript to to create your deployment environment declaratively. And what's great about that is that with the TypeScript version, they've created a lot of blueprints, like Azure blueprints that say, hey. By the way, you're gonna you're gonna create this VM. If you call this extension method, it will go ahead and set up the networking exactly how you should.

And if you have a database set up in the same area and you wanna connect it to, well, there's an extension method on the other one that will let you connect 2 pieces together, and it'll build all of the rules in between for you. And to slowly kind of help you to understand that, oh, this this little extension method or this extra method on here says, I can add this this resource, and it'll build the right resources to connect them. And then you can see how it actually did it by looking at the confirmation script that's generated and gives you the resource list. It says I created these 3 policies and these 12 networking rules and and all this other stuff happened for you to get disconnect. What about the, because I know Azure has got re pretty good, documentation, especially with their, like, Microsoft Learn courses and things like that.

Does AWS have pretty good, like, a pathway that they that they have to onboard new developers? I I tried to go through their doc their documentation side is very declarative. It says, this is the documentation. This is the API call. Here are the parameters of the API call.

Here's another API call. And it it's very, like the developer wrote this. It's what it is. There are some introductory things, but I find that the introductory thing still kind of gets to a point, and then they give you bad advice that says, okay. Now just to make this work, go ahead and turn all these rules off, and then here is your thing working.

I'm like, no. No. That's not what I want. We our company, the company I work for, HeadSpring, we just started on the path of, like, becoming a it'll be as partner. And so there's a lot of partner training materials, which are great, and, like, certification training, which is great, which helps you do things the right way.

So they have a bunch of training materials if you go, deeper into it, which really helped to put the the pieces together better. And they talk about IBM being the the core thing that you need to understand first and how to do things the right way first, and then go into those details. A lot of the examples you'll find out there are gonna be all Azure based type, how to build something, how to get something ready. Is it fairly straightforward and easy to translate something from Azure to AWS? Translating from Azure to AWS, I I wouldn't really think of it that way.

I I would think of it Like like like Azure functions, you know, if somebody says use Azure function, well, you gotta over the AWS, you gotta AWS Lambda, something like that. Okay. You know, you got compute versus VM. So is is most things a one to 1? So so when I when I was learning it, I thought that there was a lot of different ways to do this.

But when I actually did it, I've I've been working on AWS now for about a year and a half. And I've noticed that there's really only 3 ways to deploy something. In all of the different services and pieces and everything, there's really only 3 ways to do it, and it's actually coming down to 2 ways to do it. And one is Lambda. Lambda is a big one.

Right? AWS Lambda is like Azure functions, and it's effectively a container on a VM, and it runs your dot net code. So it's a container deployment. And, also, you can deploy onto a container using the elastic container service. So, again, you have a a Docker image registry, and you pull your image down, and you run your container in some compute environment.

And then the the last way is you spin up your own virtual machine, and you deploy your code however you wanna deploy your code. So if it's just, you know, secure shell updated or you've got it on a bucket somewhere and you just load it in, there's different ways to do that. But when you actually execute the code, it it all executes the same way, which was really why I like AWS because it it does make it very simple to explain that way. With Azure, I find that app service has this, like, okay. You've got Windows, and there's IS somewhere.

There's some kind of function host, and there's other things going on that you're not really sure. Or if you're running in a container environment, it's it's there's Kubernetes behind the scene, and you're running container instances. It's a lot of different weird stuff going on. Whereas AWS says, you're you have a container. I'm running it somewhere.

That's it. And the thing that's different is that if I run on Lambda, I have a time limit, and I have a a memory limit. If I run on elastic container service, I get to decide how much I want, and it's a longer running service. So if you can understand how those two models work, you can pretty much deploy any code anywhere in AWS. So when it comes to the features in AWS or the resources, right, there's 100 in Azure.

Based on your experience, do you see there to be a good bit of parity between AWS and Azure, the features that they offer, or the functionality that you can can use in their clouds? Absolutely. Between Azure and AWS, the the main the core services are the same. They're just named differently. So in in AWS, you have to figure out what is it actually called.

And same as in Azure, what what do I call it in Azure? What do I call it in AWS? But if you stick to your building blocks, you know, you have your compute. Is it a container image, or is it a function or serverless function? And then how is my database hosted?

Azure SQL versus Amazon's RDS. Do I have a a kind of more object storage, Azure storage versus s three buckets? Do I have something more complicated, like Cosmos DB and Dynamo DB? So those are very similar. Cosmos db has a lot more interesting stuff to it, and I think they Microsoft has built a lot of really cool so the way I see it, Cosmos db is, like, Amazon has or Aurora, which is their serverless database technology.

And so Cosmos is like Aurora plus Dynamo, had a weird love child, and it's Cosmos DB. And it's really fascinating because I did a small project on Cosmos DB, and you pretty much at the start say, okay. This is the weird flavor of Cosmos DB I wanna use. And then it spins up a compute that translates your your commands to Cosmos DB to use that flavor. So you can make a graph database.

You can make a SQL database. You can make an object store, and it just kinda changes. Amazon has different services for this, which is again, you gotta figure out how the different parts work, but I really like the Cosmos DB approach, which is kinda really just oh, that's really clever. I kinda like that. So, yeah, feature parity between them.

So the things I would go for, I need to know where my queues are. So Azure service bus versus SQS, notifications, and databases, and compute. So feature parity is definitely there between them. Is cost similar? I wanna say it's competitive.

I know that if you're trying to run Windows workflows on AWS, it's definitely more expensive. And but But it's that's quite the case of Azure as well, to be honest. A a a large component when you if you if you just opt for the Azure hybrid benefits and stuff like that, it's actually a lot cheaper because a lot of a large component of the cookie cost is actually licensing. Yeah. Yeah.

Amazon does have that same option. You can you can run it, but I I think they end up charging a little bit of premium for Windows workloads just to just to hit Microsoft a little bit. But most of the time, you don't need it. At least at dotnetter, you you just just don't need in Azure, I think they're kinda pushing us into, Linux now. Like, because of the lower cost, and I think that's kinda where Microsoft is heading.

I completely agree. I've seen that too where where they the default on, like, Azure Pipelines for doing builds on Azure DevOps. Going through latest is has many more features and cool stuff that you can use than the Windows, based image. Like, for example, we had a project where we were doing a Postgres we had a Postgres database, and I wanted to run unit tests with the Postgres database once preinstalled on the the hosted the Microsoft hosted a bunch of latest image. And so in my build pipeline, I say, okay.

Pseudo service start Postgres, wait for it to spin up, and then I run my unit test against the Postgres database that spun up in my build image. Mhmm. And then everything just gets ripped apart and torn off when it's done and burned into oblivion. So when somebody's first starting out, what are what are the kind of the the key things that they have to put in place to get their, you know, their hello world or their to do app running when they're just when they're just learning AWS? So once you get your account set up so to get your account set up, you need credit card.

Any credit card will do, and you can spin it up right away. Once you get that, the because there's no there's no, like, trial period. There's no, like, hey. Like, Azure has, like, let me give you $50 credit. You don't have to tell me anything.

Amazon says, no. I wanna know how you're gonna pay for this. So step 1, figure out how you're gonna pay for this. Step 2 is setting up your IAM user. So you need to create a a user account that and you can give an administrator permission to start, but you need something that's not your root account password that has an API key and a secret that you can use to make all of your other commands run.

And this is fairly common to do. Once you learn more, you can then tune it down and say, okay. I only need to do these four things with it. But for the most part, you wanna just create a user that is an administrator of your account that can execute all the stuff that you need. So when you run your command line tools, when you go to Visual Studio, you'll use that access key, which gives Visual Studio the ability to talk to your AWS or Versus code or whatever ID you're using to look at your resources.

There are at that point, there's a few different ways to go. There is a recently announced container based deployment tool for, that was only JavaScript and something else based. They just announced another, like, developer preview. So there's a Twitter account I've I've been following, which is the AWS dotnet. You see exactly what it is.

I'll send you off on the link when you get a chance. So AWS has been posting a lot more dotnet stuff. Because with dotnet 5, it's even easier to set up a ready to run instance to deploy code. So they're trying to streamline the way in which you make a container based executable. What I do recommend though, for people just getting started, I do recommend Elastic Beanstalk because it does walk you through a lot of settings and gives you a lot of options to see how things are deployed.

And they have a native.net solution as well, so you don't have to work with a container image. You can actually deploy your dotnet code directly into Elastic Beanstalk, and run it natively. So I would recommend Elastic Beanstalk. If you're just getting started, I would recommend the database that's built into it. But when you start doing serious work, then your database deployment should be a completely independent separate thing.

So do you have any experience with big data or machine learning AWS? I know Azure is pushing synapse and their data pipelines pretty hard, and there's a lot of cool stuff you can do with it. Do you have experience with that in AWS? I've looked at it, but I haven't I haven't done it professionally. But the stuff that I have seen was interesting in that you could tell it's it's combining the pieces of things that they have and turning it into a big data solution.

So they have this this data link formation tool that will set up your s three bucket storage for your your, your big data. And s 3 s 3 is like the everything service. Every service on AWS probably touches s 3 behind the scenes one way or another. S 3 is the the block the object storage. And it's such a cool service.

It's like the first service that they launched, and the the more I learned about it, the cooler it is because it's it just does everything. So you start from the blob storage, and then you build on top of that with these indexing tools. And they actually have a a technology called Athena, which will crawl will crawl your s three bucket. Like, if you have a bunch of CSV files or parquet files or some other sort of object format, It'll crawl all those, figure out the schema, and then you can run SQL queries against it. It performs about how you expect it would, but it it does make it possible to do interesting things with just an s three bucket and some other technology on top.

Now with with Visual Studio, it's really easy to connect it up and do things right in Visual Studio versus Azure. Are there similar add ins, plugins for connecting up to AWS right from Visual Studio? I haven't actually looked at that. Yeah. So there is the, AWS toolkit for Visual Studio, and it will install the there's also a set of templates for dot net new that are the AWS templates.

And they're the same ones that show up in Visual Studio's new project menu as well as the dot net new kinda command line tools. And so you have a pretty good starting point. And what they tend to do is they'll use what's called another deployment technology because everyone's got their own. They use one called serverless framework or serverless, not server not serverless.comserverless, but serverless the serverless application model that's AWS. AWS is kind of flavor of this.

And what it is is it will let you use a YAML file, yay, YAML, to define yeah. Get another YAML file. It'll let you define the services you want and also the the core compute you have, and it'll set up a good default template for you. And then it'll trans transpile that into CloudFormation and deploy that. And that's really like a low friction way to create individual resources as well, starting from the the templates there.

But if you have an existing application that you're trying to deploy, I do recommend Elastic Beanstalk. But if you know that it's gonna if you're thinking about doing, like, a serverless application, then you definitely wanna go with AWS templates to start. But yes. So b s code has a plug in. They have extension for AWS toolkit.

Visual Studio has 1. Rider, I think, has 1. They've been developing a lot of these things. And then also there's the command line support altogether. Very cool.

What things haven't we, covered that we should know about AWS and and dot net? I'm sure there's quite a bit, but, you know, a limited amount of time. But Yeah. It's been an interesting journey with it because I I felt like, at first, that it was trying to fight me. And, then I realized that it's the core thing I realized was it's just a container.

Lambda, just a container. ECS, just a container. Even the things I'm running on Elastic Beanstalk, it's effectively like, let me take your application just to kinda drop it into a Linux machine and simulate the fact that it's not a container, but we'll treat it like a container. And that really helps to to kind of hone you in on what you're really doing, to think about how you would run dot net code in the cloud. But when you think about that, it's the same way you'd run any code in the cloud.

It's still running in some sort of containerized environment and with isolation in place to make sure you don't touch anybody nearby. So the things that you learn for other serverless or cloud based strategies, you would apply to dot net exactly the same way. Have you set up any have you set up any hybrid environments where you got some things in AWS and some things on premise? I have not done that yet, except unless you call whatever running on my machine on premise. But it's on my premise.

I haven't set that one up, but what I found was that the AWS networking tools lets you really kind of understand how that gets set up. When I was going to the AWS training, it was really clean explanation of how your networking is configured and how you start from your virtual private cloud surrounds everything. You've got public subnets and private subnets, and how these all communicate is very clean. And so it's a very well defined way to do it. And, really, if you set up your security groups the way that they should be and it allows us to write access, then it should behave the way it should.

Keyword should. It should work. So can I borrow one of your credit cards just for a minute? Oh, yeah. I don't like it.

Take a look at the US. My company card right here. I'm totally fine. Because right I'm I'm so used to to Azure giving me a little bit here, and I can I can take a little bit there and and, you know, paying pennies on a dollar? I'm gonna need to find a credit card to test this out.

So when you do sign up for an AWS account, you do get access to what's called free tier for the 1st year. And there's some things that are forever free and some things that are free for the 1st year. And so there's a lot there's a lot of you get a lot of flex with that that you can do for the 1st year. And, like, I was I was doing some I have, like, kind of some other things running on my AWS account, and it's been more than a year. And so I think there was some I get billed, like, a dollar a dollar 60¢.

And I was like, oh, yeah. That thing's still running out there. But AWS billing tools are top notch. You can really see you can really see the details of what's running in services. The thing that's not top notch is when they start billing you for network transfer between the cloud and people and between regions as well.

And there's a little bit of black booty magic that happens there. But if you can if you can get over that part, then it's pretty straightforward. It kinda sounds like the DATUs or whatever DAUs that Azure is using. Is that because that has been one of the biggest sticking points with, like, my boss or clients. It's like, well, how much is this gonna cost?

Yes. I'm like, well, we'll we'll have a we'll have a good idea after the 1st couple of months. Mhmm. You're right. Right?

Exactly. And it's fine because AWS gives you that same advice. They're, like, they're, like, try it out and see how it works, and then you'll know how much it's gonna cost. Like, wait. You can't tell me?

It's, like, no. Good to know. Good to know that they're are they're on the same page there. Exactly. So are there are there emulators you can run locally?

You know, kinda, like, there's some of the Azure stuff you can run locally in in an emulator. So AWS has this I don't know. It's not it's kind of an unofficial project, but it's called local stack. And since AWS publishes their APIs, people have taken these APIs and created a an emulator that runs a a large number of services of AWS containerized locally in your system. And so it's it's a good enough equivalent to run testing and some some, end to end testing, and unit testing like that.

So you can spin up the local stack, configure the pieces you wanna configure, and then run your code against it. And it should be equivalent. Yeah. I use the, Azure storage for well, when I was a dot net project, I used it almost every day. Right?

So that's good to know. I think that's one of the good things about, Azure functions, actually, the fact that you can just bay basically download the local instance and start running it off there. Just means do debugging is a whole lot easier. Yeah. I know Azure has some I know that I work with, Jimmy Bogart a lot.

I know he's been complaining a lot about the Azure service bus does not have a local story at all ever. Mhmm. And you just it just there's no way to run it locally. There's no way to test it. Yeah.

On the cloud. Mhmm. I think more and more stuff there. I think they're saying I'm I think logic apps now you can run, locally, which is an interesting concept, I think. Yeah.

So The Azure Compute Emulator lets you run I mean, at least at the dot net code, everything just runs. So if you're running Azure functions or logic apps, whatever, it's it's the new run time. So the so Azure Net 5 is really just running and actually the process. It's just a worker. So it runs the same locally as it does in the cloud.

In AWS, everything is up. So there's only one way to run. There's no there's no kind of weird stuff around it. It just says, okay. Here's give me an entry point.

I'm gonna call your code. I did a really weird thing recently. I wrote a bit about it in a blog post, and I've been using it in a project. And so I took there's there is a library's part for this, which is take your ASP NET Core pipeline and run it in a Lambda function behind an API gateway. And so what it does is when the Lambda spins up, it boosts up your ASP NET Core application, and then it executes one request at a time on that instance.

And so as you need more of it, it will use it'll reuse the run times, the the running instances of the Lambda to execute your parallel requests. And as you don't need it, it will let them spin down. And then using so what you've got now is that you've got it scaling out to whatever you need up and down and using the Lambda infrastructure to run it. So positive is that you can spin down to 0 if you need to. Your application can go completely dormant.

Downside is that when you do spin back up, you pay the cold start cost. And, currently, if you're using entity framework core, that cold start cost is expensive because it's spinning up all of your objects. There's a bunch of things that it does at this time to spin up all of your, your kind of dynamically compile things. And I thought they're working on I saw some blog posts that for EF Core 6, but they're working on a on a a source generator or something that pre precreates all that stuff for you at build time, which would be great. And then, also, any reflection you do is just gonna be expensive whenever you have your Lambda spinning up.

So the more you can get reflection free, the more you can do ready to run, your your start up time is gonna improve quite a bit. But if you can't, then running as a container, a long running container instance, is a is a great alternative. Downside, it's running all the time. Upside, it's running all the time. Is it the blog post you did for, c sharp Advent?

Exactly. It's that one. I was planning to do a, for the Houston data user group, I was gonna present about it as well to kinda say, like, okay. Now this was back in December 2020. Now after running this in an application for a while, what what was my opinion now about running it this way?

And there there's some quirks to it, but, overall, I felt like it was a really fun way to run an ASP dot NET Core application. I think I would like it better if I'm using DynamoDB or some sort of lighter weight database rather than EF Core with a SQL database. I feel like the startup panel would be a lot better. It'd feel a lot more serverless, air quotes, serverless, and it would it would be a better example altogether. So I'm hoping to to show that a bit more.

Alright. Any other questions before we move on to PIX? I'm still still waiting for that credit card. Oh, yeah? Alright.

Send me an email. I'll go ahead and email it to you. Perfect. But you're gonna have to the way it works is you send me a credit card first, and then I'm gonna put mine on top of it, and then send it back to you. Okay.

Okay. Let let me see what I can do. Yeah. I'm I I may be able to to to figure something out. I can't guarantee the number makes sense, but it's gonna look like a credit card.

There you go. Can you pay in Dogecoin? I don't know, actually. It okay. Can I suppose if you can buy things on Amazon with Dogecoin, then you could probably pay for AWS with Dogecoin?

I don't know if Bezos, you know, wants to, you know, get on the on that train with Elon. They'll go and write a check and mail it to them. Yep. Yep. Yep.

That's even better. Old school. Alright. I'm gonna push you soon to fix. All good?

Alright. I'll go first this week. This week, I was faced with a difficult CSS issue, and I'm sure the only one that's ever had a difficult CSS issue is me. So it was dealing with I had some, dynamic lists, and I wanted them to have a scroll bar on them. But I wanted them to resize themselves based on the size of the screen.

Actually, really, the size of the page. And I kept on trying to do different things. I was trying to to figure out using the calc function with max height on my list, things like that. It just wasn't working right. It just wasn't working right.

So I finally found an article out there that that showed me what the issue was, and it dealt with that I was using Flexbox at the same time. And Flexbox, even though you set max height, it also messes with min height. So you have to specify min heights as well to get the scroll bar. And then, of course, all the parents, all the web page have to be a 100% height and all that kind of stuff. So I'm gonna put a link in the show notes to a guy that wrote a bunch of different articles that are really well, written and lots of handy stuff in there about CSS.

So that's my pick for this week. Alright, Caleb. What'd you pick? So my pick this week is also work related, so to speak. I don't think I've done this one before, but I have a Kensington vertical wireless trackball.

Right? And and I don't have carpal tunnel, but I have had issues with soreness or pain in my wrists and, of course, you know, sitting in a chair and and all that stuff. So bought things to try to fix that. I've been using this thing for 6 months or so, and I don't have wrist pain anymore. It's very odd looking, and you have to get used to using a trackball if you haven't used one before, but it's it's been great.

So that is my pick. It's the Kensington Pro Fit Ergo Vertical Wireless Trackball, and that is a mouthful. Cool. Alright. Wade, what do you got?

Actually, mine's also work related. So I actually got one half of my Azure solutions architect accreditation early in the week. It's good. And I thought I'd recommend the, the the Udemy course that I that I took. I thought, the guy who who, who ran the course who's you know, he explained things.

His accent was a little strong, but, he explained things really well, and he he kind of had the right content, that allowed to actually pass the exam. So I think his name is Alan Rodriguez, and, yeah, he's on Udemy. So, yeah, I thought, basically, with his assistants in the Microsoft Learn articles, I was able to pass the exam pretty easily. Cool. Congrats.

You're here. Now I gotta do the second one now. So Right. The second part. Yeah.

And start over do it again in 2 years. That's right. Yeah. Well, I know you've got this thing now where you don't have to do it. I think you just gotta do it, like, another Microsoft Learn thing, so it's good.

Otherwise, you Renew it renew it now. Right? I think you gotta do some Microsoft Learn course to renew it, but I don't think they've released what that means yet. So I don't know if it's just run through a tutorial when they continue to renew it, or it's like another exam. But you don't have to pay that extra, like, $100 US, which is to take the exam again.

Alright. Girl, you have a pick for us? I do. So I recently became parent as an a parent, not a parent. And, I was looking for yeah.

Yeah. Yeah. I know. So I'm looking for I was looking for an app that would help me track what goes in and out of the child. And I found a good one.

It's called Ovia let me make sure I get it right. Ovia, o v I a, parenting. And it's pretty good. I wanted something that I could share so my wife would actually log in as well. And then so if she added stuff and I added stuff, and we could sync it all between phones and devices.

And so it's been really nice because it gives you, like, little bit of, like, hey. Your kid is the soul now. You should be looking for these things and, you know, tracking when things happen. Because a lot of them are trying to, like, did we feed the child? When did we last feed the child?

How much does the child consume, and has the child gotten rid of it? And so these important questions have to be answered in that order. So it's been really great to to use this to share back and forth and say, so I'm on night shift and she's on day shift or whatever. Then she can check it out and be like, okay. He fed the child.

Good. This this this guy has the materials still. I will retain him. Yep. When you first said that, I like to take care of his would appreciate.

Yeah. Yeah. When you first said said that, it's like, well, food goes in, pee and poo come out. But I can appreciate that because I'm a parent. I get it.

I get it. We're we're dealing with one of those things right now. Stuff's going in. It's not coming out. We're trying to feed them different stuff.

So And I'm in Houston, so a lot there there may be an oil and gas audience to this. So this is a material balance equation that we're solving here. Right? So what goes into the system is processed. We have to measure what comes out to get the efficiency to make sure that things are coming out that should come out and to make sure that enough's going in to keep the system running.

So all you oil and gas people out there, you're welcome. And thank you. Developer for you. Things come out both ends. People, we're sorry.

If you made it this far, and you don't have kids, you know, bless you. I keep telling my daughter, it's a good thing you're cute, okay, after she spits up on me. Alright. Great. Thanks, Gaurav.

That was a good discussion. If listeners have questions or wanna reach out to you, how can they get in touch with you? So I'm on Twitter. Garriere is my Twitter handle, my GitHub ID, my blog site, and pretty much, LinkedIn as well. So if you reach me on social, you can look me up.

Hit me up. Send me a message. You have questions, I'll do my best to answer them. I don't know? I'll tell you I don't know.

That's always the best route. It depends on trying to make something up. It depends. As a consultant, my two favorite words of all time, it's a 10. Alright.

For listeners who have questions for the show, they have feedback, get in touch with me. I am on Twitter. I am at.netsuperhero. I had a little bit extra there. Just because.

And I am Caleb Wells' coach. Great. Thanks, guys. Great show. Yeah.

Thank you very much. Thanks for the invite. Alright. We'll catch everybody on the next episode of adventures in dot net. Bye, y'all.

Bye.
Album Art
Digging into .NET in AWS - .NET 188
0:00
51:32
Playback Speed: