Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Could not load file or assembly 'Azure.Identity, Version=1.12.0.0, or one of its dependencies.

Posted on by
I am trying to send an Queue message in Azure Service Bus using Plugin. I am able to send message using Service Endpoint and using Plugin in which,

First method: Working in Plugin.
    Using Primary Connection with SASKey as authentication.
    
    var client = new ServiceBusClient("PrimaryConnectionString");
 
Second method: Not working in plugin due to Azure.Identity has dependency issues. Working in Console App.
    Using Azure.Identity library.
        
  1.     1st Method using Identity library. (Working in Console App.)
        var client = new ServiceBusClient(fullyQualifiedNamespace, new DefaultAzureCredential());
        
          2.      2nd Method using Identity library. (Working in Console App.)
        var client = new ServiceBusClient(fullyQualifiedNamespace, new AzureNamedKeyCredential("RootManageSharedAccessKey", key: "keyValue"));
        
          3.      3rd Method using Identity library. (Working in Console App.)
        PreRequisite:
            1) In Azure Service Bus IAM (Access Control) give a role of Service Bus Data Sender to an registered App (Customer Service MDA) in Entra.
            2) In Entra open API Permissions of an registered app to add a permission of Microsoft.ServiceBus.
            3) ClientID, TenentID, ClientSecret.
        var client = new ServiceBusClient(fullyQualifiedNamespace, new ClientSecretCredential(tenantId, clientId, clientSecret));
        
Third method: Working in plugin.
    Using Microsoft Authentication and getting an access token using that token to Consume an API.
    
    PreRequisite:
        1) In Azure Service Bus IAM (Access Control) give a role of Service Bus Data Sender to an registered App (Customer Service MDA) in Entra.
        2) In Entra open API Permissions of an registered app to add a permission of Microsoft.ServiceBus.
        3) ClientID, TenentID, ClientSecret.
 

I am trying to use this 2nd method's 3rd method to send an queue message by registering Plugin.
3rd Method using Identity library. (Working in Console App.)
        PreRequisite:
            1) In Azure Service Bus IAM (Access Control) give a role of Service Bus Data Sender to an registered App (Customer Service MDA) in Entra.
            2) In Entra open API Permissions of an registered app to add a permission of Microsoft.ServiceBus.
            3) ClientID, TenentID, ClientSecret.
        var client = new ServiceBusClient(fullyQualifiedNamespace, new ClientSecretCredential(tenantId, clientId, clientSecret));
 
I have registered an app in AAD(Entra) also added that app in Service Bus IAM as a Data Owner by using this ref, instead of Postman I am using Plugin and it is working in Console app too but not working in Plugin. This plugin I am triggering using an Action and this action getting called by a Button. In plugin trace log I am getting only one error, Could not load file or assembly 'Azure.Identity, Version=1.12.0.0, or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. I have tried to modify .csproj, app.config and packages.config file too as per online suggestions but none was affected.
 
Error Image
 
PSA. I have created a trial azure account which has a same Email ID which is signed in Entra, D365 CRM and Visual Studio. All are signed in by one account also I have given permission to one more personal email id which is also not working.

Config of an Assembly,
.NET targeting framework: 4.7.1
.NET standard not core
.dll file.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans