Add-AzServiceFabricManagedNodeTypeVMSecret
將憑證密碼新增至節點類型。
語法
Add-AzServiceFabricManagedNodeTypeVMSecret
[-InputObject] <PSManagedNodeType>
-SourceVaultId <String>
-CertificateUrl <String>
-CertificateStore <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-AzServiceFabricManagedNodeTypeVMSecret
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-Name] <String>
-SourceVaultId <String>
-CertificateUrl <String>
-CertificateStore <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
將憑證密碼新增至節點類型。 秘密必須儲存在 Azure Key Vault 中。 如需 Key Vault 的詳細資訊,請參閱什麼是 Azure Key Vault? (https://azure.microsoft.com/en-us/documentation/articles/key-vault-whatis/)。 如需 Cmdlet 的詳細資訊,請參閱 Microsoft 開發人員網路連結庫或 Set-AzKeyVaultSecret Cmdlet 中的 Azure Key Vault Cmdlets (/powershell/module/az.keyvault/)。
範例
範例 1
$rgName = "testRG"
$clusterName = "testCluster"
$NodeTypeName = "nt1"
Add-AzServiceFabricManagedNodeTypeVMSecret -ResourceGroupName $rgName -ClusterName $clusterName -NodeTypeName $NodeTypeName -SourceVaultId /subscriptions/XXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/testRG/providers/Microsoft.KeyVault/vaults/testkv -CertificateUrl https://testskv.vault.azure.net:443/secrets/TestCert/xxxxxxxxxxxxxxxxxxxxxxxx -CertificateStore My -Verbose
這個逗號會從指定的keyvault和秘密標識元新增憑證密碼。
範例 2
$rgName = "testRG"
$clusterName = "testCluster"
$NodeTypeName = "nt1"
$nodeType = Get-AzServiceFabricManagedNodeType -ResourceGroupName $rgName -ClusterName $clusterName -Name $NodeTypeName
$nodeType | Add-AzServiceFabricManagedNodeTypeVMSecret -SourceVaultId /subscriptions/XXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/testRG/providers/Microsoft.KeyVault/vaults/testkv -CertificateUrl https://testskv.vault.azure.net:443/secrets/TestCert/xxxxxxxxxxxxxxxxxxxxxxxx -CertificateStore My -Verbose
這個逗號會使用管線,從指定的keyvault和秘密標識元新增憑證密碼。
參數
-AsJob
在背景執行 Cmdlet,並傳回作業以追蹤進度。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-CertificateStore
指定應該新增憑證之虛擬機上的證書存儲。 指定的證書存儲隱含在 LocalMachine 帳戶中。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-CertificateUrl
這是已上傳至 Key Vault 做為秘密之憑證的 URL。 如需將秘密新增至 Key Vault,請參閱 [將密鑰或秘密新增至金鑰保存庫](https://learn.microsoft.com/azure/key-vault/key-vault-get-started/#add)。 在此情況下,您的憑證必須是以 UTF-8 編碼的下列 JSON 物件的 Base64 編碼:<br><br> {<br> “data”:“<Base64 編碼憑證>”,<br> “dataType”:“pfx”,<br> “password”:“<pfx-file-password>”<br>}/
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ClusterName
指定叢集的名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-InputObject
節點類型資源
類型: | PSManagedNodeType |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Name
指定節點類型的名稱。
類型: | String |
別名: | NodeTypeName |
Position: | 2 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ResourceGroupName
指定資源群組的名稱。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-SourceVaultId
包含憑證的 Key Vault 資源識別碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |