Hello Jérôme Piquot,
You are receiving this error because the required RBAC role has not been assigned to the Microsoft Azure App Service resource provider.
To allow the App Service to read the certificate from Key Vault, you need to authorize the App Service by assigning it the “Key Vault Certificates User” role. Once this role is assigned, the Key Vault will grant the App Service permission to read the certificate secret.
Please follow the steps below to resolve the issue:
Retrieve the Object ID of Microsoft Azure App Service:
- Sign in to the Azure portal.
- Navigate to Microsoft Entra ID > Enterprise applications.
- Remove the filter “Application type = Enterprise applications”.
- Search for “Microsoft Azure App Service”.
- Copy the Object ID shown for this application.
Note: The Object ID is unique to each tenant, although the App ID remains the same across all tenants.
Assign the Key Vault Certificates User role:
- Go to your Key Vault resource.
- Select Access control (IAM) > + Add > Add role assignment.
- Search for the role “Key Vault Certificates User” and click Next.
- Under the Members tab, select + Select members and paste the Object ID you copied earlier.
- Select the displayed application, then click Select > Review + Assign.
After the role assignment, the Microsoft Azure App Service will have the necessary permissions to use the Key Vault certificate.