Account management operations on Azure Data Lake Store using REST API

In this article, you learn how to perform account management operations on Data Lake Store using the REST API. Account management operations include creating a Data Lake Store account, deleting a Data Lake Store account, etc. For instructions on how to perform filesystem operations on Data Lake Store using REST API, see Filesystem operations on Data Lake Store using REST API.

Prerequisites

  • An Azure subscription. See Get Azure free trial.

  • cURL. This article uses cURL to demonstrate how to make REST API calls against a Data Lake Store account.

How do I authenticate using Azure Active Directory?

You can use two approaches to authenticate using Azure Active Directory.

Create a Data Lake Store account

This operation is based on the REST API call defined here.

Use the following cURL command. Replace <yourstorename> with your Data Lake Store name.

curl -i -X PUT -H "Authorization: Bearer <REDACTED>" -H "Content-Type: application/json" https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.DataLakeStore/accounts/<yourstorename>?api-version=2015-10-01-preview -d@"C:\temp\input.json"

In the above command, replace <REDACTED> with the authorization token you retrieved earlier. The request payload for this command is contained in the input.json file that is provided for the -d parameter above. The contents of the input.json file resemble the following snippet:

{
"location": "eastus2",
"tags": {
    "department": "finance"
    },
"properties": {}
}    

Delete a Data Lake Store account

This operation is based on the REST API call defined here.

Use the following cURL command to delete a Data Lake Store account. Replace <yourstorename> with your Data Lake Store name.

curl -i -X DELETE -H "Authorization: Bearer <REDACTED>" https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.DataLakeStore/accounts/<yourstorename>?api-version=2015-10-01-preview

You should see an output like the following snippet:

HTTP/1.1 200 OK
...
...

Next steps

See also