【问题标题】:Change the connected Azure Key Vault via an Azure Pipeline通过 Azure Pipeline 更改连接的 Azure Key Vault
【发布时间】:2021-10-09 10:06:37
【问题描述】:

我们目前使用 Azure Key Vault 来存储某些机密,但是现在我们要上线了,我们需要能够使用 Azure Pipelines 来更改连接的 Key Vault。我无法确定通过管道执行此操作的简洁方法,有人有什么建议吗?

谢谢

【问题讨论】:

    标签: azure azure-pipelines azure-keyvault


    【解决方案1】:

    通过 Azure 管道更改连接的 Azure Key Vault

    您可以使用 Az CLI 通过以下命令更新 Azure CLI 任务:

    Update-AzKeyVault:

    Update-AzKeyVault
          -ResourceGroupName <String>
          -VaultName <String>
          [-EnablePurgeProtection]
          [-EnableRbacAuthorization <Boolean>]
          [-Tag <Hashtable>]
          [-DefaultProfile <IAzureContextContainer>]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]
    

    或者您可以使用 Set-AzKeyVaultSecret Az powershell cmdlet 在密钥保管库中创建和更新机密:

    Set-AzKeyVaultSecret -VaultName {keyVaultName} -Name 'MyAdminPassword' -SecretValue (ConvertTo-SecureString -String 'P@ssword!2' -AsPlainText -Force)
    

    【讨论】:

      猜你喜欢
      • 2019-08-11
      • 1970-01-01
      • 2020-02-09
      • 2019-02-06
      • 2023-02-01
      • 1970-01-01
      • 2021-12-22
      • 2020-01-06
      • 1970-01-01
      相关资源
      最近更新 更多