MSEndpointMgr / IntuneEnhancedInventory

Repository for the Intune Enhanced Inventory solution by MSEndpointmgr.com
MIT License
54 stars 17 forks source link

[BUG] #14

Closed Szymek68 closed 1 year ago

Szymek68 commented 1 year ago

Describe the bug All device reporting data upload issue: InventoryDate:10-11 11:51 FAIL: AppInventory :Upload payload size is 44.4Kb FAIL: DeviceInventory :Upload payload size is 2.1Kb

In Function App Monitor we have the following: 2022-11-10 15:13:14.697 ERROR: Exception calling "FromBase64String" with "1" argument(s): "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters." Exception : Type : System.Management.Automation.MethodInvocationException ErrorRecord : Exception : Type : System.Management.Automation.ParentContainsErrorRecordException Message : Exception calling "FromBase64String" with "1" argument(s): "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters." HResult : -2146233087 CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException FullyQualifiedErrorId : FormatException InvocationInfo : ScriptLineNumber : 84 OffsetInLine : 4 HistoryId : -1 ScriptName : C:\home\site\wwwroot\LogCollectorAPI\run.ps1 Line : $keyBytes = [Convert]::FromBase64String($sharedKey) PositionMessage : At C:\home\site\wwwroot\LogCollectorAPI\run.ps1:84 char:4 + $keyBytes = [Convert]::FromBase64String($sharedKey) + ~~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\LogCollectorAPI PSCommandPath : C:\home\site\wwwroot\LogCollectorAPI\run.ps1 CommandOrigin : Internal ScriptStackTrace : at Send-LogAnalyticsData, C:\home\site\wwwroot\LogCollectorAPI\run.ps1: line 84 at , C:\home\site\wwwroot\LogCollectorAPI\run.ps1: line 204 TargetSite : Name : ConvertToMethodInvocationException DeclaringType : System.Management.Automation.ExceptionHandlingOps, System.Management.Automation, Version=7.0.12.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 MemberType : Method Module : System.Management.Automation.dll StackTrace : at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo) at CallSite.Target(Closure , CallSite , Type , String ) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) Message : Exception calling "FromBase64String" with "1" argument(s): "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters." Data : System.Collections.ListDictionaryInternal InnerException : Type : System.FormatException TargetSite : Name : FromBase64CharPtr DeclaringType : System.Convert MemberType : Method Module : System.Private.CoreLib.dll StackTrace : at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) at System.Convert.FromBase64String(String s) at CallSite.Target(Closure , CallSite , Type , String ) Message : The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. Source : System.Private.CoreLib HResult : -2146233033 Source : System.Management.Automation HResult : -2146233087 CategoryInfo : NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId : FormatException InvocationInfo : ScriptLineNumber : 84 OffsetInLine : 4 HistoryId : -1 ScriptName : C:\home\site\wwwroot\LogCollectorAPI\run.ps1 Line : $keyBytes = [Convert]::FromBase64String($sharedKey) PositionMessage : At C:\home\site\wwwroot\LogCollectorAPI\run.ps1:84 char:4 + $keyBytes = [Convert]::FromBase64String($sharedKey) + ~~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\LogCollectorAPI PSCommandPath : C:\home\site\wwwroot\LogCollectorAPI\run.ps1 CommandOrigin : Internal ScriptStackTrace : at Send-LogAnalyticsData, C:\home\site\wwwroot\LogCollectorAPI\run.ps1: line 84 at , C:\home\site\wwwroot\LogCollectorAPI\run.ps1: line 204

JankeSkanke commented 1 year ago

So it seems to be an issue with getting the shared key from keyvault. You can verify the key is OK in Keyvault and that the configuration setting in the Function app is green on the keyvault reference as a start.

Szymek68 commented 1 year ago

Thank you very much, issue fixed.