Azure / azure-rest-api-specs-examples

SDK examples for azure-rest-api-specs
MIT License
22 stars 13 forks source link

Urgent: Sudden issue started with GetDataFactoryPipeline function #4825

Open divyeshgohil85 opened 2 months ago

divyeshgohil85 commented 2 months ago

Link to sample

No response

Library name and version

Package= Azure.ResourceManager.DataFactory, Version=1.1.0

Language of the Sample

Sample Issue Type

Issue details

I've been using the Azure.ResourceManager.DataFactory SDK and recently encountered an issue. Previously, I used the GetDataFactoryPipeline method to retrieve my pipeline details and then run it in the next step. This setup has been working fine. However, yesterday, when I tried to run the pipeline, it threw an exception from the GetDataFactoryPipeline method.

The stack trace is:

System.InvalidCastException HResult=0x80004002 Message=Unable to cast object of type 'System.Collections.Generic.Dictionary2[System.String,System.Object]' to type 'System.String'. Source=Azure.Core.Expressions.DataFactory StackTrace: at Azure.Core.Expressions.DataFactory.DataFactoryElementJsonConverter.Deserialize[T](JsonElement json) at Azure.Core.Expressions.DataFactory.DataFactoryElementJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter1.ReadAsObject(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at Azure.ResourceManager.DataFactory.Models.WebActivity.DeserializeWebActivity(JsonElement element, ModelReaderWriterOptions options) at Azure.ResourceManager.DataFactory.Models.PipelineActivity.DeserializePipelineActivity(JsonElement element, ModelReaderWriterOptions options) at Azure.ResourceManager.DataFactory.DataFactoryPipelineData.DeserializeDataFactoryPipelineData(JsonElement element, ModelReaderWriterOptions options) at Azure.ResourceManager.DataFactory.PipelinesRestOperations.Get(String subscriptionId, String resourceGroupName, String factoryName, String pipelineName, String ifNoneMatch, CancellationToken cancellationToken) at Azure.ResourceManager.DataFactory.DataFactoryPipelineCollection.Get(String pipelineName, String ifNoneMatch, CancellationToken cancellationToken) at Azure.ResourceManager.DataFactory.DataFactoryResource.GetDataFactoryPipeline(String pipelineName, String ifNoneMatch, CancellationToken cancellationToken) at Domains.Datafactory.DatafactoryDomain.d__11.MoveNext() in D:\Project\Arne_Clo\azure-data-factory-integration-dot-net\Domains\Datafactory\DatafactoryDomain.cs:line 73

Above stack track trace states that something strange is released and the object is changed from System.String to System.Collections.Generic.Dictionary`2[System.String,System.Object].

I did not see any parameter changes for the same function (GetDataFactoryPipeline), I believe this is an internal issue and want this issue to address ASAP.

image

Expected behavior

No response

Actual behavior

No response

Reproduction Steps

No response

Environment

Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win-x64

live1206 commented 1 month ago

@HarveyLink Please help take a look at this, thanks!

welovej commented 4 weeks ago

Hi @divyeshgohil85, sorry, but I couldn't find the method GetDataFactoryResource() in Azure.ResourceManager.DataFactory. Could you provide a bit more context?

divyeshgohil85 commented 1 week ago

Hi, we have implemented logic to fetch factory resources. Using armClient, we retrieve a subscriptionResource, and from this subscriptionResource, we can access a dataFactory resourceGroupResource.

Please refer to the attachment below. Image