Azure Code Samples

Learn to interact with Azure services through code

62 code samples match your filter

Calling a web API in an ASP.NET Core web application using Azure AD

An ASP.NET Core web application that authenticates Azure AD users and calls a web API using OAuth 2.0 access tokens.

jmprieur by Jean-Marc Prieur,
Last updated: 2/21/2018

Invoking an API protected by Azure AD from a text-only device

This sample demonstrates how to leverage ADAL .NET to authenticate user calls to a web API (in this case, the directory Graph) from apps that do not have the capability of offering an interactive authentication experience.

jmprieur by Jean-Marc Prieur,
Last updated: 2/21/2018

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: 2/16/2018

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: 2/15/2018

Build a multi-tenant SaaS web application that calls a web API using Azure AD

A sample .NET 4.5 MVC SaaS web app that signs-up and signs-in users from any Azure AD tenant, and calls the Azure AD Graph API.

jmprieur by Jean-Marc Prieur,
Last updated: 2/15/2018

Integrate Microsoft identity and the Microsoft Graph into a web application using OpenID Connect

A sample showcasing how to develop a web application that handles sign on via the unified Azure AD and MSA endpoint, so that users can sign in using both their work/school account or Microsoft account. The sample also shows how to use MSAL to obtain a token for invoking the Microsoft Graph.

dstrockis by Danny Strockis,
Last updated: 2/6/2018

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: 2/5/2018

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: 2/5/2018

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: 2/5/2018

Using ADAL for Android in Xamarin with bindings

This sample shows how to build a Xamarin binding to our native ADAL for Android library.

danieldobalian by Daniel Dobalian,
Last updated: 2/1/2018

.NET Native App accessing Web Service that calls a downstream Web API with Conditional Access

A .NET 4.5 MVC Web API protected by Azure AD that receives tokens from a client and uses ADAL to get tokens for calling a downstream web API with a Conditional Access policy applied to it.

jmprieur by Jean-Marc Prieur,
Last updated: 2/1/2018

Calling a downstream web API from a web API using Azure AD

A .NET 4.5 MVC Web API protected by Azure AD that receives tokens from a client and uses ADAL to get tokens for calling another downstream web API

jmprieur by Jean-Marc Prieur,
Last updated: 2/1/2018

Integrating Azure AD into a cross platform Xamarin application

A Xamarin application that signs users in with Azure Active Directory across several different platforms and calls the Azure AD Graph API using OAuth 2.0 access tokens.

jmprieur by Jean-Marc Prieur,
Last updated: 1/24/2018

Authenticating to Azure AD in daemon apps with certificates

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

jmprieur by Jean-Marc Prieur,
Last updated: 1/24/2018

Integrating Azure AD into a Java web application

A server app that uses Azure AD and the ADAL4J library for authenticating the user and calling a web API using OAuth 2.0 access tokens.

brandwe by Brandon Werner,
Last updated: 1/5/2018

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: 12/21/2017

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

A WPF application that calls a Web API running on ASP.NET Core protected by Azure AD using OAuth 2.0 access tokens.

jmprieur by Jean-Marc Prieur,
Last updated: 11/30/2017

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: 11/30/2017