Set-AzSynapseTrigger [Error] EXCEPTION: Object reference not set to an instance of an object

William Yang 6 Reputation points
2022-03-15T03:20:17.207+00:00

I am receiving this error message when I am running the code from azure function. The code worked fine before, and all accesses are in place.
All parameters have correct values. The function able to read the synapse information.

code:
Set-AzSynapseTrigger -WorkspaceObject $workspace -Name $triggerName -DefinitionFile $ArmFilePath

2022-03-14T23:56:35.447 [Error] EXCEPTION: Object reference not set to an instance of an object.Exception :Type : System.NullReferenceExceptionTargetSite :Name : WriteObjectValueDeclaringType : Azure.Core.Utf8JsonWriterExtensions, Azure.Analytics.Synapse.Artifacts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8MemberType : MethodModule : Azure.Analytics.Synapse.Artifacts.dllStackTrace :at Azure.Core.Utf8JsonWriterExtensions.WriteObjectValue(Utf8JsonWriter writer, IUtf8JsonSerializable value)at Azure.Analytics.Synapse.Artifacts.Models.TriggerResource.Azure.Core.IUtf8JsonSerializable.Write(Utf8JsonWriter writer)at Azure.Core.Utf8JsonWriterExtensions.WriteObjectValue(Utf8JsonWriter writer, IUtf8JsonSerializable value)at Azure.Analytics.Synapse.Artifacts.TriggerRestClient.CreateCreateOrUpdateTriggerRequest(String triggerName, TriggerResource trigger, String ifMatch)at Azure.Analytics.Synapse.Artifacts.TriggerRestClient.CreateOrUpdateTrigger(String triggerName, TriggerResource trigger, String ifMatch, CancellationToken cancellationToken)at Azure.Analytics.Synapse.Artifacts.TriggerClient.StartCreateOrUpdateTrigger(String triggerName, TriggerResource trigger, String ifMatch, CancellationToken cancellationToken)at Microsoft.Azure.Commands.Synapse.Models.SynapseAnalyticsArtifactsClient.CreateOrUpdateTrigger(String triggerName, String rawJsonContent)at Microsoft.Azure.Commands.Synapse.SetAzureSynapseTrigger.ExecuteCmdlet()at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__31.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action1 executor)at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJobTat Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()Message : Object reference not set to an instance of an object.Source : Azure.Analytics.Synapse.ArtifactsHResult : -2147467261CategoryInfo : CloseError: (:) [Set-AzSynapseTrigger], NullReferenceExceptionFullyQualifiedErrorId : Microsoft.Azure.Commands.Synapse.SetAzureSynapseTriggerInvocationInfo :MyCommand : Set-AzSynapseTriggerScriptLineNumber : 167OffsetInLine : 13HistoryId : 1ScriptName : D:\home\site\wwwroot\CreateAdfTrigger_Synapse\run.ps1Line : Set-AzSynapseTrigger -Name $triggerName -WorkspaceObject $workspace -DefinitionFile $ArmFilePathPositionMessage : At D:\home\site\wwwroot\CreateAdfTrigger_Synapse\run.ps1:167 char:13+ Set-AzSynapseTrigger -Name $triggerName -WorkspaceObject …+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PSScriptRoot : D:\home\site\wwwroot\CreateAdfTrigger_SynapsePSCommandPath : D:\home\site\wwwroot\CreateAdfTrigger_Synapse\run.ps1InvocationName : Set-AzSynapseTriggerCommandOrigin : InternalScriptStackTrace : at Deploy-TriggerArmTemplates, D:\home\site\wwwroot\CreateAdfTrigger_Synapse\run.ps1: line 167at <ScriptBlock>, D:\home\site\wwwroot\CreateAdfTrigger_Synapse\run.ps1: line 270PipelineIterationInfo :
2022-03-14T23:56:35.487 [Error] Executed 'Functions.CreateAdfTrigger_Synapse' (Failed, Id=842259ba-6a70-4acd-b2cb-31bedd07cf6e, Duration=39880ms)Result: FailureException: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Object reference not set to an instance of an object.Stack: at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)at System.Management.Automation.Runspaces.Pipeline.Invoke()at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)at System.Management.Automation.PowerShell.CoreInvokeHelperTInput,TOutputat System.Management.Automation.PowerShell.CoreInvokeTInput,TOutputat System.Management.Automation.PowerShell.InvokeTat System.Management.Automation.PowerShell.InvokeTat Microsoft.Azure.Functions.PowerShellWorker.PowerShell.PowerShellExtensions.InvokeAndClearCommandsT in /home/vsts/work/1/s/src/PowerShell/PowerShellExtensions.cs:line 45at Microsoft.Azure.Functions.PowerShellWorker.PowerShell.PowerShellManager.InvokeNonOrchestrationFunction(DurableController durableController, IDictionary outputBindings) in /home/vsts/work/1/s/src/PowerShell/PowerShellManager.cs:line 294at Microsoft.Azure.Functions.PowerShellWorker.PowerShell.PowerShellManager.InvokeFunction(AzFunctionInfo functionInfo, Hashtable triggerMetadata, TraceContext traceContext, IList`1 inputData, FunctionInvocationPerformanceStopwatch stopwatch) in /home/vsts/work/1/s/src/PowerShell/PowerShellManager.cs:line 229at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.InvokeFunction(AzFunctionInfo functionInfo, PowerShellManager psManager, FunctionInvocationPerformanceStopwatch stopwatch, InvocationRequest invocationRequest) in /home/vsts/work/1/s/src/RequestProcessor.cs:line 333at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.ProcessInvocationRequestImpl(StreamingMessage request, AzFunctionInfo functionInfo, PowerShellManager psManager, FunctionInvocationPerformanceStopwatch stopwatch) in /home/vsts/work/1/s/src/RequestProcessor.cs:line 306

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,697 questions
{count} votes

1 answer

Sort by: Most helpful
  1. William Yang 6 Reputation points
    2022-03-17T17:30:03.907+00:00

    Hi Saurabh,

    Thank you for responding. We figured out the what the issue was. It was the template that we used is no longer work. But we are good now.
    Thanks

    William

    1 person found this answer helpful.