You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c3060fa
Browse filesBrowse the repository at this point in the historyBrowse files
* init
* Don't use the Azure credential chain for contracts posted to the API
A contract posted to `datacontract api` no longer reads Azure data with the API host's own identity (managed identity, `az login`, `AZURE_*` variables). Without a complete service principal, the test now fails with an error naming the missing `DATACONTRACT_AZURE_*` variable; callers can send the service principal as `datacontract-azure-*` request headers. `datacontract test` and `datacontract import` on the command line keep using the credential chain.
* Remove the unreachable DuckDB version check for the Azure credential chain
* Build the Azure DuckDB secret from an options dict, like the S3 one
* Log why the Azure credential chain is used
With --debug, `datacontract test` and `datacontract import` on Azure now log when they fall back to the Azure credential chain, naming the DATACONTRACT_AZURE_* service principal variables that are not set (if any are set at all).
* Document that Delta tables need DATACONTRACT_AZURE_CREDENTIAL_CHAIN=cli after az login
* Drop a test that only re-checks reading a config option from the environment
* Shorten the Azure credential chain CHANGELOG entry
---------
Co-authored-by: Jakob Schödl <jakob.schoedl@entropy-data.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
21
21
-`datacontract test`: test Excel sheets whose header is not in the first row, with an `xlsxRange` custom property per schema, and fail a sheet whose header row is empty (#1717@nicolehazel)
22
22
- Error messages link to the matching docs page: the server type's reference page when `datacontract test` fails, the format's guide when `import` or `export` fails, and the installation page when an optional dependency is missing
23
23
-`datacontract lint` and `datacontract test` fail on duplicate schema, property, server and role names, and on duplicate `id`s within the same array; checks are skipped with a custom `--json-schema`
24
+
-`datacontract test` and `datacontract import` authenticate to Azure through the Azure credential chain (e.g. `az login`) when no service principal is configured (@dmaresma)
Copy file name to clipboardExpand all lines: docs/docs/reference/azure.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,15 +21,19 @@ servers:
21
21
22
22
## Authentication
23
23
24
-
Authentication uses an Azure Service Principal (App Registration) with a secret:
24
+
Two authentication methods are supported by the DuckDB engine (`datacontract test` on Azure files):
25
+
26
+
1. **Service Principal (App Registration) with a secret.** Used when all three of `DATACONTRACT_AZURE_TENANT_ID`, `DATACONTRACT_AZURE_CLIENT_ID` and `DATACONTRACT_AZURE_CLIENT_SECRET` are set.
27
+
2. **Azure credential chain.** Used as soon as the service principal variables are not all set: Azure CLI (`az login`), environment, managed identity, workload identity, and so on. It uses the `CREDENTIAL_CHAIN` provider of the DuckDB `azure` extension. Contracts posted to `datacontract api` never use the chain, so the API server's own identity is not lent to its callers; send the service principal as `datacontract-azure-*` request headers instead.
25
28
26
29
| Variable | Example | Description |
27
30
|---|---|---|
28
-
| `DATACONTRACT_AZURE_TENANT_ID` | `79f5b80f-...` | The Azure Tenant ID |
29
-
| `DATACONTRACT_AZURE_CLIENT_ID` | `3cf7ce49-...` | The Application/Client ID of the app registration |
30
-
| `DATACONTRACT_AZURE_CLIENT_SECRET` | `yZK8Q~GWO1M...` | The client secret value |
31
+
| `DATACONTRACT_AZURE_TENANT_ID` | `79f5b80f-...` | The Azure Tenant ID (service principal) |
32
+
| `DATACONTRACT_AZURE_CLIENT_ID` | `3cf7ce49-...` | The Application/Client ID of the app registration (service principal) |
33
+
| `DATACONTRACT_AZURE_CLIENT_SECRET` | `yZK8Q~GWO1M...` | The client secret value (service principal) |
34
+
| `DATACONTRACT_AZURE_CREDENTIAL_CHAIN` | `cli;env;managed_identity` | Optional, credential chain only. `;`-separated providers, tried in order. Default: the DuckDB `azure` extension default chain. Delta tables need `cli` to use `az login` |
31
35
32
-
The service principal needs the **Storage Blob Data Reader** role. The [metadata-check path](../testing/azure.md#metadata-checks) alternatively accepts `DATACONTRACT_AZURE_CONNECTION_STRING` or `DATACONTRACT_AZURE_STORAGE_ACCOUNT_KEY`.
36
+
The storage account is derived from the `location` of the server. The identity (service principal or the one found by the credential chain) needs the **Storage Blob Data Reader** role. The [metadata-check path](../testing/azure.md#metadata-checks) alternatively accepts `DATACONTRACT_AZURE_CONNECTION_STRING` or `DATACONTRACT_AZURE_STORAGE_ACCOUNT_KEY`.
33
37
34
38
Supported `location` URL formats (in the `servers` block):
Without these three variables, the Azure credential chain is used instead (for example after `az login`, or with a managed identity). Set `DATACONTRACT_AZURE_CREDENTIAL_CHAIN` (e.g. `cli;env;managed_identity`) to choose the providers. Delta tables don't pick up `az login` from the default chain; set `DATACONTRACT_AZURE_CREDENTIAL_CHAIN=cli` for them.
31
+
30
32
## 3. Create a contract from your files
31
33
32
34
Import the schema straight from the container. This also generates a ready-to-test `servers` block:
@@ -80,7 +82,7 @@ Run `datacontract test datacontract.yaml` again: every violation is listed as an
80
82
81
83
## Reference
82
84
83
-
All authentication options (service principal, connection string, account key), supported location URL formats, and the data type handling per file format: **[Azure Reference](../reference/azure.md)**.
85
+
All authentication options (service principal, credential chain, connection string, account key), supported location URL formats, and the data type handling per file format: **[Azure Reference](../reference/azure.md)**.
0 commit comments