Azure Code Samples

Learn to interact with Azure services through code

32 code samples match your filter

Calling Microsoft Graph from a web app using ADAL Python

A Python Web App calling the Microsoft Graph API, leveraging ADAL Python

  • Azure Active Directory
  • Python
azure-samples by Azure Samples,
Last updated: 8/1/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)

Azure-Samples by Jean-Marc Prieur,
Last updated: 9/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

Azure-Samples by Jean-Marc Prieur,
Last updated: 9/12/2019

Integrating Azure AD into a Java console application using username and password

A java command line program for Windows, Linux, or OS X that demonstrates non-interactive authentication to Azure AD using a username & password.

Azure-Samples by Azure Samples,
Last updated: 9/13/2019

Calling a Web API in a daemon app or long-running process

A Windows console application that calls a web API using its app identity (instead of a user's identity) to get access tokens in an unattended job or process.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 9/2/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.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 9/12/2019

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

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 8/27/2019

Hybrid-KeyVault-Python-Manage-Secrets-Cert-Based-Service-Principal

An example illustrating keyvault operations against Azure Stack using certificate based service principal.

Azure-Samples by Vishnu Priya Ananthu Sundaram,
Last updated: 9/13/2019

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 the MIcrosoft Graph

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 4/3/2019

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.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 5/20/2019

Calling a web API in a web app using Azure AD and OpenID Connect

A .NET 4.5 MVC web app that signs Azure AD users in with OpenID Connect and calls a web api using OAuth 2.0 access tokens.

Azure-Samples by Danny Strockis,
Last updated: 9/12/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.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 4/10/2019

.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.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 4/3/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.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 8/19/2019

Using MIP SDK with ASP.NET to Label Files on Download

This project demonstrates using the Microsoft Information Protection SDK to apply an MIP label to an Excel file generated by an ASP.NET application.

Azure-Samples by Tom Moser,
Last updated: 9/13/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.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 7/23/2019

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 Microsoft Graph API using OAuth 2.0 access tokens.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 7/17/2019

Integrating Azure AD into a Windows desktop application using interactive authentication

A .NET 4.5 WPF application that authenticates a user and calls web API using Azure AD and OAuth 2.0 access tokens.

  • Azure Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 7/17/2019