Azure Code Samples

Learn to interact with Azure services through code

60 code samples match your filter

Tutorial - Enable your Web Apps to sign-in users and call APIs with the Microsoft identity platform for developers

An ASP.NET Core 2.x Web App which lets sign-in users (including in your org, many orgs, orgs + personal accounts, sovereign clouds) and call Web APIs (including Microsoft Graph)

jmprieur by Jean-Marc Prieur,
Last updated: 4/19/2019

Migrating an application from using ADAL.NET to using MSAL.NET

Demonstrate the migration of .NET applications fro AAD v1.0 (ADAL.NET) to AAD v2.0 (MSAL.NET)

jmprieur by Jean-Marc Prieur,
Last updated: 4/19/2019

Build a multi-tenant SaaS web application using Azure AD & OpenID Connect

A sample .NET 4.5 MVC web app that signs-up and signs-in users from any Azure AD tenant using OpenID Connect.

jmprieur by Jean-Marc Prieur,
Last updated: 4/18/2019

WPF application signing in users with Microsoft and calling the Microsoft Graph

Sample showing how a windows Desktop .NET (WPF) application can get an access token using MSAL.NET and call the Microsoft Graph API or other APIs protected by Azure Active Directory v2

jmprieur by Jean-Marc Prieur,
Last updated: 4/17/2019

Calling an ASP.NET Core Web API from a WPF application using Azure AD V2

Calling a ASP.NET Core Web API from a WPF application using Azure AD v2.0

jmprieur by Jean-Marc Prieur,
Last updated: 4/16/2019

Authorization in a web app using Azure AD application roles & role claims

A .NET 4.5 MVC web app that uses Azure AD application roles for authorization.

jmprieur by Jean-Marc Prieur,
Last updated: 4/14/2019

Azure AD Javascript Getting Started

A javascript based single page app with a .NET backend that authenticates Azure AD users and calls the backend web api using access tokens, without using any SPA frameworks.

jmprieur by Jean-Marc Prieur,
Last updated: 4/12/2019

Integrating Azure AD into an AngularJS single page app

An AngularJS based single page app, implemented with an ASP.NET Web API backend, that signs in users and calls web APIs using Azure AD

jmprieur by Jean-Marc Prieur,
Last updated: 4/12/2019

JavaScript Single Page Application with an ASP.NET backend, using msal.js

A JavaScript based single page app with a .NET backend that authenticates users for AzureAD, Microsoft personal and work accounts, and more, and calls the backend web api using access tokens, without using any Single Page Application framework

jmprieur by Jean-Marc Prieur,
Last updated: 4/11/2019

Integrate Microsoft identity and the Microsoft Graph into a Xamarin forms app using MSAL

This is a simple Xamarin Forms app showcasing how to use MSAL to authenticate MSA and Azure AD via the converged MSA and Azure AD authentication endpoints, and access the Microsoft Graph with the resulting token.

jmprieur by Jean-Marc Prieur,
Last updated: 4/11/2019

Universal Windows Platform application signing in users with Microsoft and calling the Microsoft Graph

A Windows Universal Platform client application using msal.net, accessing the Microsoft Graph for a user authenticating with Azure AD V2 endpoint

jmprieur by Jean-Marc Prieur,
Last updated: 4/11/2019

Authorization in a web app using Azure AD groups & group claims

A .NET 4.5 MVC web app that uses Azure AD groups for authorization.

jmprieur by Jean-Marc Prieur,
Last updated: 4/11/2019

Integrating a Windows Universal application the Microsoft identity platform

A Windows Store 8.1 or Windows 10 (UWP) application that uses Azure AD and the ADAL library to authenticate the user and call a web API using OAuth 2.0 access tokens.

jmprieur by Jean-Marc Prieur,
Last updated: 4/10/2019

Integrating Azure AD into an ASP.NET Core web app

An ASP.NET Core web application that signs-in Azure AD users from a single Azure AD tenant.

jmprieur by Jean-Marc Prieur,
Last updated: 4/10/2019

Authenticating to Azure AD in daemon apps with certificates

A .NET 4.5 daemon application that uses a certificate to authenticate with Azure AD and get OAuth 2.0 access tokens.

jmprieur by Jean-Marc Prieur,
Last updated: 4/10/2019

Build a multi-tenant daemon with the Azure AD v2.0 endpoint

A web application that sync's data from the Microsoft Graph using the identity of the application, instead of on behalf of a user.

jmprieur by Jean-Marc Prieur,
Last updated: 4/10/2019

Build an app with admin restricted scopes using the v2.0 endpoint

An ASP.NET MVC application that shows how to use the Azure AD v2.0 endpoint to collect consent for permissions that require administrative consent.

jmprieur by Jean-Marc Prieur,
Last updated: 4/10/2019