|
1 | 1 | ---
|
2 | 2 | title: "Conversational Agent App"
|
3 |
| -language: python |
4 |
| -author: "Vivian Xie" |
| 3 | +language: Python |
| 4 | +author: "Vivian(Wenwen) Xie" |
5 | 5 | date: 2025-06-09
|
6 | 6 | ---
|
7 | 7 |
|
@@ -36,6 +36,7 @@ The Databricks Genie Conversation APIs (in Public Preview) enable you to embed A
|
36 | 36 | - **Workspace Integration**: Access your data assets and models directly from your Databricks workspace
|
37 | 37 | - **Natural Language Data Queries**: Ask questions about your data in plain English
|
38 | 38 | - **Stateful Conversations**: Maintain context for follow-up questions
|
| 39 | +- **OBO(On-Behalf-Of) Authentication**: User credentials passthrough for fine-grained access control. |
39 | 40 |
|
40 | 41 | ## Example Use Case
|
41 | 42 |
|
@@ -69,8 +70,80 @@ For detailed instructions on configuring resources, refer to the [official Datab
|
69 | 70 | For more details, refer to the [official Databricks documentation](https://docs.databricks.com/aws/en/dev-tools/databricks-apps/deploy).
|
70 | 71 |
|
71 | 72 | ## Troubleshooting
|
72 |
| - |
73 |
| -For troubleshooting, navigate to the Monitoring page of the selected genie space and check if the query has been sent successfully to the genie room via the API. |
| 73 | +1. After you install the app from Markeplace, check the Authorization page for API scope details. |
| 74 | + |
| 75 | + |
| 76 | +Then you open the url link the first time, ensure that you see this OBO scope authorization page, which has all four scopes: |
| 77 | + - serving.serving-endpoints |
| 78 | + - dashboards.genie |
| 79 | + - files.files |
| 80 | + - sql |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +2. If you directly clone the git repo, start an app instance and try to add scope, notice that serving.serving-endpoints is not in the scope list yet in the UI, which is a work-in-progress and will get added later. |
| 86 | + |
| 87 | + |
| 88 | +What you need to do is using Databricks API or CLI to manually grant the user serving.serving-endpoints. |
| 89 | +To do this, you can use either the [CLI](https://docs.databricks.com/aws/en/dev-tools/cli), [SDK](https://docs.databricks.com/aws/en/dev-tools/sdk-python) or [API](https://docs.databricks.com/api/account/customappintegration/get) as an Account Admin. To show an example using CLI: |
| 90 | + - Take the Oauth2 App client ID: |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | +- Pass this to the Databricks CLI command, |
| 95 | + |
| 96 | +``` |
| 97 | +databricks account custom-app-integration get '12345667-1234-5678-a85d-eac774235aea' |
| 98 | +
|
| 99 | +{ |
| 100 | + "client_id":"12345667-1234-5678-a85d-eac774235aea", |
| 101 | + "confidential":true, |
| 102 | + "create_time":"2025-02-18T09:59:07.876Z", |
| 103 | + "created_by":4377920341700116, |
| 104 | + "integration_id":"abcdefgg-1234-5678-a85d-eac774235aea", |
| 105 | + "name":"app-abcdeft 1234xp", |
| 106 | + "redirect_urls": [ |
| 107 | + "http://localhost:7070", |
| 108 | + "https://mzeni-obo-app-url.azure.databricksapps.com/.auth/callback" |
| 109 | + ], |
| 110 | + "scopes": [ |
| 111 | + "openid", |
| 112 | + "profile", |
| 113 | + "email", |
| 114 | + "all-apis", |
| 115 | + "offline_access" |
| 116 | + ], |
| 117 | + "token_access_policy": { |
| 118 | + "access_token_ttl_in_minutes":60, |
| 119 | + "refresh_token_ttl_in_minutes":10080 |
| 120 | + } |
| 121 | +} |
| 122 | +``` |
| 123 | + - Update the scopes with below command line, notice you will copy all the original scopes over and add the serving-endpoints at the end: |
| 124 | +``` |
| 125 | + databricks account custom-app-integration update '65d90ec2-54ba-4fcb-a85d-eac774235aea' --json '{"scopes": ["openid", "profile", "email", "all-apis", "offline_access", "serving.serving-endpoints"]}' |
| 126 | +``` |
| 127 | + |
| 128 | + - If it doesn't reflect in the app, clear the cookie in the browser developer tools, and you may need to recreate the app or reinstall. You can also try opening the url in incognito mode. |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | +3. Make sure the users have proper access to the underlying resources: |
| 134 | + - For querying tables, users need at least `USE CATALOG` permissions on the Unity catalog and `USE SCHEMA` on the schema, `SELECT` permission on the table |
| 135 | + - For genie space, users need at least `Can Run` permission |
| 136 | + - For SQL warehouse, users need at least `Can use` permission |
| 137 | + - For model serving endpoint, users need at least `Can Query` permission |
| 138 | + |
| 139 | +4. When you share the app as the app owner with other users, they will see the app owner under Permission Requested and Sign-in user are different, which means the app owner is authoring other users to access the app |
| 140 | + |
| 141 | + |
| 142 | +The app owner needs to grant other users `Can Use` permission for the app itself, along with the access to the underlying Datarbricks resources. |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | +5. For further troubleshooting, navigate to the Monitoring page of the selected genie space and check if the query has been sent successfully to the genie room via the API. |
74 | 147 |
|
75 | 148 | 
|
76 | 149 |
|
|
0 commit comments