An Azure key vault named exam-answer exists in your company's cloud subscription. You want to store a password in the key vault. The password is S3449PT!@90Q. The name of the entry should be ApplicationPassword. The password should not be stored as plain text.
You need to use PowerShell to store the password in the key vault.
How should you complete the cmdlets? Select correct placeholder values.
$value = PLACEHOLDER 1 'S3449PT!@90Q' -PLACEHOLDER 2 -Force
PLACEHOLDER 3 -VaultName 'exam-answer' -Name 'ApplicationPassword' -PLACEHOLDER 4 $value
You should use the following cmdlets:
$value = ConvertTo-SecureString 'S3449PT!@90Q' -AsPlainText -Force
Set-AzureKeyVaultSecret -VaultName 'exam-answer' -Name 'ApplicationPassword' -SecretValue $value
The ConvertTo-SecureString cmdlet converts a plain text value into a secure (encrypted) string. This meets the requirement of the password not being stored as plain text. The first parameter to this cmdlet is the string to convert. The -AsPlainText parameter indicates that the string to convert it plain text. The -Force parameter must be used when -AsPlainText is used to verify that you understand the implications of using -AsPlainText.
The Set-AzureKeyVaultSecret cmdlet stores the password in the key vault with the name specified as the -Name parameter. The -SecretValue parameter specifies the secret. In this scenario, the secret is the encrypted password.
You should not use Add-AzureKeyVaultKey. This cmdlet generates a software or hardware key and saves it in a key vault. In this scenario, you need to store a known secret, not generate a key.