Santa Brought Alexa? Skill it up with C#!

Sign in to queue

Description

So Santa brought you or the family an Amazon Alexa?

Wondering if you can use your C# skills to write up an awesome Alexa Skill?

A few weeks ago, Tim Heuer wondered the same thing. Here’s what he found…

Write your Amazon Alexa Skill using C# on AWS Lambda services

"I had spent a few days getting up-to-speed on Node and the environment (I’ve been working in client technologies for a long while remember) and using VS Code, which was fun.  But using C# would have been more efficient for me (or so I thought).  AWS Lambda services just announced they will support C# as the authoring environment for a Lambda service.  As it turns out, the C# Lambda support is pretty general so there is not compatibility in the dev experience for creating a C# Lambda backing a skill as there presently is for Node.JS development…at least right now.  I thought it would be fun to try and was eventually successful, so hopefully this post finds others trying as well.  Here’s what I’ve learned in the < 4 hours (I time-boxed myself for this exercise) spent trying to get it to work.  If there is something obvious I missed to make this simpler, please comment!

The Tools

You will first need a set of tools.  Here was my list:

With these I was ready to go.  The AWS Toolkit is the key here as it provides a lot of VS integration that will help make this a lot easier.

NOTE: You can do all of this technically with VS Code (even on a Mac) but I think the AWS Toolkit for VS makes this a lot simpler to initially understand the pieces and WAY simpler in the publishing step to the AWS Lambda service itself.  If there is a VS Code plugin model, that would be great, but I didn’t find one that did the same things here.

Armed with these tools, here is what I did…

Creating the Lambda project …

Create the function handler …

Working with the Alexa request/response …

Publishing the Lambda Function …

Testing the function …

Summary (thus far)

I set out to spend a minimal amount of time getting the C# Lambda service + Alexa skill working.  I’ve uploaded the full solution to a GitHub repository: timheuer/alexa-csharp-lambda-sample for you to take a look at.  I’m hopeful that this is simple and we can start using C# more for Alexa skills.  I think we’ll likely see some Alexa Skills SDK for .NET popping up elsewhere as well. 

Hope this helps!

…" [Click through to read the whole post, yes, you’re going to want too… really…]

If you write a cool Alexa Skill in C#, let us know…

What? You think it’s a little weird that we’re highlighting Alexa Skills and not Cortana? The good news is that there’s some great dev stuff coming for Cortana in the coming year, check out this post, Cortana to open up to new devices and developers with Cortana Skills Kit and Cortana Devices SDK



Tags:

Amazon, C#, Coding4Fun

The Discussion

  • User profile image
    stahtufiang

    // any video content?

  • User profile image
    gduncan411

    @stahtufiang: No. The Coding4Fun blog highlights the great work of others in the community, hopefully enticing the reader to click through to see the complete and full post.

    That said, if the original author has a video in their post, I'll sometimes include it in the C4F Blog post. But it's usually pretty rare that they do...

Add Your 2 Cents