【问题标题】:az storage account: 'blob-service-properties' is not in the 'az storage account' command groupaz storage account:“blob-service-properties”不在“az storage account”命令组中
【发布时间】:2021-08-13 10:27:53
【问题描述】:

我想启用版本控制,使用 CLI 在 Azure 存储帐户中更改源。我从 Microsoft 文档https://docs.microsoft.com/en-us/cli/azure/storage/account/blob-service-properties?view=azure-cli-latest 中得到了以下命令。

    az storage account blob-service-properties update -n sdffsjhiwezzaz --enable-change-feed true --enable-versioning true --enable-delete-retention true --delete-retention-days 100

得到以下错误

    az storage account: 'blob-service-properties' is not in the 'az storage account' command group. See 'az storage account --help'.

请告诉我如何使用 Azure CLI 启用版本控制和 ChangeFeed

【问题讨论】:

    标签: azure azure-cli


    【解决方案1】:

    我正在使用 azure-cli 2.27.1 并发现它有效。不,语法略有不同

    az storage blob service-properties update --account-name mystorageaccount --delete-retention true --delete-retention-period 5
    

    https://docs.microsoft.com/en-us/cli/azure/storage/blob/service-properties?view=azure-cli-latest#az_storage_blob_service_properties_update

    【讨论】:

      【解决方案2】:

      我能够成功运行命令。请确保您已安装最新版本的 CLI。

      当我运行az --version 命令时,我看到的是这样的:

      azure-cli                          2.2.0
      
      command-modules-nspkg              2.0.3
      core                               2.2.0
      nspkg                              3.0.4
      telemetry                          1.0.4
      

      对于更改提要,您还需要注册您的订阅以使用此功能,因为它目前处于预览状态。您可以在此处找到相关说明:https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-change-feed?tabs=azure-portal#register-your-subscription-preview

      【讨论】: