Open
Description
Library name and version
Azure.Analytics.Synapse.Artifacts 1.0.0-preview.17
Describe the bug
The Username property on WebActivityAuthentication
is defined as a string
:
public string Username { get; set; }
However in Synapse this property can be defined as an expression, and when this is the case, deserialization fails with the following error:
Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.InvalidOperationException: The requested operation requires an element of type 'String', but the target element has type 'Object'.
at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)
at Azure.Analytics.Synapse.Artifacts.Models.WebActivityAuthentication.DeserializeWebActivityAuthentication(JsonElement element)
at Azure.Analytics.Synapse.Artifacts.Models.WebActivity.DeserializeWebActivity(JsonElement element)
at Azure.Analytics.Synapse.Artifacts.Models.Activity.DeserializeActivity(JsonElement element)
at Azure.Analytics.Synapse.Artifacts.Models.ForEachActivity.DeserializeForEachActivity(JsonElement element)
at Azure.Analytics.Synapse.Artifacts.Models.Activity.DeserializeActivity(JsonElement element)
at Azure.Analytics.Synapse.Artifacts.Models.PipelineResource.DeserializePipelineResource(JsonElement element)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Microsoft.Azure.Commands.Synapse.Common.JsonConvert.DeserializeObject[T](String rawJsonContent)
at Microsoft.Azure.Commands.Synapse.Models.SynapseAnalyticsArtifactsClient.CreateOrUpdatePipeline(String pipelineName, String rawJsonContent)
at Microsoft.Azure.Commands.Synapse.SetAzureSynapsePipeline.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Expected behavior
No exception should be thrown when deserializing a WebActivityAuthentication
when the user name is set to an expression.
Actual behavior
An exception is thrown.
Reproduction Steps
- Define a pipeline in Synapse that uses a WebActivity and sets the username property to an expression, e.g. bind it to a parameter or variable
- Deserialize the pipeline's JSON using the SDK
- The exception is thrown
Environment
No response
Metadata
Metadata
Assignees
Labels
This issue points to a problem in the data-plane of the library.Workflow: This issue is responsible by Azure service team.Issues that are reported by GitHub users external to the Azure organization.Workflow: This issue needs attention from Azure service team or SDK teamThe issue doesn't require a change to the product in order to be resolved. Most issues start as that