Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.08k stars 1.2k forks source link

Failed to use createFile() from core-rest-pipeline for mfd test case #31372

Open kazrael2119 opened 2 weeks ago

kazrael2119 commented 2 weeks ago

can't use createFile() as a body property for a mfd test case error message:

"ResponseBody": {
        "requestId": "5016a2b0-8aa0-41e7-90ba-5bbc8ebfec44",
        "errorCode": "ATLAS-400-00-09B",
        "errorMessage": "No data found in the uploaded file"
      }

steps to repro: 1 checkout to https://github.com/Azure/azure-sdk-for-js/pull/31356 2 rush update and rush build -t @azure-rest/purview-datamap 3 change this line as

body: createFile(fileContent, "template_2.csv")

4 use this endpoint: https://jssdktest.purview.azure.com/ and run test with record mode

qiaozha commented 2 weeks ago

@timovv could you help take a look at this issue.

timovv commented 2 weeks ago

With the 2.0.0 version of @azure-rest/core-client, createFile and createFileFromStream are no longer necessary, and the package doesn't support them. Generally for newly generated RLCs createFile and createFileFromStream would not be available anyway since they are not re-exported from core-rest-pipeline.

Since there is a breaking change here anyway with the 2.0.0 upgrade, I think the ideal path forward would be to just remove the re-export of createFile and createFileFromStream from the public API. That would resolve this issue since the helpers would no longer be available.