DEV Community

Dan Wahlin
Dan Wahlin

Posted on • Originally published at blog.codewithdan.com on

Video: Show a user’s emails in an ASP.NET Core app using Microsoft Graph

I’ve been working a lot with .NET Core and Microsoft Graph lately and decided to put together a short video based on a Microsoft Learn module covering how the technologies can be used together. If you haven’t used Microsoft Graph before, it provides a secure, unified API to access organizational data and intelligence (data stored in Microsoft 365 for example).

So why would you ever want to access a signed in user’s emails and include them in your custom app? The simple answer is, “Bring organizational data where your users need it everyday!”. Instead of users switching from your app to find a relevant email, calendar event, Microsoft Teams chat (and more) by jumping between various productivity apps, you can pull that type of data directly into your custom app. This allows users to work more efficiently and make more informed decisions all while minimizing context shifts.

In this video I’ll introduce you to:

  • The role of security in making Microsoft Graph calls.
  • Microsoft Identity and Microsoft Graph Middleware configuration.
  • The role of permissions/scopes and access tokens.
  • The Microsoft Graph .NET Core SDK and how it can be used.
  • How to create reusable classes that handle making Microsoft Graph calls.
  • Dependency injection and how it can be used to access a GraphServiceClient object.
  • How to retrieve a batch of email messages using the UserMessagesCollectionRequest class.

Show a user’s emails in an ASP.NET Core app using Microsoft Graph

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay