Service account levels
You can create service accounts at three levels. The level determines the scope of the actions the service account can perform.
To deploy code, a service account must have an Editor or Admin role at its level. For a complete breakdown of roles and permissions, see User roles and permissions.
You can create Workspace-level and Deployment-level service accounts using the Astro Private Cloud UI, the Astro CLI, or the Houston API. You can create system-level service accounts only with the Houston API.
Create a service account with the Astro Private Cloud UI
Use the Astro Private Cloud UI to create Workspace-level or Deployment-level service accounts.1
Open the Service Accounts tab
For a Workspace-level service account, go to Workspace Settings > Service Accounts. For a Deployment-level service account, select a Deployment and then open its Service Accounts tab.
2
Create the service account
Select New Service Account and complete the following fields:
- Name: A meaningful name for the service account.
- Category: Optional. A category or description that helps you locate and sort service accounts.
- User Role: The role that determines the service account’s permissions. To deploy code, select an Editor or Admin role.
3
Save the API key
Copy the API key that appears and store it in an environment variable or secrets management tool.
The API key appears only once. Store it securely before you leave the page.
Create a service account with the Astro CLI
Use the Astro CLI to create Workspace-level or Deployment-level service accounts.- Workspace
- Deployment
-
Get your Workspace ID:
-
Create the service account:
Set
--roletoWORKSPACE_VIEWER,WORKSPACE_EDITOR, orWORKSPACE_ADMIN. The default isWORKSPACE_VIEWER.
Create a service account with the Houston API
Use the Houston API to create service accounts at any level. Creating a system-level service account requires the Houston API. Before you run a mutation, authenticate your request as described in Authenticate to the Houston API.- System
- Workspace
- Deployment
apiKey value in a secure place, because it isn’t displayed again. To explore the full Houston API schema and test mutations interactively, see Develop and test queries.
Example: Use a service account with the Airflow REST API
After you create a service account, you can use its API key to authenticate requests to the Airflow REST API. This is one common way to leverage a service account, for example to trigger Dag runs from an external system without accessing the Airflow UI directly. Create a Deployment-level service account with an Editor or Admin role, then send requests to the following base URL:<base-domain>: The base domain of your Astro Private Cloud installation. For example,astronomer.example.com.<deployment-release-name>: The release name of your Deployment. For example,galactic-stars-1234.<api-key>: The API key for your Deployment-level service account.<dag-id>: The name of your Dag (case-sensitive).
dagRuns endpoint: