Skip to content

ADLS Manage Azure Data Lake Storage assets

Operations on ADLS assets (connections, accounts, containers, objects).

In general, these should be:

  • Created in top-down order (connection, then account, then container, then object)
  • Deleted in bottom-up order (objects, then containers, then accounts, then connections)1
erDiagram
  Connection ||--o{ ADLSAccount : contains
  ADLSAccount ||--o{ ADLSContainer : contains
  ADLSContainer ||--o{ ADLSObject : contains

Asset structure

Connection

2.0.0 1.0.0

An Azure Data Lake Storage connection requires a name and qualifiedName. For creation, specific settings are also required to distinguish it as an Azure Data Lake Storage connection rather than another type of connection. In addition, at least one of adminRoles, adminGroups, or adminUsers must be provided.

Create an ADLS connection
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
String adminRoleGuid = RoleCache.getIdForName("$admin"); // (1)
Connection connection = Connection.creator( // (2)
        "adls-connection", // (3)
        AtlanConnectorType.ADLS, // (4)
        List.of(adminRoleGuid), // (5)
        List.of("group2"), // (6)
        List.of("jsmith")) // (7)
    .build();
AssetMutationResponse response = connection.save(); // (8)
String connectionQualifiedName = response.getCreatedAssets().get(0).getQualifiedName(); // (9)
  1. Retrieve the GUID for the admin role, to use later for defining the roles that can administer the connection.
  2. Build up the minimum request to create a connection.
  3. Provide a human-readable name for your connection, such as production or development.
  4. Set the type of connection to ADLS.
  5. List the workspace roles that should be able to administer the connection (or null if none). All users with that workspace role (current and future) will be administrators of the connection. Note that the values here need to be the GUID(s) of the workspace role(s). At least one of adminRoles, adminGroups, or adminUsers must be provided.
  6. List the group names that can administer this connection (or null if none). All users within that group (current and future) will be administrators of the connection. Note that the values here are the name(s) of the group(s). At least one of adminRoles, adminGroups, or adminUsers must be provided.
  7. List the user names that can administer this connection (or null if none). Note that the values here are the username(s) of the user(s). At least one of adminRoles, adminGroups, or adminUsers must be provided.
  8. Actually call Atlan to create the connection.
  9. Retrieve the qualifiedName for use in subsequent creation calls. (You'd probably want to do some null checking first.)
Create an ADLS connection
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from pyatlan.cache.role_cache import RoleCache
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Connection, ADLSAccount, ADLSContainer, ADLSObject
from pyatlan.model.enums import AtlanConnectorType

admin_role_guid = RoleCache.get_id_for_name("$admin") # (1)
connection = Connection.creator( # (2)
  name = "adls-connection", # (3)
  connector_type = AtlanConnectorType.ADLS, # (4)
  admin_roles = [admin_role_guid], # (5)
  admin_groups = ["group2"], # (6)
  admin_users = ["jsmith"] # (7)
)

response = client.asset.save(connection) # (8)
connection_qualified_name = response.assets_created(asset_type=Connection)[0].qualified_name # (9)
  1. Retrieve the GUID for the admin role, to use later for defining the roles that can administer the connection.
  2. Build up the minimum request to create a connection.
  3. Provide a human-readable name for your connection, such as production or development.
  4. Set the type of connection to ADLS.
  5. List the workspace roles that should be able to administer the connection (or None if none). All users with that workspace role (current and future) will be administrators of the connection. Note that the values here need to be the GUID(s) of the workspace role(s). At least one of admin_roles, admin_groups, or admin_users must be provided.
  6. List the group names that can administer this connection (or None if none). All users within that group (current and future) will be administrators of the connection. Note that the values here are the name(s) of the group(s). At least one of admin_roles, admin_groups, or admin_users must be provided.
  7. List the user names that can administer this connection (or None if none). Note that the values here are the username(s) of the user(s). At least one of admin_roles, admin_groups, or admin_users must be provided.
  8. Actually call Atlan to create the connection.
  9. Retrieve the qualified_name for use in subsequent creation calls. (You'd probably want to do some null checking first.)
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "entities": [
    {
      "typeName": "Connection", // (1)
      "attributes": {
        "name": "adls-connection", // (2)
        "connectorName": "adls", // (3)
        "qualifiedName": "default/adls/123456789", // (4)
        "category": "ObjectStore", // (5)
        "adminRoles": [ // (6)
          "e7ae0295-c60a-469a-bd2c-fb903943aa02"
        ],
        "adminGroups": [ // (7)
          "group2"
        ],
        "adminUsers": [ // (8)
          "jsmith"
        ]
      }
    }
  ]
}
  1. The typeName must be exactly Connection.
  2. Human-readable name for your connection, such as production or development.
  3. The connectorName must be exactly adls.
  4. The qualifiedName should follow the pattern: default/adls/<epoch>, where <epoch> is the time in milliseconds at which the connection is being created.
  5. The category must be ObjectStore.
  6. List any workspace roles that can administer this connection. All users with that workspace role (current and future) will be administrators of the connection. Note that the values here need to be the GUID(s) of the workspace role(s). At least one of adminRoles, adminGroups, or adminUsers must be provided.
  7. List any groups that can administer this connection. All users within that group (current and future) will be administrators of the connection. Note that the values here are the name(s) of the group(s). At least one of adminRoles, adminGroups, or adminUsers must be provided.
  8. List any users that can administer this connection. Note that the values here are the username(s) of the user(s). At least one of adminRoles, adminGroups, or adminUsers must be provided.

Access policies

Atlan creates the policies that grant access to a connection, including the ability to retrieve the connection and to create assets within it, asynchronously. It can take several seconds (even up to approximately 30 seconds) before these are in place after creating the connection.

You may therefore need to wait before you'll be able to create the assets below within the connection.

To confirm access, retrieve the connection after it has been created. The SDKs' retry loops will automatically retry until the connection can be successfully retrieved. At that point, your API token has permission to create the other assets.

Note: if you are reusing an existing connection rather than creating one via your API token, you must give your API token a persona that has access to that connection. Otherwise all attempts to create, read, update, or delete assets within that connection will fail due to a lack of permissions.

ADLSAccount

2.0.0 1.0.0

An Azure Data Lake Storage account requires a name and a qualifiedName. For creation, you also need to specify the connectionQualifiedName of the connection for the account.

Create an ADLS account
11
12
13
14
15
16
ADLSAccount adlsAccount = ADLSAccount.creator( // (1)
        "myaccount", // (2)
        connectionQualifiedName) // (3)
    .build();
AssetMutationResponse response = adlsAccount.save(); // (4)
adlsAccount = response.getResult(adlsAccount); // (5)
  1. Build up the minimum request to create an account.
  2. Provide a human-readable name for your account.
  3. Provide the qualifiedName of the connection for this account.
  4. Actually call Atlan to create the account.
  5. Retrieve the created account for use in subsequent creation calls. (You'd probably want to do some null checking first.)
Create an ADLS account
17
18
19
20
21
22
adlsaccount = ADLSAccount.creator( # (1)
  name = "myaccount", # (2)
  connection_qualified_name = connection_qualified_name # (3)
)
response = client.asset.save(adlsaccount) # (4)
adls_account_qualified_name = response.assets_created(asset_type=ADLSAccount)[0].qualified_name # (5)
  1. Build up the minimum request to create an account.
  2. Provide a human-readable name for your account.
  3. Provide the qualified_name of the connection for this account.
  4. Actually call Atlan to create the account.
  5. Retrieve the created account for use in subsequent creation calls. (You'd probably want to do some null checking first.)
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "entities": [
    {
      "typeName": "ADLSAccount", // (1)
      "attributes": {
        "name": "myaccount", // (2)
        "qualifiedName": "default/adls/123456789/myaccount", // (3)
        "connectionQualifiedName": "default/adls/123456789", // (4)
        "connectorName": "adls" // (5)
      }
    }
  ]
}
  1. The typeName must be exactly ADLSAccount.
  2. Human-readable name for your account.
  3. The qualifiedName should follow the pattern: default/adls/<epoch>/<name>, where default/adls/<epoch> is the qualifiedName of the connection for this account and <name> is the unique name for this account.
  4. The connectionQualifiedName must be the exact qualifiedName of the connection for this account.
  5. The connectorName must be exactly adls.

ADLSContainer

2.0.0 1.0.0

An Azure Data Lake Storage container requires a name and a qualifiedName. For creation, you also need to specify the account that will contain the container.

Create an ADLS container
17
18
19
20
21
22
23
ADLSContainer adlsContainer = ADLSContainer.creator( // (1)
        "mycontainer", // (2)
        adlsAccount) // (3)
    .adlsObjectCount(10) // (4)
    .build();
AssetMutationResponse response = adlsContainer.save(); // (5)
adlsContainer = response.getResult(adlsContainer); // (6)
  1. Build up the minimum request to create a container.
  2. Provide a human-readable name for your container.
  3. Provide the account for this container. If you did not already have the object, you could also use ADLSAccount.refByGuid() with the GUID of the account, or ADLSAccount.refByQualifiedName() with the qualifiedName of the account.
  4. (Optional) To ensure the UI displays the correct count of ADLSObject's, set the adlsObjectCount directly on the ADLSContainer instance.
  5. Actually call Atlan to create the object.
  6. Retrieve the created container for use in subsequent creation calls. (You'd probably want to do some null checking first.)
Create an ADLS container
23
24
25
26
27
28
29
adlscontainer = ADLSContainer.creator( # (1)
  name = "mycontainer", # (2)
  adls_account_qualified_name = adls_account_qualified_name # (3)
)
adlscontainer.adls_object_count = 10 # (4)
response = client.asset.save(adlscontainer) # (5)
adls_container_qualified_name = response.assets_created(asset_type=ADLSContainer)[0].qualified_name # (6)
  1. Build up the minimum request to create a container.
  2. Provide a human-readable name for your container.
  3. Provide the qualified_name of the ADLS account for this container.
  4. (Optional) To ensure the UI displays the correct count of ADLSObject's, set the adls_object_count directly on the ADLSContainer instance.
  5. Actually call Atlan to create the object.
  6. Retrieve the created container for use in subsequent creation calls. (You'd probably want to do some null checking first.)
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
  "entities": [
    {
      "typeName": "ADLSContainer", // (1)
      "attributes": {
        "name": "mycontainer", // (2)
        "qualifiedName": "default/adls/123456789/myaccount/mycontainer", // (3)
        "connectionQualifiedName": "default/adls/123456789", // (4)
        "connectorName": "adls", // (5)
        "adlsAccount": { // (6)
          "typeName": "ADLSAccount", // (7)
          "uniqueAttributes": { // (8)
            "qualifiedName": "default/adls/123456789/myaccount"
          }
        }
      }
    }
  ]
}
  1. The typeName must be exactly ADLSContainer.
  2. Human-readable name for your container.
  3. The qualifiedName should follow the pattern: default/adls/<epoch>/<account>/<name>, where default/adls/<epoch>/<account> is the qualifiedName of the account for this container and <name> is the unique name for this container.
  4. The connectionQualifiedName must be the exact qualifiedName of the connection for this container.
  5. The connectorName must be exactly adls.
  6. The account in which this container exists is embedded in the adlsAccount attribute.
  7. The typeName for this embedded reference must be ADLSAccount.
  8. To complete the reference, you must include a uniqueAttributes object with the qualifiedName of the account. Note: the account must already exist in Atlan before creating the container.

ADLSObject

2.0.0 1.0.0

An Azure Data Lake Storage object requires a name and a qualifiedName. For creation, you also need to specify the containerQualifiedName of the container that will contain the object.

Create an ADLS object
23
24
25
26
27
ADLSObject adlsObject = ADLSObject.creator( // (1)
        "myobject.csv", // (2)
        adlsContainer) // (3)
    .build();
AssetMutationResponse response = adlsObject.save(); // (4)
  1. Build up the minimum request to create an object.
  2. Provide a human-readable name for your object.
  3. Provide the container for this object. If you did not already have the container, you could also use ADLSContainer.refByGuid() with the GUID of the container, or ADLSContainer.refByQualifiedName() with the qualifiedName of the container.
  4. Actually call Atlan to create the object.
Create an ADLS object
29
30
31
32
33
adlsobject = ADLSObject.creator( # (1)
  name = "myobject.csv", # (2)
  adls_container_qualified_name = adls_container_qualified_name # (3)
)
response = client.asset.save(adlsobject) # (4)
  1. Build up the minimum request to create an object.
  2. Provide a human-readable name for your object.
  3. Provide the qualified_name of the ADLS container.
  4. Actually call Atlan to create the object.
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
  "entities": [
    {
      "typeName": "ADLSObject", // (1)
      "attributes": {
        "name": "myobject.csv", // (2)
        "qualifiedName": "default/adls/123456789/myaccount/mycontainer/myobject.csv", // (3)
        "connectionQualifiedName": "default/adls/123456789", // (4)
        "adlsAccountQualifiedName": "default/adls/123456789/myaccount", // (5)
        "connectorName": "adls", // (6)
        "adlsContainer": { // (7)
          "typeName": "ADLSContainer", // (8)
          "uniqueAttributes": { // (9)
            "qualifiedName": "default/adls/123456789/myaccount/mycontainer"
          }
        }
      }
    }
  ]
}
  1. The typeName must be exactly ADLSObject.
  2. Human-readable name for your object.
  3. The qualifiedName should follow the pattern: default/adls/<epoch>/<account>/<container>/<name>, where default/adls/<epoch>/<account>/<container> is the qualifiedName of the container for this object and <name> is the unique name for this object.
  4. The connectionQualifiedName must be the exact qualifiedName of the connection for this object.
  5. The adlsAccountQualifiedName must be the exact qualifiedName of the ADLS account.
  6. The connectorName must be exactly adls.
  7. The container in which this object exists is embedded in the adlsContainer attribute.
  8. The typeName for this embedded reference must be ADLSContainer.
  9. To complete the reference, you must include a uniqueAttributes object with the qualifiedName of the container. Note: the container must already exist in Atlan before creating the object.

Available relationships

Every level of the object store structure is an Asset, and can therefore be related to the following other assets.


title: Asset management overview description: Overview of asset-related entities and their relationships, including glossary terms, links, READMEs, and processes.


erDiagram
  Asset }o--o{ AtlasGlossaryTerm : meanings
  Asset ||--o{ Link : links
  Asset ||--o| Readme : readme
  Asset }o--o{ Process : inputToProcesses
  Asset }o--o{ Process : outputFromProcesses

AtlasGlossaryTerm

A glossary term provides meaning to an asset. The link terms to assets snippet provides more detail on setting this relationship.

A link provides additional context to an asset, by providing a URL to additional information.

Readme

A README provides rich documentation for an asset. The add asset READMEs snippet provides more detail on setting this relationship.

Process

A process provides lineage information for an asset. An asset can be both an input and an output for one or more processes. The lineage snippets provide more detail on creating and working with lineage.


  1. Although if you want to delete everything in a connection, your better avenue is the packaged connection delete utility in the UI.