Thank you for your post!
Error Message:
The operation is not allowed by RBAC. If role assignments were recently changed, please wait several minutes for role assignments to become effective.
I understand that you're trying to create a Key Vault Secret from your C# console app, and when trying to create the Secret within the Portal you're running into the error above. In order to resolve your issue from the Portal, you'll have to ensure that your user has the correct Key Vault RBAC permissions to create the Key Vault Secret.
- Go to your Key Vault or the Resource Group that contains your vault.
- Select Access control (IAM).
- Select View my access. You can also select the Role assignments tab to find your user's KV permissions.
- Ensure you have the Key Vault Secrets Officer or Key Vault Administrator role assigned to your user.
For more info - Azure built-in roles for Key Vault data plane operations
Please note that it will take up to 10 minutes (600 seconds) after role assignments is changed for role to be applied.
For more info.
Error:
KeyVaultErrorException: Operation returned an invalid status code 'NotFound'.
To hopefully help troubleshoot your C# Console app error, it looks like your error message is referring to the specified resource not being found. For more info - Common error codes for Azure Key Vault. To gain a better understanding of your console app, can you share the documentation you followed to set this up?
Additional Link:
I hope this helps!
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.