Hello @Bela Vista UK,
Thank you for posting your query on Microsoft Q&A.
Based on your description, it seems you are trying to set or update a secret in KeyVault using the AZ CLI command "az keyvault secret set --name MySecretName --vault-name MyKeyVault --value MyVault"
but encountered an error stating, "Secret 'MySecretName' was disallowed by policy."
To assist you further, could you confirm if you are able to set the secret directly from the Azure Portal?
I have tested setting up a secret from both the Azure Portal and the AZ CLI command successfully. Given the error, it appears that an Azure Policy definition is being enforced on this operation: "providers/Microsoft.Authorization/policyDefinitions/342e8053-e12e-4c44-be01-c3c2f318400f"
.
Please check if the Azure Policy with ID 342e8053-e12e-4c44-be01-c3c2f318400f
is enabled, and review the available effects and default values configured for that policy. Adjusting these settings may resolve the restriction on setting the secret.
Thanks,
Raja Pothuraju.