> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to OneLake using an Azure client secret

> Use this Azure identity to read an existing OneLake table.

How-to guideApplies to: Unified engine deployments

Use this Azure identity to read an existing OneLake table.

## Before you start

Create the application and grant it OneLake workspace and table access. Store
its client secret in recipe\_azure\_client\_secret using
[Secrets](https://docs.e6data.com/transformation/learn/secrets.md).

Use an existing catalog with at least one readable Iceberg table. The engine and
workers must reach the catalog and its table storage. Have the remote identity
and permissions ready before creating the Unified registration. Replace the
namespace and table with one you know has data. The service must return usable
temporary storage credentials, or the table location must already have
configured storage access in Unified. Requesting delegation alone does not grant
access. This recipe covers the restricted OneLake read interface.

## Values to collect

* Identity-specific values below; OneLake REST URI, warehouse, namespace, and
  table.

## Run the SQL

Replace every `<placeholder>` before running. Use unused names for the resources
below. Run the statements in order in Workbench.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
CREATE CREDENTIAL recipe_azure_client_secret_auth USING azure
OPTIONS (
  'authentication' = 'client_secret',
  'scopes' = 'https://storage.azure.com/.default',
  'tenant_id' = '<tenant-id>',
  'client_id' = '<application-client-id>'
)
SECRETS ('client_secret' = 'recipe_azure_client_secret');

CREATE CATALOG recipe_azure_client_secret USING `iceberg-rest`
OPTIONS (
  'catalog.type' = 'onelake',
  'uri' = '<onelake-rest-uri>',
  'warehouse' = '<warehouse>',
  'auth.type' = 'bearer',
  'scope' = 'https://storage.azure.com/.default',
  'header.x-iceberg-access-delegation' = 'vended-credentials'
)
CREDENTIALS ('auth' = 'recipe_azure_client_secret_auth');

SELECT *
FROM recipe_azure_client_secret.`<namespace>`.`<table>`
LIMIT 5;
```

## Check the result

The SELECT should return up to five rows from the chosen table. Use a nonempty
table for this check. This verifies both metadata and table-file access;
creating the registration alone does not verify either.

## Clean up

This removes only the Unified registrations. It leaves the remote catalog and
its tables in place.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
DROP CATALOG recipe_azure_client_secret;
DROP CREDENTIAL recipe_azure_client_secret_auth;
```

Remove the input secrets only if you created them for this recipe and no other
consumer uses them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.