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 errors when passing ResourceId #18707

Closed
caosborn opened this issue Jun 24, 2022 · 1 comment · Fixed by #18756
Closed

Get-AzApplicationInsights errors when passing ResourceId #18707

caosborn opened this issue Jun 24, 2022 · 1 comment · Fixed by #18756
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Monitor - ApplicationInsights

Comments

@caosborn
Copy link

caosborn commented Jun 24, 2022

Description

Get-AzApplicationInsights is erroring when passing the ResourceId parameter saying an internal function could not be found.

The expected result would be the Application Insights resource object.

Works as expected when passing the SubscriptionId, ResourceGroupName and Name values extracted from the resource Id value.

Issue script & Debug output

Get-AzApplicationInsights -ResourceId '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{name}'
Get-AzApplicationInsights: The term 'Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponent' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.19044
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                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.8.0                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     2.0.0                 Az.ApplicationInsights              {Get-AzApplicationInsights, Get-AzApplicationInsightsApiKey, Get-AzA…}

Error output

Message        : The term 'Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponent' is not recognized as a name of a cmdlet, function, script file, or executable program.
                 Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
StackTrace     :    at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
                    at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
                    at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
                    at System.Management.Automation.PSScriptCmdlet.DoProcessRecord()
                    at System.Management.Automation.CommandProcessor.ProcessRecord()
Exception      : System.Management.Automation.CommandNotFoundException
InvocationInfo : {}
Line           :                 $component = ($resourceId | . Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponent)

Position       : At C:\Users\REDACTED\Documents\PowerShell\Modules\Az.ApplicationInsights\2.0.0\custom\Get-AzApplicationInsights.ps1:129 char:47
                 + … ourceId | . Az.ApplicationInsights.internal\Get-AzApplicationInsights+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 3
@caosborn caosborn 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 Jun 24, 2022
@ghost ghost added customer-reported and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Jun 24, 2022
@dingmeng-xue
Copy link
Member

@VeryEarly , please look into this issue.

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. customer-reported Monitor - ApplicationInsights
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants