Open mikefrobbins opened 2 weeks ago
Get-AzApplicationInsights returns a subscription ID null error when you're not authenticated. It should return an error like Get-AzResource.
Get-AzApplicationInsights
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:\>
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:\>
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
ModuleType Version PreRelease Name PSEdition ExportedCommands ---------- ------- ---------- ---- --------- ---------------- Script 12.3.0 AzPreview Core,Desk
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
@dolauli To create an issue in autorest repo to track it
Description
Get-AzApplicationInsights
returns a subscription ID null error when you're not authenticated. It should return an error likeGet-AzResource
.Current behavior:
Expected behavior:
Issue script & Debug output
Environment data
Module versions
Error output