Service Accounts and API Keys
Overview
A service account is an account for an integration, such as a nightly ETL job or a scheduler, rather than a person. Tenant admins register them under Manage → Users.
Every service account has:
- an owner: the person accountable for it. The account can never do more than its owner can.
- a role: what it is allowed to do, capped by the owner (see Roles, Groups and Permissions).
- one or more ways to sign in: API keys issued in DataDios, or an Azure app it signs in with.
Until roles are switched on for your tenant, the role and owner limits below are only logged, not enforced. The owner checks on registration work either way. API keys need roles on: until then you can't issue a key, and an existing key is refused.
Add a service account
- Open Manage → Users and click Add user.
- Set Account type to Service account.
- Fill in:
| Field | What to enter |
|---|---|
| Name | What the integration is, for example nightly etl. 1 to 64 letters, digits, spaces, - or _. |
| Owner | An active person in your tenant (Admin or Normal access tier). Open the Owner dropdown and type in its search box to find them. Another service account cannot be an owner. |
| Role | Optional. Leave it on Service account (default), or pick another role. |
| Sign in with an Azure app token | A switch, off by default. Turn it on only if the integration signs in with an Azure app token: two boxes appear for its client id and tenant id, and both are required. Leave it off to use API keys. |
- Click Add service account. On the next step, click Issue API key to give it a key straight away.
If DataDios refuses the account, the reason is shown in the dialog. For example:
- owner must be a person in your tenant or owner must be an active user
- this Azure app is already registered: an Azure app can belong to only one service account.
- azure_tenant_id is not the Azure tenant of any user in your tenant
- a role that a service account cannot hold (see below)
What a service account can do
- It gets the permissions of its role and of any groups it belongs to, but only those its owner also holds. If the owner is a tenant admin, the role is not cut down further.
- The owner's deny permissions apply to it too. If the owner cannot read data, neither can the account.
- If the owner is disabled or removed, the account is refused everything until you give it a new owner. A call that uses one of its API keys gets 401 Invalid API key in the meantime.
- It cannot share resources.
- Some permissions are never given to a service account, whatever its role or groups say: admin-full-access, sharing-manage, policy-edit, tenant-admin-platform, mask-policy-edit, the four unmask permissions, purpose-declare, jit-request, jit-grant, policy-approve, agent-approve and share-external-approve. A role holding any of them cannot be given to a service account; the error names them.
Service accounts in the Users list
- Type shows Service for service accounts.
- Owner shows the owner's name. It shows No owner, Owner missing or <name> (disabled) in red when the account cannot do anything until the owner is fixed.
- The row actions for a service account are API keys, Change owner, Change role, Disable / Enable, Download details and Delete. Its email cannot be changed: a service account has no email.
To give an account a new owner, click Change owner of <name>, pick a person and click Save. To change what it can do, click Change role for <name>; choosing Service account (default) puts it back on the default role.
API keys
Click API keys for <name> on the service account's row. The dialog lists its keys with their state. Active keys come first, then the newest revoked or expired ones, up to 50:
| State | Meaning |
|---|---|
| Active | The key works. |
| Expiring soon | It works, and expires in less than 14 days. Issue a new one before it does. |
| Expired | It no longer works. |
| Revoked | Someone revoked it. It no longer works. |
Each key also shows the last characters of the key, its expiry date and when it was last used (updated at most once an hour).
Issue a key
- Click Issue key. If roles aren't switched on for your tenant, the dialog says so and the button stays disabled.
- Give it a Key name, for example airflow prod, and choose when it Expires in: 30 days, 90 days (default), 180 days or 1 year (the maximum).
- Click Issue key.
- Click Copy and store the key in your secret manager. It is shown only once. Then click I've copied it.
A service account can have at most 5 active keys. Revoke one before issuing a sixth.
Use a key
Send the key in the Authorization header of each request to the DataDios API:
Authorization: Bearer ddk_...
The request runs as the service account, with its role and owner limits. For some requests the account also acts on its owner's data; see below. If the key is unknown, revoked or expired, the account is disabled or gone, or its owner is not an active person, the answer is 401 Invalid API key. If the key is valid but roles are not On for the tenant, the answer is 403 API keys need the tenant's IAM mode set to on.
Whose data a key acts on
A key whose request names no owner_id acts on its owner's data, not the account's own. This applies to:
- pushing OpenLineage events to an OpenLineage data source's endpoint;
- adding a data source to a lineage graph;
- the two data source reads for a source's child object types (
/ds/child_object_types/<ds_name>) and its object queries (/v1/data-sources/<ds_name>/queries); - the owner's workflows: the workflow, step and template pages under
/ui/, and the function files and function pseudo code of a workflow step.
The account's role is still enforced. To act on another user's data, name that user in owner_id; this still needs a share, as for any user.
This applies only when the workspace's IAM mode is on. In shadow or off the key acts as itself.
If DataDios cannot look up the account's owner, the request gets a 503. Retry it.
Revoke a key
Click Revoke key <name> and confirm. Anything using the key fails at once. A revoked key cannot be restored; issue a new one instead.
Deleting a service account (Delete <name> on its row) stops all its keys from working.
Calling DataDios with an Azure app token
The integration asks Azure for a client-credentials token and sends it as Authorization: Bearer <token>. The token must meet these rules, or DataDios refuses it:
- Audience: it is issued for the DataDios Azure app, so the scope is
api://<DataDios app client id>/.default. A token issued for the integration's own app is refused with Invalid OAuth token. - App role: in Azure, the integration's app needs an application permission on the DataDios app (for example
DD.App.Read), with admin consent granted. Without it Azure will not issue the token. - Version: a v2 token (the issuer ends in
/v2.0). Itsazpis the integration's client id and itstidis the Azure tenant id you entered when adding the account.
Ask your DataDios administrator for the DataDios app client id.
Before service accounts could be registered, an Azure app that signed in to DataDios was given an account automatically. Once roles are On for your tenant, an Azure app that has not been registered as a service account is refused with Service account not registered. Register it as described above, with its client id and tenant id. While roles are not switched on, or in trial mode, such apps are still let in: the account is made in the tenant your Microsoft directory is linked to (see Who signs in to which tenant), or in the only tenant that has users from that directory. If the directory has users in more than one tenant and is not linked to one, the app is refused until support links it.
Accounts that were created this way have no owner: the Owner column shows No owner. Once roles are On they are refused everything. Before switching roles on, give each of them an owner with Change owner of <name>.