Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-AzApplicationInsights returns a subscription ID null error when not authenticated #26183

Open
mikefrobbins opened this issue Sep 26, 2024 · 0 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.

Comments

@mikefrobbins
Copy link
Contributor

Description

Get-AzApplicationInsights returns a subscription ID null error when you're not authenticated. It should return an error like Get-AzResource.

Current behavior:

PS C:\> Get-AzApplicationInsights
Get-AzApplicationInsights_List: C:\Program Files\PowerShell\Modules\Az.ApplicationInsights\2.2.5\ApplicationInsights.Autorest\internal\ProxyCmdletDefinitions.ps1:1528
Line |
1528 |          $scriptCmd = {& $wrappedCmd @PSBoundParameters}
     |                                      ~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'SubscriptionId' because it is null.
PS C:\>

Expected behavior:

PS C:\> Get-AzApplicationInsights
Get-AzApplicationInsights: Run Connect-AzAccount to login.
PS C:\>

Issue script & Debug output

PS C:\> Get-AzApplicationInsights
DEBUG: 10:59:54 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:59:54 AM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 10:59:54 AM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:59:54 AM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:59:54 AM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:59:54 AM - GetAzureRMContextCommand end processing.
Get-AzApplicationInsights_List: C:\Program Files\PowerShell\Modules\Az.ApplicationInsights\2.2.5\ApplicationInsights.Autorest\internal\ProxyCmdletDefinitions.ps1:1528
Line |
1528 |          $scriptCmd = {& $wrappedCmd @PSBoundParameters}
     |                                      ~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'SubscriptionId' because it is null.
PS C:\>

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.5
PSEdition                      Core
GitCommitId                    7.4.5
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     12.3.0                AzPreview                           Core,Desk

Error output

HistoryId: 2

Message        : Cannot bind argument to parameter 'SubscriptionId' because it is null.
StackTrace     :    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
                    at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception&
                 exceptionThrown, ExecutionOptions options)
Exception      : System.Management.Automation.ParameterBindingValidationException
InvocationInfo : {Get-AzApplicationInsights_List}
Line           :         $scriptCmd = {& $wrappedCmd @PSBoundParameters}

Position       : At C:\Program Files\PowerShell\Modules\Az.ApplicationInsights\2.2.5\ApplicationInsights.Autorest\inter
                 nal\ProxyCmdletDefinitions.ps1:1528 char:37
                 +         $scriptCmd = {& $wrappedCmd @PSBoundParameters}
                 +                                     ~~~~~~~~~~~~~~~~~~
HistoryId      : 2
@mikefrobbins mikefrobbins added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Sep 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.
Projects
None yet
Development

No branches or pull requests

1 participant