Azure Code Samples

Learn to interact with Azure services through code

163 code samples match your filter

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

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.

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

Cognitive Services Vision C# SDK quickstart samples

Latest sample code for Cognitive Services Vision C# SDK quickstarts.

  • Cognitive Services
  • .NET
easyj2j by John MacKenzie,
Last updated: 8/29/2019

Samples for Cognitive Services Nuget Packages

Learn how to use the Cognitive Services SDKs with these samples

  • Cognitive Services
  • .NET
yangyuan by Yang Yuan,
Last updated: 8/28/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

Use OpenID Connect to sign in users to Microsoft identity platform (formerly Azure Active Directory for developers) and execute Microsoft Graph operations using incremental consent

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, as well as incrementental consent.

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

WPF application signing in users with Azure Active Directory B2C and calling an API

Sample showing how a Windows Desktop .NET (WPF) application can sign in a user using Azure AD B2C, get an access token using MSAL.NET and call an API.

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

Universal Windows Platform (UWP) application signing in users with Azure Active Directory B2C and calling an API

Sample showing how a Windows Universal Platform (UWP) application can sign in a user using Azure AD B2C, get an access token using MSAL.NET and call an API. http://aka.ms/aadb2c

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

MipSdk-Dotnet-File-ServicePrincipalAuth

This sample application demonstrates using a service principal to authenticate to the MIP service, fetch policy, and label a file.

  • .NET
tommoser by Tom Moser,
Last updated: 8/21/2019

MipSdk-Dotnet-File-Quickstart

This sample application demonstrates using the Microsoft Information Protection SDK .NET wrapper to label and read a label from a file.

  • .NET
tommoser by Tom Moser,
Last updated: 8/21/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

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 Active Directory
  • .NET
jmprieur by Jean-Marc Prieur,
Last updated: 8/15/2019

Analytics & Visualization Samples for Academic Graph

Various examples to perform big data analytics over Microsoft Academic Graph and visualize the results.

  • .NET
alch-msft by Alvin Chen,
Last updated: 8/14/2019

Use Service Bus from App Service with Managed Service Identity

Sample that shows how to send and receive data from Azure Service Bus Queue at run-time from an App Service with a Managed Service Identity (MSI)

  • App Service
  • .NET
nonik0 by Nick Brown,
Last updated: 8/14/2019

Use Azure SQL Database from App Service with Managed Identity (Without Code Changes)

Sample that shows how to authenticate to Azure SQL Databases at run-time from an App Service with a Managed Service Identity.

  • App Service
  • .NET
nonik0 by Nick Brown,
Last updated: 8/14/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