azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Bug: Set-AzApplicationInsightsDailyCap : A parameter cannot be found that matches parameter name 'DailyCapGB'

Open Yuvaraj-Devaraj opened this issue 2 years ago • 3 comments

Description

There is an parameter not matching error for "DailyCapDB" parameter. It appears to be a old bug that is reopened. It works fine with the older version of Az.ApplicationInsights module. I had to downgrade to ver 1.2.0 to run the command successfully.

Issue script & Debug output

DEBUG: 4:36:37 PM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 4:36:37 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:36:37 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:36:37 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:36:37 PM - GetAzureRMContextCommand end processing.
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing: 
DEBUG: CmdletProcessRecordStart: 
DEBUG: CmdletGetPipeline: 
DEBUG: CmdletBeforeAPICall: 
DEBUG: URLCreated: /subscriptions/XXXXXXXXXXX/resourceGroups/XXXXXXXXXXX/providers/microsoft.insights/components/XXXXXXXXXXX/currentbillingfeatures?api-version=2015-05-01
DEBUG: RequestCreated: /subscriptions/XXXXXXXXXXX/resourceGroups/XXXXXXXXXXX/providers/microsoft.insights/components/XXXXXXXXXXX/currentbillingfeatures?api-version=2015-05-01
DEBUG: HeaderParametersAdded: 
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/XXXXXXXXXXX/resourceGroups/XXXXXXXXXXX/providers/microsoft.insights/components/XXXXXXXXXXX/currentbillingfeatures?api-version=2015-05
-01

Headers:
x-ms-unique-id                : 5
x-ms-client-request-id        : 51a0dbac-b1b9-4bf0-961b-d4dc259475be
CommandName                   : .
FullCommandName               : Get-AzApplicationInsightsComponentCurrentBillingFeature_Get
ParameterSetName              : __AllParameterSets
User-Agent                    : AzurePowershell/v0.0.0,PSVersion/v5.1.17763.5122,Az.ApplicationInsights/2.2.2

Body:



DEBUG: BeforeCall: 
DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Pragma                        : no-cache
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
x-ms-ratelimit-remaining-subscription-reads: 11998
x-ms-request-id               : 031a78cc-7030-404a-8dc6-ee920f08aa36
x-ms-correlation-request-id   : 031a78cc-7030-404a-8dc6-ee920f08aa36
x-ms-routing-request-id       : CENTRALUS:20231116T153639Z:031a78cc-7030-404a-8dc6-ee920f08aa36
Cache-Control                 : no-cache
Date                          : Thu, 16 Nov 2023 15:36:39 GMT
Server                        : Microsoft-IIS/10.0
X-Powered-By                  : ASP.NET

Body:
{
  "CurrentBillingFeatures": [
    "Basic"
  ],
  "DataVolumeCap": {
    "Cap": 0.0,
    "MaxHistoryCap": 1000.0,
    "ResetTime": 0,
    "WarningThreshold": 90,
    "StopSendNotificationWhenHitThreshold": false,
    "StopSendNotificationWhenHitCap": true
  },
  "EndTime": "2018-04-02T15:00:00+02:00"
}


DEBUG: ResponseCreated: 
DEBUG: BeforeResponseDispatch: 
DEBUG: Finally: 
DEBUG: CmdletAfterAPICall: 
DEBUG: [CmdletProcessRecordAsyncEnd]: Finish HTTP process
DEBUG: CmdletProcessRecordAsyncEnd: 
DEBUG: CmdletProcessRecordEnd: 
True
Set-AzApplicationInsightsDailyCap : A parameter cannot be found that matches parameter name 'DailyCapGB'.
At line:1 char:1
+ Set-AzApplicationInsightsDailyCap -ResourceGroupName $appInsightsRg - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-AzApplicationInsightsDailyCap], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Set-AzApplicationInsightsDailyCap

Environment data

Name                           Value                                                                                                                                                                                                                
----                           -----                                                                                                                                                                                                                
PSVersion                      5.1.17763.5122                                                                                                                                                                                                       
PSEdition                      Desktop                                                                                                                                                                                                              
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                              
BuildVersion                   10.0.17763.5122                                                                                                                                                                                                      
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                      
WSManStackVersion              3.0                                                                                                                                                                                                                  
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                  
SerializationVersion           1.1.0.1

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.13.1                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzConte…
Script     2.2.2                 Az.ApplicationInsights              {Get-AzApplicationInsights, Get-AzApplicationInsi…

Error output

DEBUG: 4:39:23 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 4:39:23 PM - using account id 'b1f41663-b902-4894-a38c-d75b08054a9c'...
DEBUG: 4:39:23 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].


   HistoryId: 9


Message        : A parameter cannot be found that matches parameter name 'DailyCapGB'.
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.ParameterBindingException
InvocationInfo : {Set-AzApplicationInsightsComponentCurrentBillingFeature}
Line           :         . Az.ApplicationInsights.internal\Set-AzApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 
Position       : At C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationInsights\2.2.2\custom\Set-AzApplicationInsightsDailyCap.ps1:127 char:99
                 + ... zApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 +                                                        ~~~~~~~~~~~~~~~~~~
HistoryId      : 9



   HistoryId: 5


Message        : A parameter cannot be found that matches parameter name 'DailyCapGB'.
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.ParameterBindingException
InvocationInfo : {Set-AzApplicationInsightsComponentCurrentBillingFeature}
Line           :         . Az.ApplicationInsights.internal\Set-AzApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 
Position       : At C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationInsights\2.2.2\custom\Set-AzApplicationInsightsDailyCap.ps1:127 char:99
                 + ... zApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 +                                                        ~~~~~~~~~~~~~~~~~~
HistoryId      : 5



   HistoryId: 4


Message        : A parameter cannot be found that matches parameter name 'DailyCapGB'.
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.ParameterBindingException
InvocationInfo : {Set-AzApplicationInsightsComponentCurrentBillingFeature}
Line           :         . Az.ApplicationInsights.internal\Set-AzApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 
Position       : At C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationInsights\2.2.2\custom\Set-AzApplicationInsightsDailyCap.ps1:127 char:99
                 + ... zApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 +                                                        ~~~~~~~~~~~~~~~~~~
HistoryId      : 4



   HistoryId: 3


Message        : A parameter cannot be found that matches parameter name 'DailyCapGB'.
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.ParameterBindingException
InvocationInfo : {Set-AzApplicationInsightsComponentCurrentBillingFeature}
Line           :         . Az.ApplicationInsights.internal\Set-AzApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 
Position       : At C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationInsights\2.2.2\custom\Set-AzApplicationInsightsDailyCap.ps1:127 char:99
                 + ... zApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 +                                                        ~~~~~~~~~~~~~~~~~~
HistoryId      : 3



   HistoryId: 1


Message        : A parameter cannot be found that matches parameter name 'DailyCapGB'.
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.ParameterBindingException
InvocationInfo : {Set-AzApplicationInsightsComponentCurrentBillingFeature}
Line           :         . Az.ApplicationInsights.internal\Set-AzApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 
Position       : At C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationInsights\2.2.2\custom\Set-AzApplicationInsightsDailyCap.ps1:127 char:99
                 + ... zApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters
                 +                                                        ~~~~~~~~~~~~~~~~~~
HistoryId      : 1



DEBUG: 4:39:23 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:39:23 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.Accounts:2.13.2; CommandName: Resolve-AzError; PSVersion: 5.1.17763.5122; IsSuccess: True; Duration: 00:00:00.2273787
DEBUG: 4:39:23 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:39:23 PM - ResolveError end processing.

Yuvaraj-Devaraj avatar Nov 16 '23 15:11 Yuvaraj-Devaraj

Thanks for reporting. It is a bug triggered by the implicit type conversion that only when you pass in 0 to this parameter it will be converted to false then trigger this bug. We'll prioritize a fix.

https://github.com/Azure/azure-powershell/blame/cfaa36ba511c2cb843230e7f5e8f41902da24d90/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsDailyCap.ps1#L113

isra-fel avatar Nov 22 '23 09:11 isra-fel

Hello @Yuvaraj-Devaraj, I could not reproduce locally on version 2.2.2 , or the most recent version. Can you please check if this issue still persists? I feel it may have resolved itself.

DanielMicrosoft avatar Nov 19 '25 02:11 DanielMicrosoft

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!