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.
- 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.
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.