You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting "Error: Login failed with Error: Azure PowerShell login failed with error: Cannot bind argument to parameter 'Name' because it is null." using the following YAML on a self-hosted runner.
- name: Log in with Azure
uses: azure/login@v2
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
enable-AzPSSession: true
Here is the full debug:
##[debug]Reading creds in JSON...
::add-mask::***
::add-mask::***
Running Azure CLI Login.
##[debug]Azure CLI path: /usr/bin/az
##[debug]Azure CLI version used:
##[debug]azure-cli 2.61.0
##[debug]
##[debug]core 2.61.0
##[debug]telemetry 1.1.0
##[debug]
##[debug]Dependencies:
##[debug]msal 1.28.0
##[debug]azure-mgmt-resource 23.1.1
##[debug]
##[debug]Python location '/opt/az/bin/python3'
##[debug]Extensions directory '/home/runner/.azure/cliextensions'
##[debug]
##[debug]Python (Linux) 3.11.8 (main, May 16 2024, 03:47:28) [GCC 11.4.0]
##[debug]
##[debug]Legal docs and information: aka.ms/AzureCliLegal
##[debug]
##[debug]
##[debug]Your CLI is up-to-date.
##[debug]
/usr/bin/az cloud set -n azurecloud
Done setting cloud: "azurecloud"
Note: Azure/login action also supports OIDC login mechanism. Refer https://github.com/azure/login#configure-a-service-principal-with-a-federated-credential-to-use-oidc-based-authentication for more details.
Attempting Azure CLI login by using service principal with secret...
Subscription is set successfully.
Azure CLI login succeeds by using service principal with secret.
Running Azure PowerShell Login.
##[debug]Set PSModulePath as /usr/share:undefined
##[debug]The script to import the latest Az.Accounts: try ***
##[debug] $ErrorActionPreference = "Stop"
##[debug] $WarningPreference = "SilentlyContinue"
##[debug] $output = @***
##[debug] $latestModulePath = (Get-Module -Name 'Az.Accounts' -ListAvailable | Sort-Object Version -Descending | Select-Object -First 1).Path
##[debug] Import-Module -Name $latestModulePath
##[debug] $output['Success'] = $true
##[debug] $output['Result'] = $latestModulePath
##[debug] ***
##[debug] catch ***
##[debug] $output['Success'] = $false
##[debug] $output['Error'] = $_.exception.Message
##[debug] ***
##[debug] return ConvertTo-Json $output
Error: "Cannot bind argument to parameter 'Name' because it is null.",
Success: false
Error: Login failed with Error: Azure PowerShell login failed with error: Cannot bind argument to parameter 'Name' because it is null.. Double check if the 'auth-type' is correct. Refer to https://github.com/Azure/login#readme for more information.
##[debug]Error: Azure PowerShell login failed with error: Cannot bind argument to parameter 'Name' because it is null.
##[debug] at AzPSUtils. (/home/runner/_work/_actions/azure/login/v2/lib/main/index.js:4451:23)
##[debug] at Generator.next ()
##[debug] at fulfilled (/home/runner/_work/_actions/azure/login/v2/lib/main/index.js:4366:58)
##[debug] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Log in with Azure
The text was updated successfully, but these errors were encountered:
Hi @MezTemplar, do you use a self-hosted runner without Azure PowerShell installed? If yes, could you install Azure PowerShell module before using Azure Login Action?
Hi @MezTemplar, do you use a self-hosted runner without Azure PowerShell installed? If yes, could you install Azure PowerShell module before using Azure Login Action?
I added the Az module to pwsh in a step before the login and it worked so I guess that was the problem. Maybe a clearer message would be helpful?
I'm getting "Error: Login failed with Error: Azure PowerShell login failed with error: Cannot bind argument to parameter 'Name' because it is null." using the following YAML on a self-hosted runner.
Here is the full debug:
The text was updated successfully, but these errors were encountered: