N8N & Azure CLI - Execute command "az login" fails with "Command failed: az login --identity /bin/sh: 1: az: not found"
-
Hello,
I am trying to use Azure CLI to upload a file in Azure Storage container, from an N8N instance deployed on an Azure VM.
I've installed Azure CLI myself on the Linux Azure VM (Ubuntu 2204), as per https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt.If I SSH into the Linux Azure VM, I can use Azure CLI commands:
~$ az login --identity
[
{
"environmentName": "AzureCloud",
"homeTenantId": "<<REDACTED>>",
"id": "<<REDACTED>>",
"isDefault": true,
"managedByTenants": [],
"name": "<<REDACTED>>",
"state": "Enabled",
"tenantId": "<<REDACTED>>",
"user": {
"assignedIdentityInfo": "MSI",
"name": "systemAssignedIdentity",
"type": "servicePrincipal"
}
}
]From an "Execute Command" node, however, the same command fails with the exception "Command failed: az login --identity /bin/sh: 1: az: not found"
Full exception:
{
"errorMessage": "Command failed: az login --identity\n/bin/sh: 1: az: not found\n",
"errorDetails": {},
"n8nDetails": {
"nodeName": "Upload to Azure Storage1",
"nodeType": "n8n-nodes-base.executeCommand",
"nodeVersion": 1,
"itemIndex": 0,
"time": "23/07/2024, 01:02:27",
"n8nVersion": "1.50.1 (Self Hosted)",
"binaryDataMode": "default",
"stackTrace": [
"NodeOperationError: Command failed: az login --identity",
"/bin/sh: 1: az: not found",
"",
" at Object.execute (/app/code/node_modules/n8n-nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts:101:12)",
" at processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at Workflow.runNode (/app/code/node_modules/n8n-workflow/src/Workflow.ts:1378:8)",
" at /app/code/node_modules/n8n-core/src/WorkflowExecute.ts:1072:27",
" at /app/code/node_modules/n8n-core/src/WorkflowExecute.ts:1775:11"
]
}
}Note: I've also posted on N8N's Community site, https://community.n8n.io/t/azure-cli-execute-command-az-login-fails-with-command-failed-az-login-identity-bin-sh-1-az-not-found/50576