Using SendGrid with Azure Functions to Send Email

I’ve been working on a solution for a customer that utilizes SharePoint Online lists and libraries, PowerApps, Logic Apps, and Azure Functions. The solution works something like this: Project documents are stored and updated in a SharePoint Library by office staff. The shop floor needs to access the documents and know at a glance when documents have been updated. The PowerApp displays a count of the most recently updated documents by project and document type, and also displays the documents. A SharePoint List is used to store the counts of the most recently updated documents. The Logic App and Azure Function work together to update the SharePoint List with the counts from the SharePoint Library.

As part of the solution, we wanted a way to be notified if the Azure Function threw an error. This is where SendGrid comes in. SendGrid is a third-party email delivery service. Azure Functions support an output binding for SendGrid, which makes it very easy to integrate into your solution.Here is a grand overview of how my solution (just the Azure Function and SendGrid piece) will work – If my Azure Function throws an error, it will send the error message to Azure Queue Storage. The error message will be stored in Azure Queue Storage until another Azure Function (2) comes and picks it up. Azure Function (2) will use SendGrid to send an email containing the error message. Easy-peasy. You can use SendGrid to send emails for all kinds of reasons – when a customer places an order, you can send a confirmation email with the details of the order; when someone clicks a button on your site to request information, you can send an email with the requested information; the options are endless.

Continue reading “Using SendGrid with Azure Functions to Send Email”

Codemash 2019

Earlier this month I attended the Codemash developers conference at the Kalahari Waterpark in Sandusky, OH. This was my 11th time going to the conference and I always come back with a list of things I want to learn more about. This year was no different and overall it was probably the best one I have attended. Following are a few of the more interesting sessions I attended.

 

Best Practices for Robust API Development in ASP.NET Core

This was full day workshop that went through in detail a typical API architecture written in .NET Core and including other common packages for Dependency Injection (Autofac), Testing (XUnit), Logging (SeriLog), Mocking (Moq), API Documentation (Swagger), Object Mapping (AutoMapper), plus a working example of using MongoDB with .NET Core. Lots of good takeaways from this.

 

A Hands-on Intro to Containers

Although Docker is not new, I have not really done anything with it before. This ½ day session included an AWS instance with the prerequisites already setup so we were able to go over creating a Docker image, and using DockerHub to find existing images to work with. It was a perfect to getting-started workshop for my level of Docker experience.

 

Database Devops in Docker

This session, in addition to the Docker pre-compiler, went over some cool uses of Docker images.  The most interesting one to me was where the speaker described how each night that take a backup of the their production database, scrub the data of private information, and update an internal Docker image with the database backup.  Then each morning all of the developers can pull the new image and do their development with data that is essentially production data.

 

Service Workers and Intro to Progressive Web Apps

These were two separate sessions but they are very much related technologies.  Service Workers are a key part of Progress Web Apps. I have many years of web development experience and PWA’s are something I have been interested in learning more about.  The PWA session was a great introduction and included details on when a PWA is the appropriate choice for an app, and a lot of good examples on how to setup a PWA.

Overall I feel like the time at Codemash was well spent and as usual I have a list of new tech to on my list of things to learn more about this year.

 

MS Flow and Azure: Creating Parent and Sub sites

The Assignment

Recently we were asked by a client to develop a MS Flow that creates a sub site when users enter a new item into a SharePoint list. What we found was there’s no simple, out of the box way to have the new sub site inherit the top navigation of the parent site. As a result, we needed to create an Azure Function to preform this function.  Continue reading “MS Flow and Azure: Creating Parent and Sub sites”

Functional Programming with C#

I’ve been interested in learning more about functional C#, and how it differs from the 2_bgOOP style C# that I’ve been doing for years. Ed Charbeneau gave a talk on this topic at CodeMash back in January, the main lesson being how to score a poker game using C# and functional principals and the samples. In this blog entry I will be reviewing a few of the functional principals I took away from the presentation— there are many more but here’s a short list: Continue reading “Functional Programming with C#”

Mobile Monday Presentation – Domino’s AnyWare

Joseph DotsonOn Monday I attended a presentation on the Domino’s AnyWare application.

Culture

A large portion of the talk from Domino’s was about their working culture. They utilize agile and scrum processes, with stand ups and sprints.

Continue reading “Mobile Monday Presentation – Domino’s AnyWare”

Dynamic Code in C#

co-authored by Joseph Dotson

2_bgWe are working on a project where the data access methodology for the application was defined and provided by the client.  While this approach accomplishes the tasks of accessing data in SQL Server we found that we were duplicating code making small changes to new files but largely repeating code to access new tables in the database.  We decided to look at dynamic code in C# to solve this problem and reduce redundancy in the code base.

Continue reading “Dynamic Code in C#”

Adding Asp.Net MVC 4 into an existing Asp.Net Webforms Project

Scott ZischerkI had a client that had an existing ASP.Net webforms application and wanted to move to ASP.Net MVC without rewriting the existing web site.  Well, as it turns out, you can!  Since ASP.Net MVC is an abstraction on top of ASP.Net you can run both simultaneously. Here are the steps I followed to get it working.Bootstrapping MVCTo get Asp.NET MVC4 working in an Asp.NET webforms website we need to add a few files and settings.

Continue reading “Adding Asp.Net MVC 4 into an existing Asp.Net Webforms Project”