Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.62k stars 822 forks source link

SDK does not validate resource properties during creation #22965

Open roshms opened 4 months ago

roshms commented 4 months ago

Bug Report

Issue Description: Using the code in Github repository for GoLang SDK as sample customer created ADF resources by executing their script. Resources created: pipeline copy activity Azure postGreSql Dataset and Linked Service Azure SQL Dataset and Linked Service

During Copy Activity runtime using the created resources the following error occurs: Error Message: Required property 'properties' is missing in payload.

After investigation we found that in the datasets generated from the GoLang SDK the linkedServiceName has no property type: "LinkedServiceReference" inside. The Datasets were not generated properly in ADF as there was no error when creating resources which lead to the error message in ADF when running the pipeline and customer could not fix the issue as they did not know which property and where it is missing.

What should had happened: During the creation of the resources using the GoLang SDK the SDK should validate the resources being created for any required properties needed and specifically point them out with an error message during the execution of the code to create resources.

Please use the file attached and modify to your own resources and change the file extension to .go and use the above mentioned GoLang SDK version.

main.txt main.txt

github-actions[bot] commented 4 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Frey-Wang @Jingshu923 @zhangyd2015.

jhendrixMSFT commented 4 months ago

Hello! We intentionally don't validate service parameters in our SDKs, we defer to the service for that as it's the source of truth (this is codified in our SDK design guidelines). It sounds like the service should return a better error message though.

github-actions[bot] commented 4 months ago

Hi @roshms. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

roshms commented 4 months ago

Hello! We intentionally don't validate service parameters in our SDKs, we defer to the service for that as it's the source of truth (this is codified in our SDK design guidelines). It sounds like the service should return a better error message though.

So the Service team in this case ADF would have to then build this in?

jhendrixMSFT commented 4 months ago

The service team is responsible for providing a descriptive, actionable error message so that callers can easily diagnose the failure (improper/incomplete inputs, etc). This way, it uniformly works across all language SDKs/REST calls.

roshms commented 4 months ago

The service team is responsible for providing a descriptive, actionable error message so that callers can easily diagnose the failure (improper/incomplete inputs, etc). This way, it uniformly works across all language SDKs/REST calls.

Okay thank you for your quick reply. I will check with the Service team.