I always get An error occurred while creating the secret'

Gab 5 Reputation points
2025-07-29T23:22:31.4+00:00

Whenever I try to make a Vault Key Secret the following error occurs "An error occurred while creating the secret". Nothing is saved in the logs, i tried to delete the Vault and try to make the Secret again. The same error. Tried using different names, even change the value. Same error again.

Is it because I use the free plan that I can not generate that Secret?

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
{count} votes

2 answers

Sort by: Most helpful
  1. hossein jalilian 11,905 Reputation points Volunteer Moderator
    2025-07-29T23:53:15.9966667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    To resolve it, check your permissions in Access Control or Access Policies, and verify that any managed identities have “Set” rights. Testing secret creation via Azure CLI can reveal more details. If permissions cannot be adjusted due to subscription restrictions, upgrading to a standard or trial plan may be necessary.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

  2. Anurag Rohikar 600 Reputation points Microsoft External Staff Moderator
    2025-08-20T07:32:36.7066667+00:00

    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!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.