This sample shows how to connect your .NET Console app to Office 365 using the Microsoft Graph API and generate an Excel workbook from CSV. It uses Microsoft Graph .NET Client Library as well as Azure AD v2.0 endpoint, which enables users to sign-in with either their personal or work or school Microsoft accounts.
This sample requires the following:
- Visual Studio 2017
- Either a Microsoft or Office 365 for business account.
- Sign into the App Registration Portal using either your personal or work or school account.
- Select Add an app.
- Enter a name for the app, and select Create application.
- Under Platforms, select Add platform.
- Select Native Application.
- Copy the Application Id value and replace it in
AuthenticationHelper.ClientId
. - Select Save.
Most code is in Main()
method, and is relatively straight-forward and self-explanatory. Calls for authentication actually occur in the AuthenticationHelper
class.
- Microsoft Graph overview
- Graph Explorer (Allows you to sign-in with your own O365 acount and query Graph APIs)
- Working with Excel in Microsoft Graph