I am encountering an issue with the Microsoft Purview API, which extracts schema classification from Purview. Previously, using the same API, I was able to retrieve the data, but now the response code is 200, and the response is null value.
API :
"https://{purviewaccountName}.purview.azure.com/catalog/api/atlas/v2/search/advanced?api-version={apiVersion}"
apiVersion : "2021-05-01-preview"
I used the above API for extracting schema classification from a Purview account (using Azure SQL Database and scanning some of the tables inside the database). Two months ago, I was able to extract the schema classification, but now I am encountering an issue where the response code is 200, but the response is null value from the API.
I tried the same API with new Purview accounts and the same scanning process, but I am still getting the same null value as response. We have added all necessary settings and permissions from Purview.
I tried with the latest apiVersion = "2023-01-01-preview" and received a response code of 200, but the response from the API is null value.
Microsoft Purview
-
Ganesh Gurram • 4,965 Reputation points • Microsoft External Staff
2025-02-21T20:52:44.95+00:00 Thank you for posting your query!
It seems like the API is returning a
200 OK
status, but with no data in the response. There could be a few different things happening here, so I’d recommend checking a few things to help troubleshoot:Check Scan Status - Make sure the scan for your Azure SQL Database tables has finished successfully. Sometimes, if the scan hasn’t completed or there's a problem with it, the data won’t be available in the catalog. You can manually trigger a scan to make sure everything is up to date.
Permissions and Endpoint - Check Double-check that the API endpoint is correct, including the account name and the API version you’re using. Also, ensure that the account or service principal has the necessary permissions to access the data (such as the
Purview Data Reader
role).Adjust the Search Query - It's possible that the search query you're using might not match any available data. Try using broader search parameters or testing different resource types to see if any results come back. This will help ensure the issue isn’t with the query itself.
Test with Older API Version -You mentioned trying the newer API version (
2023-01-01-preview
), but it still returned null. You might want to try the version you were using previously (2021-05-01-preview
), just to rule out any changes in the newer API.Look at Purview Logs - It’s also a good idea to check the Purview logs in the Azure portal. These logs could give more insight into what might be going wrong, whether there are issues with scanning or any errors during the process.
For more details refer: https://docs.azure.cn/en-us/purview/datamap-troubleshoot-request-timeout
I hope this information helps.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.
-
Ganesh Gurram • 4,965 Reputation points • Microsoft External Staff
2025-02-24T05:50:42.7666667+00:00 @Damodaram Chinna Swamulu - We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others. Otherwise, will respond with more details and we will try to help.
-
Damodaram Chinna Swamulu • 0 Reputation points
2025-02-24T07:42:58.4866667+00:00 - Check Scan Status:
Scan Status Update: The scan of the Azure SQL Database was successful, and data is available in the catalog.
- Permissions and Endpoint - Check:
We provided the necessary permissions for the service principal (Purview Data Reader) in Purview and created a master key
(Step 1: Create a login for SQL Server
Step 2: Create a user for the Azure SQL Database from the login
Step 3: Add the user to the db_datareader role to grant read permissions)
in the Azure SQL Database.- Adjust the Search Query:
I used the correct search query previously and received the expected response a month ago. However, now when I use the same query without any changes, I am getting a null value in response. - Tested both API versions:
We tested with the latest apiVersion = "2023-01-01-preview" and the previous apiVersion = "2021-05-01-preview." However, we received a response code of 200, and the API responses contained null values.
5) Look at Purview Logs:
In the Azure portal, we are only receiving activity administrative logs.Could you please assist me with this on priority?
-
Ganesh Gurram • 4,965 Reputation points • Microsoft External Staff
2025-02-24T21:00:29.1633333+00:00 @Damodaram Chinna Swamulu - Thank you for providing additional details about your issue with the Microsoft Purview API. Could you please try the following steps and let us know if they resolve the issue:
Since the scan was successful and data is in the catalog, please verify that the specific schema classification data you're trying to retrieve is indeed present and correctly classified. This can be done by checking the Purview UI to see if the data is visible there.
Ensure that you are not hitting any API limits or throttling issues. Sometimes, silent failures can occur if the API usage exceeds certain thresholds. Check any relevant metrics or quotas in the Azure portal related to API calls.
Since you've confirmed that the query worked before, let's ensure there have been no changes in the data or classification tags that might affect the search results. Try using a broader query and gradually narrow it down to identify if certain filters are causing the null response.
For more details refer: https://docs.azure.cn/en-us/purview/troubleshoot-policy-distribution
I hope this information helps!
-
Damodaram Chinna Swamulu • 0 Reputation points
2025-02-25T10:24:06.8433333+00:00 - The scan of the Azure SQL Database was successful, and data is available in the catalog. Schema classification is visible in the Purview UI.
Schema Classification in Purview UI.png - We are not hitting any API limits, and there are no throttling issues. The API I am using does not exceed certain thresholds. We checked, and there are no issues from metrics and quotas related to API calls.
- We tried broader queries and narrow queries also but received null values in response.
Response from API.png
If possible, can we set up a call at your convenient time?
- The scan of the Azure SQL Database was successful, and data is available in the catalog. Schema classification is visible in the Purview UI.
-
Deleted
This comment has been deleted due to a violation of our Code of Conduct. The comment was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
-
AnnuKumari-MSFT • 34,351 Reputation points • Microsoft Employee
2025-02-26T15:43:16.64+00:00 I am checking on this with the internal team. I will keep you posted on the response from the team. Thankyou
-
Damodaram Chinna Swamulu • 0 Reputation points
2025-03-03T06:10:29.6333333+00:00 We are waiting for your response. Please update us if you have any information related to the above question.
-
Damodaram Chinna Swamulu • 0 Reputation points
2025-03-03T06:36:04.73+00:00 We are waiting for your response. Please update us if you have any information related to the above question.
-
AnnuKumari-MSFT • 34,351 Reputation points • Microsoft Employee
2025-03-04T03:56:40.0666667+00:00 Could you please let me know whether you are able to see classifications against the sql tables or views in the UX?
Secondly, could you please share the code snippet, or the API calls being made?
Thankyou -
Damodaram Chinna Swamulu • 0 Reputation points
2025-03-04T19:16:07.4+00:00 @Anonymous
First, we are able to see classifications against the SQL tables in the UX.
Schema Classification in Purview UI.pngSecond,
API : Post Method
"https://{purviewaccountName}.purview.azure.com/catalog/api/atlas/v2/search/advanced?api-version={apiVersion}"apiVersion : "2021-05-01-preview" and "2023-01-01-preview"
Body :
{ "criteria": { "filter": { "criteria": [ { "attributeName": "assetType", "operator": "eq", "attributeValue": "Azure SQL Database" } ] } } }
Response from API
Response from API.png -
AnnuKumari-MSFT • 34,351 Reputation points • Microsoft Employee
2025-03-10T10:37:29.22+00:00 Thankyou for the required details. I am checking with the internal team . I will keep you posted once I hear back from them. Thankyou
-
AnnuKumari-MSFT • 34,351 Reputation points • Microsoft Employee
2025-03-12T05:54:43.1466667+00:00 It seems that you are using the search API instead of get entity API.
Could you please try with get entity API to get atlas classification? You can find details here: https://learn.microsoft.com/en-us/rest/api/purview/datamapdataplane/entity/get?view=rest-purview-datamapdataplane-2023-09-01&tabs=HTTP
Hope it helps. Kindly let us know how it goes. Thankyou
Sign in to comment