I believe you’re referring to the steps outlined in this doc
Azure Communication Email client library for JavaScript - please do confirm.
As mentioned in the doc - You can also authenticate with Azure Active Directory using the Azure Identity library. To use the DefaultAzureCredential provider shown below, or other credential providers provided with the Azure SDK, please install the @azure/identity
package:
npm install @azure/identity
Bash: npm install @azure/identity
const { DefaultAzureCredential } = require("@azure/identity");
// DefaultAzureCredential expects the following three environment variables:
// - AZURE_TENANT_ID: The tenant ID in Azure Active Directory
// - AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant
// - AZURE_CLIENT_SECRET: The client secret for the registered application
const credential = new DefaultAzureCredential();
I understand you have already verified admin and contributor roles, if you haven’t checked, you may try to check the Azure portal to see if there are any other restrictions or policies that are preventing the user from accessing the resource.
Also, ensure Registration Provider (RP)** is registered.
--Azure Portal >> Select the subscription you want to use to register a resource provider >> under Settings select Resource providers
.
--To register a resource provider, select the resource provider and then select Register
Resource providers for Azure services
Kindly let us know how it goes, I'll follow-up with you further.