快速入门:使用 Azure CLI 创建密钥保管库Quickstart: Create a key vault using the Azure CLI

Azure Key Vault 是一项云服务,它为密钥机密证书提供了安全的存储。Azure Key Vault is a cloud service that provides a secure store for keys, secrets, and certificates. 有关 Key Vault 的详细信息,请参阅关于 Azure Key Vault;有关密钥保管库中可存储的内容的详细信息,请参阅关于密钥、机密和证书For more information on Key Vault, see About Azure Key Vault; for more information on what can be stored in a key vault, see About keys, secrets, and certificates.

如果没有 Azure 订阅,可在开始前创建一个试用帐户If you don't have an Azure subscription, create a trial account before you begin.

  • 本快速入门需要 Azure CLI 版本 2.0.4 或更高版本。This quickstart requires version 2.0.4 or later of the Azure CLI.

创建资源组Create a resource group

A resource group is a logical container into which Azure resources are deployed and managed. Use the az group create command to create a resource group named myResourceGroup in the chinanorth location.

az group create --name "myResourceGroup" -l "ChinaNorth"

创建密钥保管库Create a key vault

Use the Azure CLI az keyvault create command to create a Key Vault in the resource group from the previous step. You will need to provide some information:

  • Key vault name: A string of 3 to 24 characters that can contain only numbers (0-9), letters (a-z, A-Z), and hyphens (-)

    重要

    Each key vault must have a unique name. Replace with the name of your key vault in the following examples.

  • Resource group name: myResourceGroup.

  • The location: ChinaNorth.

az keyvault create --name "<your-unique-keyvault-name>" --resource-group "myResourceGroup" --location "ChinaNorth"

The output of this command shows properties of the newly created key vault. Take note of the two properties listed below:

  • Vault Name: The name you provided to the --name parameter above.
  • Vault URI: In the example, this is https://<your-unique-keyvault-name>.vault.azure.cn/. Applications that use your vault through its REST API must use this URI.

At this point, your Azure account is the only one authorized to perform any operations on this new vault.

清理资源Clean up resources

Other quickstarts and tutorials in this collection build upon this quickstart. If you plan to continue on to work with subsequent quickstarts and tutorials, you may wish to leave these resources in place.

When no longer needed, you can use the Azure CLI az group delete command to remove the resource group and all related resources:

az group delete --name "myResourceGroup"

后续步骤Next steps

在本快速入门中,你创建了一个 Key Vault 并将其删除。In this quickstart you created a Key Vault and deleted it. 若要详细了解 Key Vault 以及如何将其与应用程序集成,请继续阅读以下文章。To learn more about Key Vault and how to integrate it with your applications, continue on to the articles below.