The correct command uses az keyvault create with parameters --name, --resource-group, and --location.
Step 2: Compare options
az keyvault create --name MyVault --resource-group MyGroup --location eastus matches the correct syntax exactly. The other options use incorrect commands like az keyvault new or az vault create, or wrong parameter names like --vault-name, --group, or --vault.
Final Answer:
az keyvault create --name MyVault --resource-group MyGroup --location eastus -> Option C
Hint: Use 'az keyvault create' with --name, --resource-group, --location [OK]
Common Mistakes:
Using 'az keyvault new' instead of 'create'
Wrong parameter names like --vault or --group
Confusing 'vault' and 'keyvault' commands
3. Given this Azure CLI command sequence: az keyvault secret set --vault-name MyVault --name ApiKey --value "12345" What will be the result when you run az keyvault secret show --vault-name MyVault --name ApiKey?
medium
A. It will display the secret value "12345" along with metadata
B. It will return an error because secrets cannot be retrieved
C. It will show an empty secret value
D. It will delete the secret named ApiKey
Solution
Step 1: Understand secret creation and retrieval
The first command stores a secret named ApiKey with value "12345" in MyVault. The second command retrieves that secret.
Step 2: Predict the output of secret show command
The show command returns the secret's value and metadata. It does not delete or error unless permissions are missing.
Final Answer:
It will display the secret value "12345" along with metadata -> Option A
Quick Check:
Secret show returns stored value [OK]
Hint: Secret show command retrieves stored secret value [OK]
Common Mistakes:
Thinking secrets cannot be retrieved
Expecting deletion on show command
Assuming empty value if not specified
4. You run this command to create a certificate in Azure Key Vault: az keyvault certificate create --vault-name MyVault --name MyCert --policy @policy.json But you get an error saying the policy file is invalid. What is the most likely cause?
medium
A. The JSON file policy.json has syntax errors or incorrect structure
B. The vault name MyVault does not exist
C. The certificate name MyCert is already in use
D. The Azure CLI is not installed
Solution
Step 1: Analyze the error message about invalid policy file
The error points to the policy file being invalid, which usually means JSON syntax or structure issues.
Step 2: Consider other options
While vault existence or name conflicts cause errors, the message specifically mentions the policy file. CLI installation issues would prevent any command from running.
Final Answer:
The JSON file policy.json has syntax errors or incorrect structure -> Option A
Quick Check:
Invalid policy file = JSON syntax error [OK]
Hint: Check JSON file syntax if policy error occurs [OK]
Common Mistakes:
Ignoring JSON syntax errors
Assuming vault or name issues without checking file
Not validating JSON before use
5. You want to automate deployment of an Azure Key Vault with a certificate and restrict access so only a specific app can use the certificate. Which combination of steps is best practice?
hard
A. Create Key Vault; disable all access policies; share certificate via email
B. Create Key Vault with access policies granting the app permission; upload certificate; avoid storing secrets in code
C. Create Key Vault; upload certificate; embed certificate value directly in app code
D. Create Key Vault; store certificate value as a secret; give all users access to the vault
Solution
Step 1: Securely create Key Vault and upload certificate
Create the vault and add the certificate properly to keep it safe and managed.
Step 2: Set access policies to restrict usage to the specific app and avoid secrets in code
Grant only the app needed permissions and never put secrets or certificates directly in code to prevent leaks.
Final Answer:
Create Key Vault with access policies granting the app permission; upload certificate; avoid storing secrets in code -> Option B
Quick Check:
Restrict access + no secrets in code = Create Key Vault with access policies granting the app permission; upload certificate; avoid storing secrets in code [OK]
Hint: Use access policies and never embed secrets in code [OK]