Thanks for reaching out on Microsoft Q&A, and we really appreciate your patience while we looked into this.
The external moderator’s answer is a great starting point, as they correctly identify that permissioning issues are the most likely cause of this error. Your assumption that the free plan is the issue is understandable, but it’s not the case Azure Key Vault functionality (including secret creation) is the same across all subscription tiers.
The error message "An error occurred while creating the secret" is generic and almost always points to missing permissions via Access Policies or Role-Based Access Control (RBAC). Here’s a step-by-step guide to help you resolve this:
1. Verify Access Policies
- In the Azure portal, open your Key Vault.
Go to Access policies.
Check your user account or managed identity: make sure Secret Permissions → Set is granted. If not, add it.
Documentation: Assign a Key Vault access policy
2. Use Azure CLI for Detailed Errors
Portal errors are vague, but CLI provides clarity. Try:
az keyvault secret set --vault-name "YourVaultName" --name "YourSecretName" --value "YourSecretValue"
If permissions are missing, you’ll see a specific error like "Operation 'Set' is not permitted".
Documentation: az keyvault secret set
3. Check RBAC Role Assignments
If your vault uses RBAC instead of access policies:
- Go to Access control (IAM) in your vault.
- Check that your account has a role like Key Vault Administrator or Key Vault Secrets Officer.
Note: The Contributor role only manages the vault resource it does not grant data-plane access to create or read secrets.
Documentation: Assign Azure roles for Key Vault access
Summary: The free plan is not blocking secret creation. The most likely cause is missing “Set” permissions on the data plane, either through Access Policies or RBAC. Correcting these should resolve the issue. We hope this clarifies the cause and helps you create your secret successfully.
Please let us know if these steps help. Thank you!