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
{
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.
I started investigating where this error message is coming from because "Cannot bind argument to parameter 'Name' because it is null." is not very descriptive.
Enabling the debug option gave me a pointer as to where this error message is originating:
If $latestModulePath is null, it will give the error above because Import-Module -Name $latestModulePath receives null.
Although I acknowledge that this is an issue with the self-hosted runner we're using, the error message could be improved.
To enhance this for future users of this action, we could improve it in two ways:
If $latestModulePath is $null, it could show something like "Module 'Az.Accounts' not found, please install."
One possible solution for AzPSScriptBuilder.ts could be:
Mention somewhere in the README that Az.Accounts is required. I do see in this issue's comment that we need to install the Az.Accounts module if enable-AzPSSession is set to true. This could then also be referenced in the error message for example.
This improvement would give the user an idea of what is wrong, and what action they need to take to fix it.
The text was updated successfully, but these errors were encountered:
Used version
Download action repository 'azure/login@v2' (SHA:6c251865b4e6290e7b78be643ea2d005bc51f69a)
which points to Release v2.1.1.Issue description
In the workflow I have the following code:
The error that I am getting is the following one:
I started investigating where this error message is coming from because
"Cannot bind argument to parameter 'Name' because it is null."
is not very descriptive.Enabling the
debug
option gave me a pointer as to where this error message is originating:login/src/PowerShell/AzPSScriptBuilder.ts
Lines 10 to 11 in 151fd00
The debug output provided the following:
If
$latestModulePath
is null, it will give the error above becauseImport-Module -Name $latestModulePath
receives null.Although I acknowledge that this is an issue with the self-hosted runner we're using, the error message could be improved.
To enhance this for future users of this action, we could improve it in two ways:
$latestModulePath
is $null, it could show something like "Module 'Az.Accounts' not found, please install."One possible solution for AzPSScriptBuilder.ts could be:
Az.Accounts
is required. I do see in this issue's comment that we need to install theAz.Accounts
module ifenable-AzPSSession
is set totrue
. This could then also be referenced in the error message for example.This improvement would give the user an idea of what is wrong, and what action they need to take to fix it.
The text was updated successfully, but these errors were encountered: