Skip to main content

Azure Batch credentials

Seqera uses Azure credentials to access your Batch account and Storage account for Azure Batch compute environments. Both Azure Batch setup options use Azure Batch credentials. Azure Cloud credentials do not work here.

Azure Batch credentials come in two types: Microsoft Entra service principals and access keys. Use an Entra service principal.

An Entra service principal is an account that you grant access to Azure Batch and Azure Storage resources:

  • With service principals, you can use role-based access control (RBAC) to grant more precise permissions.
  • Service principals have a many-to-many relationship with Azure Batch and Azure Storage accounts.
  • Some Azure Batch features, such as virtual network (VNet) and subnet configuration, are available only with Microsoft Entra.

Access keys are simple to use but have the following limitations:

  • Access keys are long-lived.
  • Access keys provide full access to the Azure Storage and Azure Batch accounts.
  • Azure allows only two access keys per account, making them a single point of failure.
  • Access keys do not support VNet/subnet configuration.

Both credential types support Batch Forge and Manual compute environment modes.

note

The two Azure credential types use different authentication methods. You can add more than one credential to a workspace, but a Seqera Platform compute environment uses only one credential at a time. Separate compute environments can use separate credentials concurrently, but the credentials are not cross-compatible. Access granted by one credential is not shared with the other.

Prerequisites

You need the following:

  • An Azure Storage account and an Azure Batch account. See Azure resources.
  • The list of roles to assign, if you use an Entra service principal. See Azure Batch roles.

Entra service principal and managed identity​

To use Entra for authentication, you must create a service principal and a managed identity. Seqera uses the service principal to authenticate to Azure Batch and Azure Storage. Seqera submits a Nextflow task as the head process to run Nextflow. Nextflow authenticates to Azure Batch and Storage with the managed identity attached to the node pool.

Set up both as follows:

  1. Add the service principal details as credentials in Seqera Platform.
  2. Assign the managed identity to each Azure Batch node pool with the relevant permissions.
  3. When you use Batch Forge, provide the resource ID of each managed identity. Seqera Platform assigns the identity to each pool during creation.
note

Entra service principal credentials support both Batch Forge and Manual compute environments. Some features, such as VNet/subnet configuration and managed identities, require Entra credentials. With Entra credentials, a managed identity is recommended as a security best practice, but is not mandatory.

Service principal​

See Create a service principal for more details.

To create an Entra service principal:

  1. In the Azure Portal, go to Microsoft Entra ID. Under App registrations, select New registration.
  2. Enter a name for the application. The application automatically has a service principal associated with it.
  3. Assign roles to the service principal. For the full list and what each role is for, see Azure Batch roles.
    1. Go to the Azure Storage account. Under Access Control (IAM), select Add role assignment.
    2. Select the Storage Blob Data Contributor role.
    3. Select Members, then Select Members. Search for your new service principal and assign the role.
    4. Repeat the process for the Azure Batch account with the Azure Batch Data Contributor role.
    5. If you create a managed identity (recommended), also assign the Managed Identity Operator role to the service principal on each managed identity.
    6. If you deploy Batch pools into a private VNet, also assign the Network Contributor role, or a custom role that grants Microsoft.Network/virtualNetworks/subnets/join/action, to the service principal on the VNet.
  4. Get the credentials that Seqera Platform needs to authenticate as the service principal:
    1. Go back to the app registration. On the Overview page, save the Application (client) ID value to use in Seqera Platform.
    2. Select Certificates & secrets, then New client secret. Azure creates a secret that contains a value and a secret ID. Save both values securely to use in Seqera Platform.
  5. In your Seqera Platform workspace, select the Credentials tab, then select Add workspace credential and complete the following fields:
    • Enter a Name for the credentials.
    • For Provider, select Azure.
    • Under Azure credential type, select Entra.
    • Complete the remaining fields: Batch account name, Blob Storage account name, Tenant ID (Directory (tenant) ID in Azure), Client ID (Application (client) ID in Azure), Client secret (Client secret value in Azure).
  6. After you add the ID and secret values to a credential in Seqera Platform, delete them from their temporary location.

Managed identity​

info

To use managed identities, Seqera requires Nextflow version 24.06.0-edge or later.

Nextflow can authenticate to Azure services with a managed identity. This method is more secure than access keys, but it must run on Azure infrastructure and requires Entra service principal credentials. Pool creation with a managed identity attached uses the Azure Batch management plane, which accepts only Microsoft Entra tokens. For this reason, shared-key credentials cannot create pools with managed identities.

When you use a compute environment with a managed identity attached to the Azure Batch pool, Nextflow uses this managed identity for authentication. Seqera still uses the Entra service principal to submit the initial Nextflow task. That task then uses the managed identity for subsequent authentication.

  1. In Azure, create a user-assigned managed identity. See Manage user-assigned managed identities for detailed steps. Note both the client ID and the resource ID of the managed identity when you create it.

  2. Assign the following roles to the managed identity. See Azure Batch roles for what each role is for.

    • Storage Blob Data Contributor on the Azure Storage account.
    • AcrPull on any Azure Container Registry the pipeline pulls images from.
  3. Associate the user-assigned managed identity with the Azure Batch pool. See Set up managed identity in your Batch pool for more information.

    note

    When you use separate head and worker pools, you can assign a different managed identity to each pool.

  4. When you set up the Seqera compute environment, enter the managed identity details. The form has four managed identity fields, a client ID and a resource ID for each of the head pool and the worker pool:

    • Resource IDs are the full Azure Resource Manager (ARM) paths of the managed identities, for example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. Seqera passes these to Azure Batch when it creates the pools, to attach the managed identity to the head pool and worker pool VMs respectively. Resource IDs are required when you use Batch Forge.
    • Client IDs are passed to Nextflow, Fusion, and AzCopy on the pool VMs. The Azure Instance Metadata Service uses the client ID to issue a token for the correct managed identity. Because a VM can have multiple managed identities attached, the consumer must specify which one to use.

    To use the same managed identity for both head and worker pools, enter the same values in both pairs of fields. Separate identities are recommended so that worker RBAC can stay narrower than head RBAC.

    The four fields work for both single-pool and dual-pool topologies:

    • Single-pool (head pool only): both managed identities are attached to the same VMs. The client IDs disambiguate which managed identity each consumer authenticates as.
    • Dual-pool (separate head and worker pools): because each pool has only its own managed identity attached, disambiguation is implicit at the VM level. The client IDs are still required so that consumers know which managed identity is theirs.

When you submit a pipeline to this compute environment, Nextflow authenticates with the managed identity associated with the Azure Batch node it runs on, instead of access keys.

caution

If a managed identity is misconfigured (for example, invalid client ID or missing RBAC roles), the pipeline fails with an explicit error. Seqera does not silently fall back to access key authentication.

Access keys​

To create an access key:

  1. Sign in to the Azure Portal.
  2. Go to the Azure Batch account and, under Account management, select Keys. The page lists the Primary and Secondary keys. Copy one of the keys and save it in a secure location for later use.
  3. Go to the Azure Storage account and, under the Security and Networking section, select Access keys. The page lists the Key1 and Key2 options. Copy one of them and save it in a secure location for later use.
  4. In your Seqera Platform workspace, select the Credentials tab, then select Add workspace credential and complete the following fields:
    • Enter a Name for the credentials.
    • For Provider, select Azure.
    • Under Azure credential type, select Shared key.
    • Add the Batch account and Blob Storage account names and access keys to the relevant fields.
  5. After you add the keys to a credential in Seqera Platform, delete the copied keys from their temporary location.

Validation​

Seqera validates credentials against Azure on a recurring schedule and marks credentials that fail as INVALID. Seqera blocks launches on compute environments whose credentials are INVALID. See Pre-flight checks.

Next step​

Create the compute environment with Batch Forge or with an existing pool.