Deli z drugimi prek


Account management operations on Azure Data Lake Storage Gen1 using REST API

In this article, you learn how to perform account management operations on Azure Data Lake Storage Gen1 using the REST API. Account management operations include creating a Data Lake Storage Gen1 account, deleting a Data Lake Storage Gen1 account, etc. For instructions on how to perform filesystem operations on Data Lake Storage Gen1 using REST API, see Filesystem operations on Data Lake Storage Gen1 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 Storage Gen1 account.

How do I authenticate using Microsoft Entra ID?

You can use two approaches to authenticate using Microsoft Entra ID.

Create a Data Lake Storage Gen1 account

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

Use the following cURL command. Replace <yourstoragegen1name> with your Data Lake Storage Gen1 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/<yourstoragegen1name>?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 Storage Gen1 account

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

Use the following cURL command to delete a Data Lake Storage Gen1 account. Replace <yourstoragegen1name> with your Data Lake Storage Gen1 account name.

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

You should see an output like the following snippet:

HTTP/1.1 200 OK
...
...

Next steps

See also