【问题标题】:Creating empty folder in Azure ADSL Gen 2 Storage account using rest api使用 rest api 在 Azure ADLS Gen2 存储帐户中创建空文件夹
【发布时间】:2021-08-03 19:41:32
【问题描述】:

我想在 azure adsl gen 2 存储帐户中创建一个空文件夹并删除空文件夹,首先我尝试使用 cli,我能够使用以下命令创建它

  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

我正在从 rest api 尝试同样的事情,然后创建文件而不是文件夹:

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__'

我正在关注这个链接:https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create

请帮助我知道我的休息电话中缺少什么

【问题讨论】:

    标签: azure azure-storage


    【解决方案1】:

    我的查询已解决,我的 URL 错误,对于 ADSL gen 2,我应该在 URL 中使用 dfs 而不是 blob,正确的 URL 是:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-09-15
      • 1970-01-01
      • 2022-01-13
      • 2021-05-22
      • 2019-11-26
      • 2020-09-22
      • 1970-01-01
      相关资源
      最近更新 更多