Azure Code Samples
Learn to interact with Azure services through code
60 code samples match your filter
Calling a ASP.NET Core Web API from a WPF application using Azure AD v2.0
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)
An ASP.NET Core web application that signs-in Azure AD users from a single Azure AD tenant.
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.
A .NET 4.5 multi-tenant web API that is secured using Azure AD and OAuth 2.0 access tokens, and accepts calls from Azure AD users in any tenant via a Windows Store client.
Demonstrate the migration of .NET applications fro AAD v1.0 (ADAL.NET) to AAD v2.0 (MSAL.NET)
.NET Core 2.1 console application letting a user acquire a token for the Microsoft Graph by signing in through another device having a Web browser, with the Azure AD v2.0 endpoint
A .NET Core 2.1 console application which gets an access token to call the graph using a username and password
.NET console application letting a user acquire a token for the Microsoft Graph using Integrated Windows Authentication (on domain joined or AAD joined machines)
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
Web API calling a downstream API on behalf of the user using the Microsoft identity platform (formerly named Azure AD) v2.0 enpoint
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.
A .NET 4.5 daemon application that uses a certificate to authenticate with Azure AD and get OAuth 2.0 access tokens.
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
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.
A web application that sync's data from the Microsoft Graph using the identity of the application, instead of on behalf of a user.
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.