- Introduction
- Prerequisites
- Getting started with the sample
- Build and run the sample
- Code of note
- Questions and comments
- Contributing
- Additional resources
This sample includes a NodeJS/Express application that demonstrates how to add an AddIn to Excel and trade and IdentityAPI token for a Graph token to make a call to Microsoft Graph Search API endpoint.
This sample requires the following:
- Download or clone this repo.
Follow the steps in Configuring Azure.
- Open Visual Studio code to the ./Sample2.2a/SearchBetaApi folder
- Open the server.ts file
- Replace the values for the following:
- {client TenantID} - your Azure AD Tenant ID
- {client GUID}- the client id from the Configuring Azure steps
- {client secret} - the client secret from the Configuring Azure steps
NOTE: If you did the Visual Studio sample in Sample 1.0, you can skip to Test the AddIn as all the settings are the same.
- Open the GraphSearchApiExcel.xml file
- Scroll to the bottom of the file, in the WebApplicationInfo section, ensure that the clientid matches the client id from the Configuring Azure steps
- Save the file
- On your development machine, create a folder called c:\manifests
- Right-click the folder, select Properties
- Click the Sharing tab
- Click Share
- Enter your account name, click Share
- Close the dialog
- Copy the GraphSearchApiExcel.xml file to the new manifests share
- Open Excel, click Blank Workbook
- Click File->Options
- Select the Trust Center tab
- Click the Trust Center Settings button
- Select the Trusted Add-in Catalogs tab
- In the catalog url, type //localhost/manifests, then click Add catalog
- Click OK
- In the ribbon, select the Insert tab
- Click Get Add-ins
- Select SHARED FOLDER, the select the Microsoft Graph Search Add-in
- Click Add
- Close the AddIn window
- Click the Home tab
- You should now have a new ribbon item in a group called Search and a button called Graph Search API
- Click the button, you should the task pane open with error.
- Switch back to Visual Studio Code
- Click the debug tab, then select Launch Program configuration
- Switch back to Excel, click Retry to refresh the application task pane.
- Run a search, review the results that are exported to the workbook sheet as a filterable and searchable table
- Remember if you make changes, you must run npm run-script build to rebuild the TypeScript files into their corresponding javascript.
- The server.ts file contains the endpoint that will trade the identity token for the graph token.
We'd love to get your feedback about this sample! Please send us your questions and suggestions in the Issues section of this repository.
Your feedback is important to us. Connect with us on Stack Overflow. Tag your questions with [MicrosoftGraph].
If you'd like to contribute to this sample, see CONTRIBUTING.md.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
- Microsoft Graph Security API Documentaion
- Other Microsoft Graph Connect samples
- Microsoft Graph overview
- Sideload Outlook add-ins for testing
- Tutorial: Build a message compose Outlook add-in
- Deploy and publish your Office Add-in
- Use the Outlook REST APIs from an Outlook add-in
- Identity API requirement sets
- Enable single sign-on for Office Add-ins
- Authorize to Microsoft Graph in your Office Add-in
- Register SSO AddIn in AAD v2
- How to switch from Semi-Annual Channel to Monthly Channel for the Office 365 suite
- Troubleshoot error messages for single sign-on (SSO)
- Enable your tenant for Modern Autentication
- Microsoft Graph with Node/Express App
Copyright (c) 2019 Microsoft. All rights reserved.