3
votes

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
You can read their SDK document here docs.microsoft.com/en-us/azure/storage/blobs/…Benjamin

2 Answers

0
votes

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.

0
votes

There is a Rest API to CRUD operations for Azure Data Lage Storage Gen2. You can implement them in your code like any other API call. You may Use HttpClient and read the response etc.

Azure Data Lage Storage Gen2 Rest documentation: https://docs.microsoft.com/en-us/rest/api/storageservices/data-lake-storage-gen2