Using env vars in Azure Storage Shared Key credential causes “ERR_INVALID_URL – Invalid URL”

Hi everyone, I’m running into a strange issue when using environment variables for Azure Storage credentials in n8n (running on a Kubernetes pod).

I’m setting the storage account name and key as environment variables on the pod:

N8N_CI_AZURE_USERNAME=<account-name>
N8N_CI_AZURE_STORAGE_KEY=<account-key>

Then in n8n, within the Azure Storage Shared Key API credential, I’m referencing them like this:

  • Account: {{ $env.N8N_CI_AZURE_USERNAME }}

  • Key: {{ $env.N8N_CI_AZURE_STORAGE_KEY }}

However, when I try to select a container in the Azure > Get Blob node, I get this error:

Could not load list
ERR_INVALID_URL - Invalid URL

If I replace the Account field with the actual fixed account name (not the env variable) but still use the env variable for the Key, everything works normally.

So it seems like using an env variable specifically for the Account field breaks the URL formation.

Has anyone seen this before?
Is this a limitation, a parsing bug, or am I missing something about how env vars resolve inside credentials?

Information on your n8n setup

  • n8n version: 1.114.4
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker

Looking at your post, I can see the environment variables are showing as “undefined” in the credential configuration, which suggests they’re not being properly loaded. Here are a few things to check:

• Verify the environment variables are actually set in your Kubernetes pod by running `kubectl exec – printenv | grep N8N_CI_AZURE`

• Make sure you restart the n8n pod after setting the environment variables - they need to be available when n8n starts up

• Test the credential connection after confirming the variables are properly loaded - the “Invalid URL” error is likely happening because the undefined variables are creating malformed Azure Storage URLs

If the environment variables are correctly set and loaded, the credential should work without issues.