Hi @Lior ,
Thanks for using Microsoft Q&A !!
If you are running from your local development environment then the code try to access Azure key vault using developer context and not the managed identity (which is available in Azure) and thus you are getting this error as you need to grant yourself(or the user you are using to access the key vault) permissions to access the key vault to test in your local environment.
Please try running the same after deploying it to Azure app service. You can also refer to this Python sample to get the steps to test your code in your local environment without using managed identity. This code use function get_key_vault_credentials to use the environment variables if MSI Authentication is unsuccessful.
Please let me know if you have any other questions.
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.