Getting authorization issue while create an atlas entity in purview using AtlasClient

I am trying to run below code and getting AtlasException:

{“requestId”:”36fb4fc3-bc6b-4583-b6a1-faac6a5723b4″,”errorCode”:”ATLAS-403-00-001″,”errorMessage”:”5133fd99-b486-4723-ac91-c8acc375a4ed is not authorized to perform create entity: type=test file”}

Note: I have access to only specific collection in Purview. I cannot create entities in root collection.

from azure.identity import ClientSecretCredential
from pyapacheatlas.auth import ServicePrincipalAuthentication
from pyapacheatlas.core import AtlasClient, collections
from pyapacheatlas.core import AtlasEntity, RelationshipTypeDef
import requests
import os
import json
import pandas as pd
import pydicom

# Azure AD credentials
tenant_id = "xxxxxxxxxxxxxxxxxxxx"
client_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Purview account details
purview_account_name = "account-name"
collection_name = "abcde"

# Authenticate using AAD
credential = ClientSecretCredential(tenant_id, client_id, client_secret)
auth = ServicePrincipalAuthentication(
       tenant_id=tenant_id,
       client_id=client_id,
       client_secret=client_secret
   )

# Create an Atlas client
client = AtlasClient(
       endpoint_url=f"https://{purview_account_name}.purview.azure.com/catalog/api/atlas/v2",
       authentication=auth
   )

entity_up = AtlasEntity(
       name="API_TEST_NEW",
       typeName='test file',
       qualified_name="TESTING_API_NEW",
       attributes={
        "description": "A sample entity with custom attributes",
        "businessAttributes": {
            "businessAttribute1": "Business Value 1",
            "businessAttribute2": "Business Value 2"
        },
        "customAttributes": {
            "customKey1": "Custom Value 1",
            "customKey2": "Custom Value 2"
        }
    },
    collectionId = 'abcde', 
    domainId = 'account-name',
       contacts = {
      "Expert": [
        {
          "id": "xxxxxxxxxxxxxxxxx",
          "info": "Example Expert Info"
        }
      ],
      "Owner": [
        {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
          "info": "Example Owner Info"
        }
      ]
    },
   )
client.upload_entities(entity_up)

How to create entities in specific collection(Not in root) using AtlasClient? I am able to create it through PurviewClient but getting issue with AtlasClient.

New contributor

Naveen Chandraiah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

errorMessage”:”5133fd99-b486-4723-ac91-c8acc375a4ed is not authorized to perform create entity:

The client you are using is not having required permissions to create entity in specific collection, that may be the reason to get above error. According to the MS document The client should below roles to perform actions on collections:

  • Collection admins
  • Data source admins
  • Data curators
  • Data readers

For each role, select the Edit role assignments button and select the role you want to add the service principal to. Or select the Add button next to each role, and add the service principal by searching its name or Client ID as shown below:

Then you will be able to create entity in particular collections. For more information, you can refer below:

  • https://learn.microsoft.com/en-us/answers/questions/2087651/getting-unauthorized-error-while-creating-entity-p

  • https://learn.microsoft.com/en-us/answers/questions/1233528/unauthorized-not-authorized-to-create-processes-in

Recognized by Microsoft Azure Collective

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Getting authorization issue while create an atlas entity in purview using AtlasClient

I am trying to run below code and getting AtlasException:

{“requestId”:”36fb4fc3-bc6b-4583-b6a1-faac6a5723b4″,”errorCode”:”ATLAS-403-00-001″,”errorMessage”:”5133fd99-b486-4723-ac91-c8acc375a4ed is not authorized to perform create entity: type=test file”}

Note: I have access to only specific collection in Purview. I cannot create entities in root collection.

from azure.identity import ClientSecretCredential
from pyapacheatlas.auth import ServicePrincipalAuthentication
from pyapacheatlas.core import AtlasClient, collections
from pyapacheatlas.core import AtlasEntity, RelationshipTypeDef
import requests
import os
import json
import pandas as pd
import pydicom

# Azure AD credentials
tenant_id = "xxxxxxxxxxxxxxxxxxxx"
client_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Purview account details
purview_account_name = "account-name"
collection_name = "abcde"

# Authenticate using AAD
credential = ClientSecretCredential(tenant_id, client_id, client_secret)
auth = ServicePrincipalAuthentication(
       tenant_id=tenant_id,
       client_id=client_id,
       client_secret=client_secret
   )

# Create an Atlas client
client = AtlasClient(
       endpoint_url=f"https://{purview_account_name}.purview.azure.com/catalog/api/atlas/v2",
       authentication=auth
   )

entity_up = AtlasEntity(
       name="API_TEST_NEW",
       typeName='test file',
       qualified_name="TESTING_API_NEW",
       attributes={
        "description": "A sample entity with custom attributes",
        "businessAttributes": {
            "businessAttribute1": "Business Value 1",
            "businessAttribute2": "Business Value 2"
        },
        "customAttributes": {
            "customKey1": "Custom Value 1",
            "customKey2": "Custom Value 2"
        }
    },
    collectionId = 'abcde', 
    domainId = 'account-name',
       contacts = {
      "Expert": [
        {
          "id": "xxxxxxxxxxxxxxxxx",
          "info": "Example Expert Info"
        }
      ],
      "Owner": [
        {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
          "info": "Example Owner Info"
        }
      ]
    },
   )
client.upload_entities(entity_up)

How to create entities in specific collection(Not in root) using AtlasClient? I am able to create it through PurviewClient but getting issue with AtlasClient.

New contributor

Naveen Chandraiah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

errorMessage”:”5133fd99-b486-4723-ac91-c8acc375a4ed is not authorized to perform create entity:

The client you are using is not having required permissions to create entity in specific collection, that may be the reason to get above error. According to the MS document The client should below roles to perform actions on collections:

  • Collection admins
  • Data source admins
  • Data curators
  • Data readers

For each role, select the Edit role assignments button and select the role you want to add the service principal to. Or select the Add button next to each role, and add the service principal by searching its name or Client ID as shown below:

Then you will be able to create entity in particular collections. For more information, you can refer below:

  • https://learn.microsoft.com/en-us/answers/questions/2087651/getting-unauthorized-error-while-creating-entity-p

  • https://learn.microsoft.com/en-us/answers/questions/1233528/unauthorized-not-authorized-to-create-processes-in

Recognized by Microsoft Azure Collective

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật