Closed sbmatrosov closed 11 months ago
Hey @RahulGGupta, Can you check it once by setting up below configurations:
Select the Runtime version as - 4
Select the PoweShell version 7.4
Save the changes and restart the function App
28/8/2024, 5:29:59 pm
Information
Executing 'Functions.JCTimerTrigger' (Reason='Timer fired at 2024-08-28T11:59:59.9988841+00:00', Id=4e3d9112-9d32-438b-b94e-4db7eb2aa9ad)
28/8/2024, 5:30:00 pm
Information
INFORMATION: JumpCloud timer triggered and is running on time! TIME: 08/28/2024 12:00:00
28/8/2024, 5:30:01 pm
Warning
The Function app may be missing a module containing the 'New-AzStorageContext' command definition. If this command belongs to a module available on the PowerShell Gallery, add a reference to this module to requirements.psd1. Make sure this module is compatible with PowerShell 7. For more details, see https://aka.ms/functions-powershell-managed-dependency. If the module is installed but you are still getting this error, try to import the module explicitly by invoking Import-Module just before the command that produces the error: this will not fix the issue but will expose the root cause.
28/8/2024, 5:30:01 pm
Error
28/8/2024, 5:30:01 pm
Error
ERROR: The term 'New-AzStorageContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Exception : Type : System.Management.Automation.CommandNotFoundException ErrorRecord : Exception : Type : System.Management.Automation.ParentContainsErrorRecordException Message : The term 'New-AzStorageContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. HResult : -2146233087 TargetObject : New-AzStorageContext CategoryInfo : ObjectNotFound: (New-AzStorageContext:String) [], ParentContainsErrorRecordException FullyQualifiedErrorId : CommandNotFoundException InvocationInfo : ScriptLineNumber : 22 OffsetInLine : 15 HistoryId : 1 ScriptName : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 Line : $JCstorage = New-AzStorageContext -ConnectionString $AzureWebJobsStorage PositionMessage : At C:\home\site\wwwroot\JCTimerTrigger\run.ps1:22 char:15 + $JCstorage = New-AzStorageContext -ConnectionString $AzureWebJobsSto … + ~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 InvocationName : New-AzStorageContext CommandOrigin : Internal ScriptStackTrace : at 1 useLocalScope) at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource) at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction
6.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) Message : The term 'New-AzStorageContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Data : System.Collections.ListDictionaryInternal Source : System.Management.Automation HResult : -2146233087 TargetObject : New-AzStorageContext CategoryInfo : ObjectNotFound: (New-AzStorageContext:String) [], CommandNotFoundException FullyQualifiedErrorId : CommandNotFoundException InvocationInfo : ScriptLineNumber : 22 OffsetInLine : 15 HistoryId : 1 ScriptName : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 Line : $JCstorage = New-AzStorageContext -ConnectionString $AzureWebJobsStorage PositionMessage : At C:\home\site\wwwroot\JCTimerTrigger\run.ps1:22 char:15 + $JCstorage = New-AzStorageContext -ConnectionString $AzureWebJobsSto … + ~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 InvocationName : New-AzStorageContext CommandOrigin : Internal ScriptStackTrace : at ~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 InvocationName : Get-AzstorageQueue CommandOrigin : Internal ScriptStackTrace : at 1 useLocalScope) at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource) at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction
6.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) Message : The term 'Get-AzstorageQueue' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Data : System.Collections.ListDictionaryInternal Source : System.Management.Automation HResult : -2146233087 TargetObject : Get-AzstorageQueue CategoryInfo : ObjectNotFound: (Get-AzstorageQueue:String) [], CommandNotFoundException FullyQualifiedErrorId : CommandNotFoundException InvocationInfo : ScriptLineNumber : 25 OffsetInLine : 6 HistoryId : 1 ScriptName : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 Line : if(( Get-AzstorageQueue -context $JCStorage -Name $JCQueuename -ErrorAction SilentlyContinue ).name ){ PositionMessage : At C:\home\site\wwwroot\JCTimerTrigger\run.ps1:25 char:6 + if(( Get-AzstorageQueue -context $JCStorage -Name $JCQueuename -Error … + ~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 InvocationName : Get-AzstorageQueue CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at ~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\JCTimerTrigger PSCommandPath : C:\home\site\wwwroot\JCTimerTrigger\run.ps1 CommandOrigin : Internal ScriptStackTrace : at
@RahulGGupta, Based on the invocations, the logs, the function app still running on Poweshell version 7 or need to generate new logs with 7.4. Could you please verify the configuration again, and wait for some time to generate new logs
i just verified its 7.4 only and in notification its also giving above errors
the trigger is not working since 5:29 PM, once we changed the powershell and python to 4
28/8/2024, 5:29:59 pm Success 0 2756 bf785c139083174b9a5ef1433874343e
Describe the bug I have an Azure Function App that utilizes a PowerShell script to call the JumpCloud Directory Insights API and retrieves logs from different services. However, despite proper configuration, the script is not retrieving logs from some services (mdm and software).
To Reproduce Steps to reproduce the behavior:
1.Configure the Azure Function App with necessary bindings and environment variables.
Expected behavior I expected the script to retrieve logs from all specified services, including mdm and software, and post them to the Log Analytics workspace.
Additional context We have already checked the configuration of the Azure Function App and verified that it is set up correctly to retrieve logs from the specified services. We have also tested the API separately and confirmed that it is capable of retrieving logs from the mdm and software services. This seems to be an issue with the PowerShell script or the way the Azure Function App is processing the script. link to connector https://github.com/Azure/Azure-Sentinel/tree/449788b130a598fc381ec07f967e91ee3df62787/DataConnectors/JumpCloud%20Single%20Sign%20On