# A minimal Nextflow configuration for Azure Batch

**URL:** <https://community.seqera.io/t/a-minimal-nextflow-configuration-for-azure-batch/1138>\
**Category:** Ask for help\
**Tags:** azure-batch\
**Created:** [August 25, 2024, 11:14am UTC](https://community.seqera.io/t/a-minimal-nextflow-configuration-for-azure-batch/1138 "2024-08-25T11:14:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebragge](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/ebragge/32/1028_2.png) [@ebragge](https://community.seqera.io/u/ebragge)\
**Post date:** [August 25, 2024, 11:14am UTC](https://community.seqera.io/t/a-minimal-nextflow-configuration-for-azure-batch/1138/1 "2024-08-25T11:14:14Z")

</div>

**The documentation states that:**

_A minimal Nextflow configuration for Azure Batch looks like the following snippet:_

```groovy
process {
    executor = 'azurebatch'
}

azure {
    storage {
        accountName = "<YOUR STORAGE ACCOUNT NAME>"
        accountKey = "<YOUR STORAGE ACCOUNT KEY>"
    }
    batch {
        location = '<YOUR LOCATION>'
        accountName = '<YOUR BATCH ACCOUNT NAME>'
        accountKey = '<YOUR BATCH ACCOUNT KEY>'
        autoPoolMode = true
    }
}

```

**When running with valid values I get:**

ERROR ~ Invalid Service Principal configuration - Make sure servicePrincipalId and servicePrincipalClient are set in nextflow.config or configured via environment variables

---

<div class="post-metadata">

**Author:** ![Adam\_Talbot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/adam_talbot/32/62_2.png) [@Adam\_Talbot](https://community.seqera.io/u/Adam_Talbot)\
**Post date:** [August 26, 2024, 8:04am UTC](https://community.seqera.io/t/a-minimal-nextflow-configuration-for-azure-batch/1138/2 "2024-08-26T08:04:22Z")

</div>

Which Nextflow version? Could you share a .nextflow.log file please?

---

<div class="post-metadata">

**Author:** ![ebragge](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/ebragge/32/1028_2.png) [@ebragge](https://community.seqera.io/u/ebragge)\
**Post date:** [August 26, 2024, 8:17am UTC](https://community.seqera.io/t/a-minimal-nextflow-configuration-for-azure-batch/1138/3 "2024-08-26T08:17:16Z")

</div>

I managed to figure out the problem by looking at the Nextflow source code.  
I had an environment variable AZURE\_TENANT\_ID set even though it was not used in nextflow.config.

After I removed that variable the connection was successful.

---

<div class="post-metadata">

**Author:** ![Adam\_Talbot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/adam_talbot/32/62_2.png) [@Adam\_Talbot](https://community.seqera.io/u/Adam_Talbot)\
**Post date:** [August 28, 2024, 9:58am UTC](https://community.seqera.io/t/a-minimal-nextflow-configuration-for-azure-batch/1138/4 "2024-08-28T09:58:39Z")

</div>

Nextflow will find the following environment variables and try to use them:

- AZURE\_CLIENT\_ID
- AZURE\_CLIENT\_SECRET
- AZURE\_TENANT\_ID
- AZURE\_STORAGE\_ACCOUNT\_KEY
- AZURE\_STORAGE\_ACCOUNT\_NAME
- AZURE\_STORAGE\_ACCOUNT\_SAS
- AZURE\_REGISTRY\_USER\_NAME
- AZURE\_REGISTRY\_PASSWORD

We need to clarify this in the docs and improve the hierarchy to make sure it takes explicitly set variables first. Thanks for pointing this out @ebragge

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/system/32/2402_2.png) [@system](https://community.seqera.io/u/system)\
**Post date:** [September 4, 2024, 9:59am UTC](https://community.seqera.io/t/a-minimal-nextflow-configuration-for-azure-batch/1138/5 "2024-09-04T09:59:20Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
