How to create a file or upload a file to Azure Data Lake Storage Gen2

Viewed 4155

I have created a Azure Data Lake Storage Gen2 account through azure portal. How can I create a file in that account through c# code. I googled a lot but didn't find any samples.

Update 1:

In order to call REST api, I tried to generate token using below code but getting issue.Could you please post some sample code or correct me if anything goes wrong.

enter image description here

Issue:

AADSTS90002: Tenant 'token' not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator.

Update 2:

I have used below code aswell to create file but it is throwing error.

enter image description here

enter image description here

2 Answers

For now no SDK is supported for ADSL gen2, check the document:Known issues with Azure Data Lake Storage Gen2.

Blob storage APIs are disabled to prevent feature operability issues that could arise because Blob Storage APIs aren't yet interoperable with Azure Data Lake Gen2 APIs.

However you still could use the ADSL REST API, do the create,delete operation.


Update: For now, in the github there is a unofficial sdk, may be you could have a try. It's implemented with the REST API, here is the github link:AzureDataLakeGen2-SDK.

Related