Metamorphosis of a butterfly with the .NET core and AutoMapper logos

Using AutoMapper with ASP.NET Core 3

AutoMapper is well known in the .NET community. It bills itself as “a simple little library built to solve a deceptively complex problem - getting rid of code that maps one object to another,” and it does the job nicely.

In the past, I’ve used it exclusively with ASP.NET APIs. However, the method for utilizing it via dependency injection has changed. So let’s review how to get started, how to define mappings and how to inject our mappings into ASP.NET Core APIs.

read more

Fireworks with Michael's avatar wearing a new years hat.

Cheers to 2019! Bring on 2020!

Thanks for the memories 2019. You were a good one.

2019 wasn’t without some struggles, but there were several huge wins that I’ll never forget. One of the things that I started in earnest in 2019, that led to one of the most dramatic changes in my life, was live-streaming on Twitch. In addition to the amazing people I met, it awakened a passion in me to help others succeed which led to a career change. In the last quarter of the year, I started as a Developer Advocate at Nexmo. So now I get to learn, teach and help others succeed and get paid for it!

So yeah, 2019’s been a good one, but let’s see how I did versus the goals I set to start the year and plan some goals for 2020.

read more

Christmas tree decorations with ASP.NET Core logo

Adding HATEOAS to an ASP.NET Core API

I am insanely thankful to be included in C# Advent this year. This is the 3rd year of C# Advent and I always enjoy the dozens of posts by everyone in the community. Be sure to follow the link above and check out the other posts and watch #csadvent on Twitter for updates.

RESTful APIs are very popular these days. When used consistently, they provide a great way to make our APIs easier for users to consume. But how can we make discovering endpoints and capabilities easier? One way is to implement Hypermedia as the Engine of Application State (HATEOAS). You may have seen HATEOAS used in other APIs without realizing it.

read more

Azure App Service, Docker and Azure Storage logos on an Azure portal background

Using Azure File Storage as Container Volume Mounts in App Services

Need to scale your app? Put it in a container. Need more resiliency? Put it in a container. Code starting to smell? Put it in a container. Want some lunch? Put it in a container.

Okay. Containerization is pretty great, but once you start dealing with saving data and/or files you realize you need to add volumes to the mix. Docker volumes provide access to external resources, such as storage, in a way that seems local to the container. Mapping a local drive on the host to the container is as simple as adding a line or two to a docker-compose.yml file.

But what happens when you move to the cloud? Specifically, let’s talk about Azure. If you’ve got files to save in Azure, you’re probably using Azure Storage. Azure Storage provides a number of great features at a very competitive price, but how can we access those files within a container running in an Azure App Service? Read on to learn.

read more

Azure Key Vault, App Service and Function logos on a background of the Azure portal.

Environment Variables in Azure Functions with Key Vault

While working on a project that used a mixture of Azure App Services and Functions, I needed to use environment variables. Having read about Azure Key Vault, I knew that it held all the answers (or secrets.)

Some quick Google-Fu later and my Node.js apps running in App Services were accessing environment variables with process.env.{secret}. Using this newfound knowledge, and to no avail, I tried to give the same access to my Azure Functions running in App Services.

After much web (and soul) searching, I found the solution and would love to share it for the benefit of future generations.

read more