Azure / Azure/azure-powershell

Start-AzSynapseTrigger throws error but starts the trigger

Open
#16,368 31 comments 2 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad bug customer-reported question Service Attention Synapse
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

When using the {Start-AzSynapseTrigger} PS cmd in Azure Powershell 5.0 task in Azure DevOps pipeline, the cmd fails with the error
"Request operation requires element of type Object byt target is String"
However, in the background it would have started the trigger.

### Issue script & Debug output

```PowerShell
Start-AzSynapseTrigger : The requested operation requires an element of type 'Object', but the target element has type
'String'.
At line:1 char:26
+ ... ach-Object {Start-AzSynapseTrigger -WorkspaceName $workspaceName -Nam ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Start-AzSynapseTrigger], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Synapse.StartAzureSynapseTrigger
```

### Environment data

```PowerShell
**************************************
Name Value
---- -----
PSVersion 5.1.22000.65
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22000.65
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

### Module versions

```PowerShell
0.11.0 Az.Synapse
```

### Error output

```PowerShell
Exception : System.InvalidOperationException
InvocationInfo : {Start-AzSynapseTrigger}
Line : $trigs | ForEach-Object {Start-AzSynapseTrigger -WorkspaceName $workspaceName -Name $_.name}
Position : At line:1 char:26
+ ... ach-Object {Start-AzSynapseTrigger -WorkspaceName $workspaceName -Nam ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 17

Message : The requested operation requires an element of type 'Object', but the target element has type
'String'.
StackTrace : at System.Text.Json.JsonElement.EnumerateObject()
at Azure.Core.ArmOperationHelpers`1.IsTerminalState(String& state)
at Azure.Core.ArmOperationHelpers`1.d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Core.ArmOperationHelpers`1.d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Core.ArmOperationHelpers`1.d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Microsoft.Azure.Commands.Synapse.Common.Utils.Poll[T](Operation`1 operation)
at Microsoft.Azure.Commands.Synapse.Models.SynapseAnalyticsArtifactsClient.StartTrigger(String
triggerName)
at Microsoft.Azure.Commands.Synapse.StartAzureSynapseTrigger.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.