Open Madhufuture opened 2 months ago
Running Get-AzAutomationRunbook commands gives Object reference not set exception. I have verified the parameters that are being passed are valid.
Get-AzAutomationRunbook
PS C:\Users\MadhuRaju> Get-AzAutomationRunbook -ResourceGroupName 'dev-rg-ng-infra-shared-eau' -AutomationAccountName 'dev-aa-ng-infra' -Name 'Retire-Container-App' DEBUG: Initializing ConditionalAssemblyContext. PSEdition is [Desktop]. PSVersion is [5.1.22621.2506]. DEBUG: Initializing ConditionalAssemblyProvider. AssemblyRootPath is [C:\Program Files\WindowsPowerShell\Modules\Az.Accounts\3.0.0\StartupScripts\..\lib]. DEBUG: Got version 0 of Az DEBUG: Got version 0 of Az.Accounts DEBUG: 1:59:58 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 1:59:58 PM - GetAzureAutomationRunbook begin processing with ParameterSet 'ByRunbookName'. DEBUG: 1:59:58 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 1:59:58 PM - [ConfigManager] Got nothing from [EnableErrorRecordsPersistence], Module = [], Cmdlet = []. Returning default value [False]. Get-AzAutomationRunbook : Object reference not set to an instance of an object. At line:1 char:1 + Get-AzAutomationRunbook -ResourceGroupName 'dev-rg-ng-infra-shared-ea ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Get-AzAutomationRunbook], NullReferenceException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.GetAzureAutomationRunbook DEBUG: 1:59:58 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 1:59:58 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 1:59:58 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: AzureQoSEvent: Module: Az.Automation:1.10.0; CommandName: Get-AzAutomationRunbook; PSVersion: 5.1.22621.2506; IsSuccess: False; Duration: 00:00:00.2175639; SanitizeDuration: 00:00:00; Exception: Object reference not set to an instance of an object.; DEBUG: 1:59:58 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 1:59:58 PM - GetAzureAutomationRunbook end processing.
Name Value ---- ----- PSVersion 5.1.22621.2506 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.22621.2506 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 3.0.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-... Script 1.10.0 Az.Automation {Export-AzAutomationDscConfiguration, Export-AzAutomationDs...
DEBUG: 2:05:41 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 2:05:41 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'. DEBUG: 2:05:41 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 2:05:41 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True]. HistoryId: 2 Message : Object reference not set to an instance of an object. StackTrace : at Microsoft.Azure.Commands.Automation.Common.AutomationPSClient..ctor(IAzureContext context) at Microsoft.Azure.Commands.Automation.Cmdlet.AzureAutomationBaseCmdlet.get_AutomationClient() at Microsoft.Azure.Commands.Automation.Cmdlet.GetAzureAutomationRunbook.AutomationProcessRecord() at Microsoft.Azure.Commands.Automation.Cmdlet.AzureAutomationBaseCmdlet.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() Exception : System.NullReferenceException InvocationInfo : {Get-AzAutomationRunbook} Line : Get-AzAutomationRunbook -ResourceGroupName 'dev-rg-ng-infra-shared-eau' -AutomationAccountName 'dev-aa-ng-infra' -Name 'Retire-Container-App' Position : At line:1 char:1 + Get-AzAutomationRunbook -ResourceGroupName 'dev-rg-ng-infra-shared-ea ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 2 DEBUG: 2:05:41 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 2:05:41 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: AzureQoSEvent: Module: Az.Accounts:3.0.0; CommandName: Resolve-AzError; PSVersion: 5.1.22621.2506; IsSuccess: True; Duration: 00:00:00.1091753; SanitizeDuration: 00:00:00.0127862 DEBUG: 2:05:41 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 2:05:41 PM - ResolveError end processing.
Hello, is there any update on this issue?
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jaspkaur28, @sanjkum.
Description
Running
Get-AzAutomationRunbook
commands gives Object reference not set exception. I have verified the parameters that are being passed are valid.Issue script & Debug output
Environment data
Module versions
Error output