Share via


快速入門:使用 Azure CLI 建立 Azure 受控 CCF 資源

Azure 受控 CCF (受控 CCF) 是部署機密應用程式新型且高度安全的服務。 如需 Azure 受控 CCF 的詳細資訊,請參閱關於 Azure 受控機密聯盟架構

如果您沒有 Azure 訂用帳戶,請在開始之前先建立 Azure 免費帳戶

Azure CLI 可供使用命令列或指令碼來建立和管理 Azure 資源。

必要條件

  • 本快速入門需要 2.51.0 版或更新版本的 Azure CLI。 如果您是使用 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 名稱:由 3 到 32 個字元組成的字串,只能包含數字 (0-9)、字母 (a-z、A-Z) 和連字號 (-)

    重要

    每個受控 CCF 資源都必須有唯一的名稱。 在下列範例中,將 <your-unique-managed-ccf-name> 取代為您資源的名稱。

  • 資源群組名稱:myResourceGroup

  • 位置:southcentralus 或 westeurope。 預設值為 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 機密總帳及如何與應用程式整合,請繼續閱讀下列文章: