代码之家  ›  专栏  ›  技术社区  ›  bdcoder

Azure CLI-默认为Azure门户中的Microsoft Entra授权-如何?

  •  0
  • bdcoder  · 技术社区  · 2 年前

    我正在尝试使用Azure CLI(bash)创建存储帐户,并将“默认为Azure门户中的Microsoft Entra授权”属性设置为“已启用”(如下所示):

    enter image description here

    上似乎没有选项 Azure CLI storage account create command 要做到这一点——或者更可能的是,我错过了包含哪个选项。

    这可以通过Azure CLI完成吗?

    我确实试过了 this solution ,但没有效果(设置仍然为“禁用”)。

    0 回复  |  直到 2 年前
        1
  •  1
  •   Venkatesan    2 年前

    Azure门户中默认为Microsoft Entra授权-如何?

    您可以使用以下命令 enable Azure门户中默认的Microsoft Entra授权通过 Azure CLI 命令。

    命令

    az storage account update -g <Resource grp name> -n <Storage account name> --set defaultToOAuthAuthentication=true
    

    输出

    PS /home/xxxx> az storage account update -g xxxx -n venkat678 --set defaultToOAuthAuthentication=true 
    {
      "accessTier": "Hot",
      "accountMigrationInProgress": null,
      "allowBlobPublicAccess": true,
      "allowCrossTenantReplication": false,
      "allowSharedKeyAccess": true,
      "allowedCopyScope": null,
      "azureFilesIdentityBasedAuthentication": null,
      "blobRestoreStatus": null,
      "creationTime": "xxxx,
      "customDomain": null,
      "defaultToOAuthAuthentication": true,
      "dnsEndpointType": null,
      "enableHttpsTrafficOnly": true
    

    enter image description here

    门户:

    上述命令在Azure门户中执行并启用了默认为Microsoft Entra的授权。

    enter image description here

    参考

    az storage account | Microsoft Learn