- Introduction
- Prerequisites
- Getting started with the sample
- Build and run the sample
- Code of note
- Questions and comments
- Contributing
- Additional resources
This sample will show you how to implement an Excel AddIn that makes a call to the Microsoft Graph Search API endpoint and then display the results in a workbook.
This sample requires the following:
- Download or clone this repo.
Follow the steps in Configuring Azure.
- Open the Sample2.1/ExcelWebAddIn1/GraphSearchApiExcel.sln solution with Visual Studio
- In the GraphSearchApiExcelWeb project, open the web.config file
- Replace the values for the following:
- ida:TenantId - your Azure AD Tenant ID
- ida:ClientId- the client id from the Configuring Azure steps
- ida:Password - the client secret from the Configuring Azure steps
- 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 configuration steps above.
- 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 you edited above to the new manifests share
- Open Excel
- Select 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 and close out all dialogs
- 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
- Right-click the GraphSearchApiExcelWeb project, select Debug->Start new instance
- 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
- The GraphController.cs file is responsible for trading the identity token for a graph token.
- The Home.js file contains a method called parseResult that will dynamically create an Excel table based on the columns returned from the search result.
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 [email protected] with any additional questions or comments.
- Microsoft Graph Security API Documentaion
- Other Microsoft Graph Connect samples
- Microsoft Graph overview
Copyright (c) 2019 Microsoft. All rights reserved.