Azure Batch
This guide assumes you already have an Azure account with a valid Azure Subscription. For details, visit Azure Free Account. Ensure you have sufficient permissions to create resource groups, an Azure Storage account, and an Azure Batch account.
Azure concepts
Regions
Azure regions are specific geographic locations around the world where Microsoft has established data centers to host its cloud services. Each Azure region is a collection of data centers that provide users with high availability, fault tolerance, and low latency for cloud services. Each region offers a wide range of Azure services that can be chosen to optimize performance, ensure data residency compliance, and meet regulatory requirements. Azure regions also enable redundancy and disaster recovery options by allowing resources to be replicated across different regions, enhancing the resilience of applications and data.
Resource groups
An Azure resource group is a logical container that holds related Azure resources such as virtual machines, storage accounts, databases, and more. A resource group serves as a management boundary to organize, deploy, monitor, and manage the resources within it as a single entity. Resources in a resource group share the same lifecycle, meaning they can be deployed, updated, and deleted together. This also enables easier access control, monitoring, and cost management, making resource groups a foundational element in organizing and managing cloud infrastructure in Azure.
Accounts
Azure uses accounts for each service. For example, an Azure Storage account will house a collection of blob containers, file shares, queues, and tables. An Azure subscription can have multiple Azure Storage and Azure Batch accounts - however, a Platform compute environment can only use one of each. Multiple Platform compute environments can be created to use separate credentials, Azure Storage accounts, and Azure Batch accounts.
Service principals
An Azure service principal is an identity created specifically for applications, hosted services, or automated tools to access Azure resources. It acts like a user identity with a defined set of permissions, enabling resources authenticated through the service principal to perform actions within the Azure account. Seqera can utilize an Azure service principal to authenticate and access Azure Batch for job execution and Azure Storage for data management.
Create Azure resources
Resource group
Create a resource group to link your Azure Batch and Azure Storage account:
A resource group can be created while creating an Azure Storage account or Azure Batch account.
- Log in to your Azure account, go to the Create Resource group page, and select Create new resource group.
- Enter a name for the resource group, such as seqeracompute.
- Choose the preferred region.
- Select Review and Create to proceed.
- Select Create.
Storage account
After creating a resource group, set up an Azure Storage account:
- Log in to your Azure account, go to the Create storage account page, and select Create a storage account.
note
If you haven't created a resource group, you can do so now.
- Enter a name for the storage account, such as seqeracomputestorage.
- Choose the preferred region. This must be the same region as the Batch account.
- Platform supports all performance or redundancy settings — select the most appropriate settings for your use case.
- Select Next: Advanced.
- Enable storage account key access.
- Select Next: Networking.
- Enable public access from all networks. You can enable public access from selected virtual networks and IP addresses, but you will be unable to use Forge to create compute resources. Disabling public access is not supported.
- Select Data protection.
- Configure appropriate settings. All settings are supported by the platform.
- Select Encryption.
- Only Microsoft-managed keys (MMK) are supported.
- In tags, add any required tags for the storage account.
- Select Review and Create.
- Select Create to create the Azure Storage account.
- You will need at least one Blob Storage container to act as a working directory for Nextflow.
- Go to your new storage account and select + Container to create a new Blob Storage container. A new container dialog will open. Enter a suitable name, such as seqeracomputestorage-container.
- Go to the Access Keys section of your new storage account (seqeracomputestorage in this example).
- Store the access keys for your Azure Storage account, to be used when you create a Seqera compute environment.
Blob container storage credentials are associated with the Batch pool configuration. Avoid changing these credentials in your Seqera instance after you have created the compute environment.
Batch account
After you have created a resource group and Storage account, create a Batch account:
- Log in to your Azure account and select Create a batch account on this page.
- Select the existing resource group or create a new one.
- Enter a name for the Batch account, such as seqeracomputebatch.
- Choose the preferred region. This must be the same region as the Storage account.
- Select Advanced.
- For Pool allocation mode, select Batch service.
- For Authentication mode, select Shared Key.
- Select Networking. Ensure networking access is sufficient for Platform and any additional required resources.
- Add any Tags to the Batch account, if needed.
- Select Review and Create.
- Select Create.
- Go to your new Batch account, then select Access Keys.
- Store the access keys for your Azure Batch account, to be used when you create a Seqera compute environment.
caution
A newly-created Azure Batch account may not be entitled to create virtual machines without making a service request to Azure. See Azure Batch service quotas and limits for more information.
- Select the + Quotas tab of the Azure Batch account to check and increase existing quotas if necessary.
- Select + Request quota increase and add the quantity of resources you require. Here is a brief guideline:
- Active jobs and schedules: Each Nextflow process will require an active Azure Batch job per pipeline while running, so increase this number to a high level. See here to learn more about jobs in Azure Batch.
- Pools: Each platform compute environment requires at least one Azure Batch pool. Batch Forge creates two pools by default (one for the head job and one for compute tasks). Each pool is composed of multiple machines of one virtual machine size.
noteTo use separate pools for head and compute nodes, see this FAQ entry.
- Batch accounts per region per subscription: Set this to the number of Azure Batch accounts per region per subscription. Only one is required.
- Total Dedicated vCPUs per VM series: See the Azure documentation for virtual machine sizes to help determine the machine size you need. We recommend the latest version of the ED series available in your region as a cost-effective and appropriately-sized machine for running Nextflow. However, you will need to select alternative machine series that have additional requirements, such as those with additional GPUs or faster storage. Increase the quota by the number of required concurrent CPUs. In Azure, machines are charged per cpu minute so there is no additional cost for a higher number.
Credentials
There are two types of Azure credentials available: access keys and Entra service principals.
Access keys are simple to use but have several 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.
Entra service principals are accounts which can be granted access to Azure Batch and Azure Storage resources:
- Service principals enable role-based access control with more precise permissions.
- Service principals map to a many-to-many relationship with Azure Batch and Azure Storage accounts.
- Some Azure Batch features, such as VNet/subnet configuration, are only available when using Microsoft Entra.
Both credential types support Batch Forge and Manual compute environment modes.
The two Azure credential types use different authentication methods. You can add more than one credential to a workspace, but Platform compute environments use only one credential at any given time. While separate credentials can be used by separate compute environments concurrently, they are not cross-compatible — access granted by one credential will not be shared with the other.
Access keys
To create an access key:
- Navigate to the Azure Portal and sign in.
- Locate the Azure Batch account and select Keys under Account management. The Primary and Secondary keys are listed here. Copy one of the keys and save it in a secure location for later use.
- Locate the Azure Storage account and, under the Security and Networking section, select Access keys. Key1 and Key2 options are listed here. Copy one of them and save it in a secure location for later use.
- In your Platform workspace Credentials tab, select the Add credentials button and complete the following fields:
- Enter a Name for the credentials
- Provider: Azure
- Select the Shared key tab
- Add the Batch account and Blob Storage account names and access keys to the relevant fields.
- Delete the copied keys from their temporary location after they have been added to a credential in Platform.
Entra service principal and managed identity
To use Entra for authentication, you must create a service principal and managed identity. Seqera uses the service principal to authenticate to Azure Batch and Azure Storage. It submits a Nextflow task as the head process to run Nextflow, which authenticates to Azure Batch and Storage using the managed identity attached to the node pool.
Therefore, you must create both an Entra service principal and a managed identity:
- Add the service principal details as credentials in Seqera Platform.
- Assign the managed identity to each Azure Batch node pool with the relevant permissions.
- When using Batch Forge, provide the managed identity resource ID for each managed identity. Seqera Platform assigns the identity to each pool during creation.
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. When using Entra credentials, a managed identity is recommended for best security practices, but is not mandatory.
Service principal
See Create a service principal for more details.
To create an Entra service principal:
- In the Azure Portal, navigate to Microsoft Entra ID. Under App registrations, select New registration.
- Provide a name for the application. The application will automatically have a service principal associated with it.
- Assign roles to the service principal:
- Go to the Azure Storage account. Under Access Control (IAM), select Add role assignment.
- Select the Storage Blob Data Contributor role.
- Select Members, then Select Members. Search for your newly created service principal and assign the role.
- Repeat the same process for the Azure Batch account, using the Azure Batch Data Contributor role. This role is sufficient for pool creation and is narrower than the general Azure Batch Account Contributor role (which additionally grants Batch-account create/delete and shared-key regeneration — neither needed by Forge).
- If you create a managed identity (recommended), also assign the Managed Identity Operator role to the service principal on each managed identity. Without this role, Seqera cannot attach the managed identity to a Batch pool.
- If you plan to deploy Batch pools into a private VNet (by specifying a Subnet ID when creating the compute environment), also assign the Network Contributor role (or a custom role granting
Microsoft.Network/virtualNetworks/subnets/join/action) to the service principal on the VNet. Only the service principal needs VNet permissions (the head and pool managed identities do not).
- Platform will need credentials to authenticate as the service principal:
- Navigate back to the app registration. On the Overview page, save the Application (client) ID value for use in Platform.
- Select Certificates & secrets, then New client secret. A new secret is created containing a value and secret ID. Save both values securely for use in Platform.
- In your Platform workspace Credentials tab, select the Add credentials button and complete the following fields:
- Enter a Name for the credentials
- Provider: Azure
- Select the Entra tab
- 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).
- Delete the ID and secret values from their temporary location after they have been added to a credential in Platform.
Managed identity
To use managed identities, Seqera requires Nextflow version 24.06.0-edge or later.
Nextflow can authenticate to Azure services using a managed identity. This method offers enhanced security compared to 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 only accepts Entra (AAD) tokens, so 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 proceeds with the managed identity for subsequent authentication.
-
In Azure, create a user-assigned managed identity. See Manage user-assigned managed identities for detailed steps. Take note of both the client ID and the resource ID of the managed identity when you create it.
-
Assign the following roles to the managed identity:
- Storage Blob Data Contributor on the Azure Storage account, so the pool VMs can read inputs and write outputs.
- AcrPull on any Azure Container Registry the pipeline pulls images from. Without this role, container pulls fail when the pool VM authenticates via the managed identity.
See Required role assignments for more information.
-
Associate the user-assigned managed identity with the Azure Batch pool. See Set up managed identity in your Batch pool for more information.
noteWhen you use separate head and worker pools, you can assign a different managed identity to each pool. Typically, the head managed identity needs broader Batch and storage permissions, while the worker managed identity only needs storage and
AcrPullaccess. -
When you set up the Seqera compute environment, provide the managed identity details in the specified fields. The form has four managed identity fields — a client ID and a resource ID for both the head pool and the worker pool:
- Resource IDs are the full ARM paths of the managed identities (e.g.,
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}). Seqera passes these to Azure Batch at pool-create time to attach the managed identity to the head pool and worker pool VMs respectively. Resource IDs are required when using 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 mint a token for the correct managed identity. A VM can have multiple managed identities attached, so the consumer must specify which one to use.
You can use the same managed identity for both head and worker pools by entering the same values in both pairs of fields, but 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): each pool has only its own managed identity attached, so disambiguation is implicit at the VM level. The client IDs are still required so that consumers know which managed identity is theirs.
- Resource IDs are the full ARM paths of the managed identities (e.g.,
When you submit a pipeline to this compute environment, Nextflow authenticates using the managed identity associated with the Azure Batch node it runs on, rather than relying on access keys.
If a managed identity is misconfigured (for example, invalid client ID or missing RBAC roles), the pipeline fails with an explicit error. Seqera will not silently fall back to access key authentication.
Add Seqera compute environment
There are two ways to create an Azure Batch compute environment in Seqera Platform:
- Batch Forge: Automatically creates Azure Batch resources.
- Manual: For using existing Azure Batch resources.
For an end-to-end walkthrough of Azure Batch topologies (separate head and worker pools, Entra authentication, and private networking), see Set up advanced Azure Batch compute environments.