focode
focode

Reputation: 716

Creating empty folder in Azure ADSL Gen 2 Storage account using rest api

I wanted to create an empty folder and delete empty folder in azure adsl gen 2 storage account, first I tried with cli and I was able to create it using the following commands

  1. az login --service-principal --username removed --password removed --tenant removed

2.[CREATE] az storage fs directory create -n my-directory -f removed --account-name removed

3.[DELETE] az storage fs directory delete -n my-directory -f removed --account-name removed

and same thing I am trying it from rest api , then file is getting created but not the folder:

curl --location --request PUT 'https://__removed__.blob.core.windows.net/__container_name__/__path__/__directory_taht_i_want_to_be_created__?resource=directory&x-ms-version=2018-11-09' \
--header 'x-ms-version: 2018-11-09' \
--header 'x-ms-blob-type: BlockBlob' \
--header 'Authorization: Bearer __removed__'

I am following this link: https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create

Please help me know what is missing in my rest call

Upvotes: 0

Views: 440

Answers (1)

focode
focode

Reputation: 716

I got my query resolved, my URL was wrong, for ADSL gen 2 I should use dfs instead of blob in the URL, the correct URL is :

https://storageaccountname.dfs.core.windows.net

Upvotes: 1

Related Questions