Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot create WebActivity headers #39187

Closed
chinarosesz opened this issue Oct 10, 2023 · 16 comments
Closed

[BUG] Cannot create WebActivity headers #39187

chinarosesz opened this issue Oct 10, 2023 · 16 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Data Factory Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@chinarosesz
Copy link

chinarosesz commented Oct 10, 2023

Library name and version

Azure.ResourceManager.DataFactory v1.0.0-beta.4

Describe the bug

I'm having a lot of trouble creating a web activity headers. I've tried using literal string, secure string, and expression. And none of this worked for the basic scenario such as setting a basic key/value pair.

The previous SDK worked because the headers takes in a dictionary, but the new SDK takes in a DataFactoryElement.

Expected behavior

Generated key value pairs for headers

Actual behavior

Generated value of 0, 1, 2, 3, and each character from the literal string as single item.

Reproduction Steps

// Create pipeline web activity
DataFactoryElement uri = $"@concat('https://{functionAppName}.azurewebsites.net/api/SyncPermissionsFunction?organization={org.Url}&code=',pipeline().parameters.functionkey)";
WebActivity webActivity = new WebActivity("SyncPermissionsFunction", WebActivityMethod.Get, uri);

// This line does not work.
webActivity.Headers = DataFactoryElement.FromLiteral("foo");

Environment

No response

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 10, 2023
@pallavit
Copy link
Contributor

Thank you for reporting the issue. Could you please share the name of the SDK you are trying to use?

@chinarosesz
Copy link
Author

Yes. This is the package I am using.

    <PackageReference Include="Azure.ResourceManager.DataFactory" Version="1.0.0-beta.4" />

@jsquire jsquire added Data Factory Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Oct 11, 2023
@Frey-Wang
Copy link
Member

What's the error you see here? From my perspective, you are using expression, so you can try something like:

var uri = DataFactoryElement<string>.FromExpression($"@concat($"@concat('https://{functionAppName}.azurewebsites.net/api/SyncPermissionsFunction?organization={org.Url}&code=',pipeline().parameters.functionkey)");
var webActivity = new WebActivity("SyncPermissionsFunction", WebActivityMethod.Get, uri);

@chinarosesz
Copy link
Author

I’m trying to pass in the headers. And the headers should be treated like an object or a dictionary. As of now it only takes in a string, and there is no way for me to construct headers if it is of type string. I have tried the whole day to construct the headers from the SDK and have no luck. Can you try on your side to construct a webactivity with headers?

@DavidKarlas
Copy link
Contributor

I'm facing same problem but from other side, I want to run GetDataFactoryPipelines method on DataFactoryResource class and it is throwing exception System.InvalidCastException: 'Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' to type 'System.String'.'

Turns out deserializing code wants to read String, but JSON returned from API has "headers": {} hence exception...

@DavidKarlas
Copy link
Contributor

This is weird, linked code is different than one I'm debugging:
image
Notice that debugged code is not decompiled, but came from source server...

@chinarosesz
Copy link
Author

Correct,

I'm facing same problem but from other side, I want to run GetDataFactoryPipelines method on DataFactoryResource class and it is throwing exception System.InvalidCastException: 'Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' to type 'System.String'.'

Turns out deserializing code wants to read String, but JSON returned from API has "headers": {} hence exception...

That’s correct. I get the same error as well. It expects a json object but the SDK property requires headers to be passed in a string. A WebActivity without headers is not going to do much..we need this fixed. Or might have to revert back to the old SDK.

@chinarosesz
Copy link
Author

Is there any update on this? I am happy to help and fix this issue as well so my team can leverage this feature. It's hard to use a webactivity without the ability to pass in headers.

@DavidKarlas
Copy link
Contributor

DavidKarlas commented Nov 8, 2023

I tested Azure/azure-rest-api-specs#26334 and works perfect for me... Not sure how to raise priority on this, because even most basic stuff like fetching pipelines doesn't work, if headers property is set....

@chinarosesz
Copy link
Author

@ArthurMa1978 , still no traction on this issue, can we proceed with the above PR? We need headers to work for webactivity in Azure Data Factory.

@DavidKarlas
Copy link
Contributor

Not sure if I should be angry or just sad... I even went as far as opening PR... This API is totally broken, I don't get it why is this not getting merged... Is ADF dead product? Should we start transitioning away from it?

@chinarosesz
Copy link
Author

I’m wondering the same here as well. Let’s see if we can escalate this together to someone in Azure since no response from here much. Getting very frustrated because this is the core functionality of a webactivity.

@DavidKarlas
Copy link
Contributor

It is not just about not being able to set WebActivity...
I literally can't fetch pipelines info, if there is any WebActivity in whole ADF factory, making whole API useless...

@ruowan
Copy link
Member

ruowan commented Dec 14, 2023

I am from ADF team. Thanks for feedback we are taking look at this issue. And trying to fix it.

@DavidKarlas
Copy link
Contributor

@ruowan can this be closed, or waiting for NuGet to be published?

@ruowan
Copy link
Member

ruowan commented Jan 18, 2024

Yes. The nuget package will be released by the end of Jan.

@ruowan ruowan closed this as completed Jan 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Data Factory Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

7 participants