你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Azure 托管 CCF(托管 CCF)是一项用于部署机密应用程序的全新且高度安全的服务。 有关 Azure 托管 CCF 的详细信息,请参阅关于 Azure 托管机密联盟框架。
如果没有 Azure 帐户,请在开始前创建一个免费帐户。
Azure CLI 用于通过命令或脚本创建和管理 Azure 资源。
先决条件
在 Azure Cloud Shell 中使用 Bash 环境。 有关详细信息,请参阅 Azure Cloud Shell 入门。
如需在本地运行 CLI 参考命令,请安装 Azure CLI。 如果在 Windows 或 macOS 上运行,请考虑在 Docker 容器中运行 Azure CLI。 有关详细信息,请参阅如何在 Docker 容器中运行 Azure CLI。
如果使用的是本地安装,请使用 az login 命令登录到 Azure CLI。 若要完成身份验证过程,请遵循终端中显示的步骤。 有关其他登录选项,请参阅 使用 Azure CLI 向 Azure 进行身份验证。
出现提示时,请在首次使用时安装 Azure CLI 扩展。 有关扩展的详细信息,请参阅 使用和管理 Azure CLI 中的扩展。
运行az version命令,以查看已安装的版本和依赖库。 若要升级到最新版本,请运行az upgrade。
- 本快速入门需要 Azure CLI 2.51.0 或更高版本。 如果使用 Azure Cloud Shell,则最新版本已安装。
- 运行 Windows 或 Linux 的计算机上的 OpenSSL 也是必需的。
创建资源组
资源组是在其中部署和管理 Azure 资源的逻辑容器。 使用 az group create 命令在 southcentralus 位置创建名为 myResourceGroup 的资源组。
az group create --name "myResourceGroup" --___location "SouthCentralUS"
创建成员
为成员生成密钥对。 以下命令完成后,成员的公钥保存在 member0_cert.pem
中,私钥保存在 member0_privk.pem
中。
openssl ecparam -out "member0_privk.pem" -name "secp384r1" -genkey
openssl req -new -key "member0_privk.pem" -x509 -nodes -days 365 -out "member0_cert.pem" -"sha384" -subj=/CN="member0"
创建托管 CCF 资源
使用 Azure CLI az confidentialledger managedccfs create 命令在上一步的资源组中创建托管 CCF 资源。 必须提供一些信息:
托管 CCF 名称:只能包含数字(0-9)、字母(a-z、A-Z)和连字符(-) 的 3 到 32 个字符的字符串
重要
每个托管 CCF 资源必须具有唯一的名称。 在以下示例中,将 <your-unique-managed-ccf-name> 替换为资源的名称。
资源组名称:myResourceGroup。
位置:中南部或西欧罗普。 默认值为 southcentralus。
成员:要添加到资源的初始成员的集合。 至少需要一个成员。
节点计数:资源中的节点数。 默认值为 3。
az confidentialledger managedccfs create --name "<your-unique-managed-ccf-name>" --resource-group "myResourceGroup" --___location "southcentralus" --members "[{certificate:'c:/certs/member0_cert.pem',identifier:'it-admin',group:'IT'},{certificate:'c:/certs/member1_cert.pem',identifier:'finance-admin',group:'Finance'}]"
查看以前创建的资源:
az confidentialledger managedccfs show --name "<your-unique-managed-ccf-name>" --resource-group "myResourceGroup"
若要列出 myResourceGroup 中的托管 CCF 资源,请执行以下操作:
az confidentialledger managedccfs list --resource-group "myResourceGroup"
列出订阅中的托管 CCF 资源:
az confidentialledger managedccfs list --subscription <subscription id or subscription name>
后续步骤
在本快速入门中,你使用 Azure 门户创建了托管 CCF 资源。 若要详细了解 Azure 机密账本以及如何将其与应用程序集成,请继续阅读以下文章: