Getting Started with Microsoft Graph and .NET SDKs

Microsoft 365 Developer · Beginner ·🧠 Large Language Models ·7y ago

Key Takeaways

Building applications with Microsoft Graph and .NET SDKs for authentication and API interactions

Full Transcript

everybody I'm Jeremy I'm here with Daryl today thanks for coming Daryl yeah very welcome glad to be here we're going to be talking about the SD net1 so as a.net developer why would I use the Microsoft Groff SDK well the the SDK allows you to just get at the data that is on the graph that much easier we can help you build requests and we can help you do all the serialization and deserialization of models and whole bunch of other stuff so as an example we get a lot of feedback around throttling for instance is there a way that the SDK can make that easier for me as a developer to manage that kind of thing absolutely we handle a whole bunch of different standard HTTP status codes we have a middleware pipeline that kind of sits behind the HP client library and can handle things like 429 responses and 503 responses and all the redirect codes and over time we'll be adding more pieces of middleware to handle those standard HTTP responses that's great so I'm thinking as a developer like if I've already kind of started making a bunch of course the graph in there and now I want to kind of introduce myself to the SDK is it all or nothing' or are there things that I could benefit from if I'm already using HDB crest do get and post calls yeah if you are already using HTTP client we have a mechanism where we have an HP client factory that will create you an HP client there's already been preset up with all these pieces of middleware so you can immediately get all of these retry and throttling type behaviors out of the box and just plug it straight into your existing application that's really neat so how does the developer get started with this could you show us on your computer absolutely well why don't we just start with a demo of the the simplest thing just a console app here I have one pre set up that's just basically empty and I pulled in a couple of packages there's a Microsoft graph package maximum of graph core and the graph off these are the three packages that we're going to use for this demo so here we are first thing we're going to do is we're going to create ourselves a client for the graph and it's called graph service client graph service client there we go excellent okay now as soon as I have that client I can now I have a fluent interface so I can do me to get my data you can get at your messages you get all kinds of data but let's just keep it simple with me I'm gonna convert this into a request now and then do it get an HTTP GET method on it now this we're gonna assign this to a variable here our user equals and that is an async method so we're gonna get there and then when we get that result back we're going to show some information console dot write line so you actually prove that it worked user dot display me okay excellent now you'll notice that we still getting the red squiggly here right because you need to know who I am I need to authenticate myself with against this API so if we hole hit the parenthesis you will see in the intellisense that we need an authentication provider so one third ocation provider is a set of classes that we've created to help you use the identity emcell libraries and we have one for each of the different types of or flow today we're just going to use a simple author interactive flow so that it pops up the sign-in dialogue because that we have a UI here and under the covers that's just using the emcell libraries identity provide yeah absolutely we're just an adapter and we call them cell at the right point and we handle certain errors that come back from em cell and we put the token in the appropriate place in the HTTP request so we're just a thin layer okay so we need an auth provider here Eider equals new interactive authentication provider now it accepts as a parameter a public client application and if you have used them cell that's one of the two initialization classes that M cell uses and we use exactly the same thing so if you already have an app using M cell it's easy to adapt here so we are going to create ourselves an M cell application now you can just new it up as normal but we also have a little helper here to go create your client application now what you need to provide here is a client ID now I don't happen to remember the client ID by heart so I'm going to go Ellie come on joy I've tried it's just that I've got like the first six or seven characters but the rest are still mystery to me okay let's just paste this client ID in here excellent now let's grab that app and put it as a parameter to the auth provider now it needs one more parameter in here we need the Scopes because we want to say what different capabilities we want this application to have in this case we're just accessing user so we can do user dot read as our scope here and you can just do a cut an array of all kinds of different values here so you're doing my old op read or calendar read as well absolutely thanks okay so now we're going to pass our auth provider into the graph service client and we've got it all glued up and when we run this it should work now it's first we're going to ask us to login so it's going to pop up the regular consent of the regular identification dialog but now this because it's the first time we've run this app with this client ID it's now asking us to consent for this application to actually allow you to access the data we hit accept and there we go we get our username displayed we have retrieved data from the graph excellent so there's a lot of value that's kind of hidden underneath those few lines of code to do that that you're getting for free by using our SDK apps rather than rolling it yourself yes that's awesome thanks very much Darryl so if you want to get started this as a developer if you've got a graph Microsoft comm and click on the getting started at the top in the top navigation you'll give you a list of all the different platforms you can use in this case as a.net developer you just click net and you can go check out the SDK and the tutorials to get started so thanks for your time today though you're very welcome

Original Description

Learn how the .NET Microsoft Graph SDKs will help you as a developer, including how the SDK can help with getting an Auth token for the API, status codes and some SDK sample code. To learn more about the Microsoft Graph and .NET SDKs, visit https://docs.microsoft.com/en-us/graph/sdks/sdks-overview For additional Microsoft Graph tools and resources, visit https://graph.microsoft.com.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Microsoft 365 Developer · Microsoft 365 Developer · 24 of 60

1 Adaptive Cards community call-February 2019
Adaptive Cards community call-February 2019
Microsoft 365 Developer
2 PowerApps community call-February 2019
PowerApps community call-February 2019
Microsoft 365 Developer
3 Microsoft Graph community call-March 2019
Microsoft Graph community call-March 2019
Microsoft 365 Developer
4 Office Add ins community call-March 2019
Office Add ins community call-March 2019
Microsoft 365 Developer
5 PowerApps community call-March 2019
PowerApps community call-March 2019
Microsoft 365 Developer
6 Microsoft Teams community call-March 2019
Microsoft Teams community call-March 2019
Microsoft 365 Developer
7 Using React and Office UI Fabric React Components
Using React and Office UI Fabric React Components
Microsoft 365 Developer
8 Build Microsoft Teams customization using SharePoint Framework
Build Microsoft Teams customization using SharePoint Framework
Microsoft 365 Developer
9 Microsoft Graph community call-April 2019
Microsoft Graph community call-April 2019
Microsoft 365 Developer
10 Using Change Notifications and Track Changes with Microsoft Graph
Using Change Notifications and Track Changes with Microsoft Graph
Microsoft 365 Developer
11 Office Add Ins community call-April 2019
Office Add Ins community call-April 2019
Microsoft 365 Developer
12 Adaptive Cards community call-April 2019
Adaptive Cards community call-April 2019
Microsoft 365 Developer
13 Microsoft Teams community call-April 2019
Microsoft Teams community call-April 2019
Microsoft 365 Developer
14 Getting Started with Microsoft Graph and Application Registration
Getting Started with Microsoft Graph and Application Registration
Microsoft 365 Developer
15 Getting Started with Microsoft Graph and the Directory API
Getting Started with Microsoft Graph and the Directory API
Microsoft 365 Developer
16 Getting Started with Microsoft Graph and Microsoft Teams
Getting Started with Microsoft Graph and Microsoft Teams
Microsoft 365 Developer
17 Getting Started with Microsoft Graph Explorer
Getting Started with Microsoft Graph Explorer
Microsoft 365 Developer
18 Getting Started with Microsoft Graph
Getting Started with Microsoft Graph
Microsoft 365 Developer
19 Getting Started with Microsoft Graph and Mail API
Getting Started with Microsoft Graph and Mail API
Microsoft 365 Developer
20 Getting Started with Microsoft Graph and Office 365 Groups
Getting Started with Microsoft Graph and Office 365 Groups
Microsoft 365 Developer
21 Getting Started with Microsoft Graph and the Calendar API
Getting Started with Microsoft Graph and the Calendar API
Microsoft 365 Developer
22 Getting Started with the Microsoft Graph Toolkit
Getting Started with the Microsoft Graph Toolkit
Microsoft 365 Developer
23 Getting Started with Microsoft Graph and JavaScript SDKs
Getting Started with Microsoft Graph and JavaScript SDKs
Microsoft 365 Developer
Getting Started with Microsoft Graph and .NET SDKs
Getting Started with Microsoft Graph and .NET SDKs
Microsoft 365 Developer
25 Discover how businesses can be more productive with Microsoft 365 integrations
Discover how businesses can be more productive with Microsoft 365 integrations
Microsoft 365 Developer
26 Adaptive Cards community call-May 2019
Adaptive Cards community call-May 2019
Microsoft 365 Developer
27 Office Add-ins community call-May 2019
Office Add-ins community call-May 2019
Microsoft 365 Developer
28 Why We Built on Microsoft Teams
Why We Built on Microsoft Teams
Microsoft 365 Developer
29 Microsoft Teams community call-May 2019
Microsoft Teams community call-May 2019
Microsoft 365 Developer
30 Microsoft Graph community call-June 2019
Microsoft Graph community call-June 2019
Microsoft 365 Developer
31 Build Angular SPA's with Microsoft Graph - June 2019
Build Angular SPA's with Microsoft Graph - June 2019
Microsoft 365 Developer
32 Office Add -ins community call-June 2019
Office Add -ins community call-June 2019
Microsoft 365 Developer
33 Build Android native apps with the Microsoft Graph Android SDK - June 2019
Build Android native apps with the Microsoft Graph Android SDK - June 2019
Microsoft 365 Developer
34 Build MVC apps with Microsoft Graph - June 2019
Build MVC apps with Microsoft Graph - June 2019
Microsoft 365 Developer
35 Authenticate and connect with Microsoft Graph - June 2019
Authenticate and connect with Microsoft Graph - June 2019
Microsoft 365 Developer
36 Microsoft Graph data connect - June 2019
Microsoft Graph data connect - June 2019
Microsoft 365 Developer
37 Change notifications with Microsoft Graph - June 2019
Change notifications with Microsoft Graph - June 2019
Microsoft 365 Developer
38 Build iOS native apps with the Microsoft Graph REST API - June 2019
Build iOS native apps with the Microsoft Graph REST API - June 2019
Microsoft 365 Developer
39 Build Node.js Express apps with Microsoft Graph - June 2019
Build Node.js Express apps with Microsoft Graph - June 2019
Microsoft 365 Developer
40 Smart UI with Microsoft Graph - June 2019
Smart UI with Microsoft Graph - June 2019
Microsoft 365 Developer
41 Leveraging the Microsoft Graph API from the SharePoint Framework - June 2019
Leveraging the Microsoft Graph API from the SharePoint Framework - June 2019
Microsoft 365 Developer
42 Build UWP apps with Microsoft Graph - June 2019
Build UWP apps with Microsoft Graph - June 2019
Microsoft 365 Developer
43 Build React SPA's with Microsoft Graph - June 2019
Build React SPA's with Microsoft Graph - June 2019
Microsoft 365 Developer
44 Getting Started with Microsoft Graph and Batching
Getting Started with Microsoft Graph and Batching
Microsoft 365 Developer
45 Getting Started with Microsoft Graph and Change Notifications
Getting Started with Microsoft Graph and Change Notifications
Microsoft 365 Developer
46 Getting Started with Microsoft Graph and Consent Permissions
Getting Started with Microsoft Graph and Consent Permissions
Microsoft 365 Developer
47 Getting Started with Microsoft Graph and Education
Getting Started with Microsoft Graph and Education
Microsoft 365 Developer
48 Getting Started with Microsoft Graph and Financials
Getting Started with Microsoft Graph and Financials
Microsoft 365 Developer
49 Getting Started with Microsoft Graph and Excel
Getting Started with Microsoft Graph and Excel
Microsoft 365 Developer
50 Getting Started with Microsoft Graph and Data Connect
Getting Started with Microsoft Graph and Data Connect
Microsoft 365 Developer
51 Getting Started with Microsoft Graph and Intune
Getting Started with Microsoft Graph and Intune
Microsoft 365 Developer
52 Getting Started with Microsoft Graph and Notifications
Getting Started with Microsoft Graph and Notifications
Microsoft 365 Developer
53 Getting Started with Microsoft Graph and OneNote
Getting Started with Microsoft Graph and OneNote
Microsoft 365 Developer
54 Getting Started with Microsoft Graph and OneDrive
Getting Started with Microsoft Graph and OneDrive
Microsoft 365 Developer
55 Getting Started with Microsoft Graph and Open Extensions
Getting Started with Microsoft Graph and Open Extensions
Microsoft 365 Developer
56 Getting Started with Microsoft Graph and Paging
Getting Started with Microsoft Graph and Paging
Microsoft 365 Developer
57 Getting Started with Microsoft Graph and Schema Extensions
Getting Started with Microsoft Graph and Schema Extensions
Microsoft 365 Developer
58 Getting Started with Microsoft Graph and Security API
Getting Started with Microsoft Graph and Security API
Microsoft 365 Developer
59 Getting Started with Microsoft Graph and Query Parameters
Getting Started with Microsoft Graph and Query Parameters
Microsoft 365 Developer
60 Getting Started with Microsoft Graph and Reporting API
Getting Started with Microsoft Graph and Reporting API
Microsoft 365 Developer

Related Reads

📰
Revolutionizing Information Retrieval with LLMs: Oxlo's Approach
Learn how Oxlo's approach revolutionizes information retrieval with LLMs, improving accuracy through dense vector search and generative summarization
Dev.to AI
📰
Building Question Answering Models with LLMs: A Step-by-Step Guide
Build a retrieval-augmented question answering model using LLMs and local embeddings to answer questions from a private text corpus
Dev.to AI
📰
LLM Inference for Code Analysis: Oxlo's Perspective
Learn how to optimize LLM inference for code analysis with Oxlo's perspective, improving performance and reducing costs
Dev.to AI
📰
Anthropic's framing around Claude's "emotions" feels misleading
Anthropic's framing of Claude's 'emotions' is misleading as it implies sentience, which is not the same as simulating emotional concepts
Reddit r/singularity
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →