Cannot update scan filter for ADLS Gen2 data source - getting HTTP 400 error

SnurovasAleksandras-3884 40 Reputation points
2023-12-22T17:34:08.2633333+00:00

I am using this API endpoint to update the scan filter of an ADLS Gen2 data source to exclude some URL prefixes:
https://learn.microsoft.com/en-us/rest/api/purview/scanningdataplane/filters/create-or-replace?view=rest-purview-scanningdataplane-2023-09-01&tabs=HTTP

It worked before, but recently it has started returning a 400 HTTP error. I have tried several previous API versions. The only thing that works is sending a request with an empty excludeUriPrefixes list, which successfully removes previously existing filters. Here are my request and response details:

Request body:

{ 	
	"properties": { 		
		"excludeUriPrefixes": [ 			
			"https://nameofmydatalake.dfs.core.windows.net/path1",
			"https://nameofmydatalake.dfs.core.windows.net/path2",
			"https://nameofmydatalake.dfs.core.windows.net/path3",
			"https://nameofmydatalake.dfs.core.windows.net/path4",
 			"https://nameofmydatalake.dfs.core.windows.net/path5"
 		],
 		"includeUriPrefixes": []
 	}
}

Response:

{
	"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
	"title": "Bad Request",
	"status": 400,
	"traceId": "xx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx-xx"
}
Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,580 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bhargava-MSFT 31,246 Reputation points Microsoft Employee Moderator
    2023-12-22T19:29:51.1833333+00:00

    Hello SnurovasAleksandras-3884,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others (Opens in new window or tab)", I'll repost your solution in case you'd like to "Accept (Opens in new window or tab)" the answer.

    Issue: Purview- Cannot update scan filter for ADLS Gen2 data source

    Error: HTTP 400 error

    Solution:

    Adding a single "https://nameofmydatalake.dfs.core.windows.net" item to the includeUriPrefixes list in the request fixed the issue.

    Example:

    
    {
      "properties": {
        "includeUriPrefixes": [
          "https://foo.file.core.windows.net/share1/user"
        ],
        "excludeUriPrefixes": [
          "https://foo.file.core.windows.net/share1/user/temp"
        ]
      }
    }
    

    If you have any other questions or are still running into more issues, please let me know.
    Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. SnurovasAleksandras-3884 40 Reputation points
    2023-12-22T17:42:04.1533333+00:00

    After some more tinkering, it seems like adding a single "https://nameofmydatalake.dfs.core.windows.net" item to the includeUriPrefixes list in the request fixed this.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.