question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PurviewScanClient.CreateOrUpdateAsync() throws exception instead of returning valid Response when collection is not found.

See original GitHub issue

When creating a new Purview scan using Postman with a collection referenceName name that does not exist i get a 403 Forbidden containing the following body. The body represents the Schema for Response Error as described on the documentation page.

{
    "error": {
        "code": "Unauthorized",
        "message": "Not authorized to access account"
    }
}

When performing the same call from the Azure SDK i get a RequestFailedException() with Status 403 (same status) but there is no way to access the content of the response because the exception object has no reference to the body or content of the response. This masks the actual underlying error which can be beneficial for logging and analysis.

The exceptions message property also does not contain the full error response message from the Postman example as show below.

Azure.RequestFailedException : Service request failed.
Status: 403 (Forbidden)

Headers:
Date: Wed, 18 May 2022 09:52:31 GMT
Transfer-Encoding: chunked
Strict-Transport-Security: REDACTED
x-ms-correlation-request-id: REDACTED


Stack Trace: 
HttpPipelineExtensions.ProcessMessageAsync(HttpPipeline pipeline, HttpMessage message, ClientDiagnostics clientDiagnostics, RequestOptions requestOptions, CancellationToken cancellationToken)
PurviewScanClient.CreateOrUpdateAsync(RequestContent content, RequestOptions options)
ScansClient.CreateOrUpdateScanAsync(PurviewScan scan) line 78
ScansClientTests.Should_Return_Null_On_None_Valid_Collection() line 38
--- End of stack trace from previous location ---

Also, the documentation does not state this exception as an expected response. The documentation does state that a Task<Response> will be returned.

Another issue is that the error message is misleading in general making the user (like me) search for access control issues instead of a missing collection name. 403 feels like a higher-level error on transport level.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RakeshMohanMSFTcommented, Jun 1, 2022

@martijnvanschie Thank you for reaching out, we are looking into it.

0reactions
navba-MSFTcommented, Jul 15, 2022

@martijnvanschie Thanks for getting back. I am adding Service team to look into this issue and provide an update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft Purview Get Entities By Unique Attributes does ...
As per my understanding while using the Get - Entity by Bulk Unique Attribues API, it is returning an empty collection in response...
Read more >
Indexer errors and warnings - Azure Cognitive Search
This article provides information and solutions to common errors and warnings you might encounter during indexing and AI enrichment in Azure ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found