Create agent tools for Microsoft Graph API
This notebook creates agent tools to fetch data using Microsoft Graph API's API.
To learn more about creating agent tools that connect to external services, see Databricks documentation (AWS | Azure).
Requirements
Before you begin, ensure you have the OAuth application created. See Microsoft documentation for more details.
Setup
Install the databricks-sdk
.
Update the following parameters with information for your catalog and provide a name for a new connection.
uc_catalog
: Specifies the catalog where the external function will be created.uc_schema
: Specifies the schema in the catalog where the external function will be created.connection_name
: Specifies the connection name.
Create a Unity Catalog Connection
Create a Unity Catalog Connection by providing the host URL and token for authentication. To learn more about supported authentication methods, see Databricks documentation (AWS | Azure).
Make sure to fill in the client_id
, client_secret
and TENANT_ID
from the application.
You can also create a connection through the Catalog Explorer UI. See Databricks documentation (AWS | Azure).
Test the connection
Test the connection works by retrieving user data.
Create a Unity Catalog function
Now that you have a working connection create a Unity Catalog function that fetches the user's information.
Update the function name (currently microsoft_graph_users
).