Skip to main 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

Asset structure

Connection

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
String adminRoleGuid = client.getRoleCache().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(client); // (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 GUIDs of the workspace roles. 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 names of the groups. 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 usernames of the users. At least one of adminRoles, adminGroups, or adminUsers must be provided.
  8. Actually call Atlan to create the connection. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
  9. Retrieve the qualifiedName for use in subsequent creation calls. (You'd probably want to do some null checking first.)

ADLSAccount

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
ADLSAccount adlsAccount = ADLSAccount.creator( // (1)
"myaccount", // (2)
connectionQualifiedName) // (3)
.build();
AssetMutationResponse response = adlsAccount.save(client); // (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. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
  5. Retrieve the created account for use in subsequent creation calls. (You'd probably want to do some null checking first.)

ADLSContainer

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
ADLSContainer adlsContainer = ADLSContainer.creator( // (1)
"mycontainer", // (2)
adlsAccount) // (3)
.adlsObjectCount(10) // (4)
.build();
AssetMutationResponse response = adlsContainer.save(client); // (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 didn't 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 make sure 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. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
  6. Retrieve the created container for use in subsequent creation calls. (You'd probably want to do some null checking first.)

ADLSObject

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
ADLSObject adlsObject = ADLSObject.creator( // (1)
"myobject.csv", // (2)
adlsContainer) // (3)
.build();
AssetMutationResponse response = adlsObject.save(client); // (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 didn't 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. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

By prefix

Create an ADLS object using prefix:

Coming soon
Coming soon

Available relationships

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

Footnotes

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

Was this page helpful?