Unable to update annotations using azure data catalog API.

Eric Madariaga 6 Reputation points
2022-01-12T03:27:45.057+00:00

I am trying to update annotations using data catalog API's and getting the following error.

{
"error": {
"code": "InvalidLastRegisteredBy",
"message": "LastRegisteredBy is different from the current user."
}
}.

I am using LastRegisteredBy UPN which I am getting from get annotations API and I have logged in to application using the same mail id.

Please suggest on this.

Azure Data Catalog
Azure Data Catalog
An Azure service that serves as a system of registration and system of discovery for enterprise data assets.
103 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,502 Reputation points Microsoft Employee
    2022-01-12T18:13:01.247+00:00

    Hello @Eric Madariaga ,

    Thanks for the question and using MS Q&A platform.

    From the error message my understanding is the LastRegisteredBy value is different/mismatch which is causing the issue. Could you please make sure to validate if the LastRegisteredBy passed is the correct one? Usually it should be the user who created the annotation/item. Please make sure to validate upn , firstName, lastName are correct.

    Just in case if you are using a registered app or service principal, then the user-name of the registered app should be provided as : clientIDFromAzureAppRegistration@tenantId.

    By default when an item is created in the catalog its Contributor is set to the currently authenticated user. If item should be updatable by everyone, Contributor should be set to <Everyone> special security principal in the roles property when item is first published (refer to the following example). Contributor cannot be changed and stays the same during life-time of an item (even Administrator or Owner doesn’t have the right to change the Contributor). The only value supported for the explicit setting of the Contributor is <Everyone>: Contributor can only be a user who created an item or <Everyone>.

    Example:

    Set Contributor to <Everyone> when publishing an item. Special security principal <Everyone> has objectId "00000000-0000-0000-0000-000000000201". POST https://api.azuredatacatalog.com/catalogs/default/views/tables/?api-version=2016-03-30  
    
    
    {  
            "roles": [  
                {  
                    "role": "Contributor",  
                    "members": [  
                        {  
                            "objectId": "00000000-0000-0000-0000-000000000201"  
                        }  
                    ]  
                }  
            ]  
        }  
    

    To explore more about the roles and permissions related to Azure Data catalog please refer to this doc: Azure Data catalog Roles and authorization

    Hope this will help. Please let us know how it goes or if you have any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

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.