It is more secure to store the secrets in Azure Key Vault.
How did you grant the Function reader role? Did you first enable a managed identity?
As for granting read access:
Confirm the authorization model being used with your Key Vault.
- For the older authentication policy model - https://learn.microsoft.com/en-us/azure/key-vault/general/assign-access-policy?tabs=azure-portal
- For the newer RBAC-based model - https://learn.microsoft.com/en-us/azure/key-vault/general/rbac-guide?tabs=azure-cli
The easiest ways to reference the secrets, is to use this syntax in your App Settings: @Microsoft.KeyVault(SecretUri=<url to your secret in key vault>).
See the entire reference on this here: https://learn.microsoft.com/en-us/azure/app-service/app-service-key-vault-references?tabs=azure-cli