web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Azure aware plugin

(0) ShareShare
ReportReport
Posted on by 177

Hi,

I am trying to connect CRM and azure.  I have registered service bus endpoint and step in it. I have also deployed my two way listener on azure cloud.

But I don't understand how can I  register azure aware plugin dll  the way we do it in assembly ?

Thanking you in anticipation

Regards,

Nirmal

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Bas van de Sande Profile Picture
    4,383 on at

    Hi,

    have you checked the resources at MSDN?

    msdn.microsoft.com/.../gg334438.aspx

    At this page you can find a couple of really good samples

    The idea is that once the endpoint is registered and the two way listener is present, that you can send messages over this remote execution context to the listener. The listener will be able to run using the CRM context (giving it access to all its internals).

    The way to trigger the listener, is by sending an organizationrequest containing with the name of the message. The end point registration in the plugin registration tool will forward the message to the listener (which is listening at the endpoint)

    I hope this will help you

    Bas

  • Nirmal_CRM Profile Picture
    177 on at

    Hi,

    I registered service endpoint and I also deployed my two way listerner. But while testing I am getting below error in system job,

    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.

    Could you please help me out ?

  • Bas van de Sande Profile Picture
    4,383 on at

    Hi,

    looks like you have to add some credentials with the httprequest.

    please check the sample provided

        // Create the shared secret credentials object for the endpoint matching the

               // Azure access control services issuer

               var sharedSecretServiceBusCredential = new TransportClientEndpointBehavior()

               {

                   TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerKey)

               };

               // Using an HTTP binding instead of a SOAP binding for this endpoint.

               WS2007HttpRelayBinding binding = new WS2007HttpRelayBinding();

               binding.Security.Mode = EndToEndSecurityMode.Transport;

               // Create the service host for Azure to post messages to.

               ServiceHost host = new ServiceHost(typeof(TwoWayEndpoint));

               host.AddServiceEndpoint(typeof(ITwoWayServiceEndpointPlugin), binding, address);

               // Create the ServiceRegistrySettings behavior for the endpoint.

               var serviceRegistrySettings = new ServiceRegistrySettings(DiscoveryType.Public);

               // Add the service bus credentials to all endpoints specified in configuration.

               foreach (var endpoint in host.Description.Endpoints)

               {

                   endpoint.Behaviors.Add(serviceRegistrySettings);

                   endpoint.Behaviors.Add(sharedSecretServiceBusCredential);

               }

    you see in the code above that the credentials are attached to each endpoint specified in the configuration

    Bas

  • Nirmal_CRM Profile Picture
    177 on at

    Hi,

    Which credential  ? CRM or azure credential ?

    I do not understand it properly, Could you please elaborate . Below is my error details;

    Plugin Trace:

    [Microsoft.Crm.ServiceBus: Microsoft.Crm.ServiceBus.ServiceBusPlugin]

    [def593ca-98d5-e511-8b77-005056905eb4: CRMAzure: Create of contact]

    Error Message:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.Detail:

    <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance&quot; xmlns="schemas.microsoft.com/.../Contracts&quot;>

     <ErrorCode>-2147204747</ErrorCode>

     <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

     <Message>The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.</Message>

     <Timestamp>2016-02-18T13:37:33.211656Z</Timestamp>

     <InnerFault>

       <ErrorCode>-2147220970</ErrorCode>

       <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

       <Message>The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.</Message>

       <Timestamp>2016-02-18T13:37:33.211656Z</Timestamp>

       <InnerFault>

         <ErrorCode>-2147220970</ErrorCode>

         <ErrorDetails xmlns:d4p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

         <Message>The remote server returned an error: (401) Unauthorized.</Message>

         <Timestamp>2016-02-18T13:37:33.211656Z</Timestamp>

         <InnerFault i:nil="true" />

         <TraceText i:nil="true" />

       </InnerFault>

       <TraceText i:nil="true" />

     </InnerFault>

     <TraceText>[Microsoft.Crm.ServiceBus: Microsoft.Crm.ServiceBus.ServiceBusPlugin]

    [def593ca-98d5-e511-8b77-005056905eb4: CRMAzure: Create of contact]

    </TraceText>

    </OrganizationServiceFault>

      at Microsoft.Crm.ServiceBus.RouterService.ExecuteInternal(RemoteExecutionContext context, ServiceBusEndpointInformation endpointInfo)

      at Microsoft.Crm.ServiceBus.ServiceBusService.Dispatch(ServiceBusEndpointInformation endpointInfo, IExecutionContext context)

      at Microsoft.Crm.ServiceBus.ServiceBusService.PostInternal(String assemblyName, EntityReference serviceEndpoint, Boolean validateOnly, IExecutionContext context)

      at Microsoft.Crm.ServiceBus.ServiceBusPlugin.Execute(IServiceProvider serviceProvider)

      at Microsoft.Crm.Asynchronous.V5ProxyPlugin.Execute(IServiceProvider serviceProvider)

      at Microsoft.Crm.Asynchronous.EventOperation.InvokePlugin(AsyncExecutionContext context, IPlugin pluginInstance)

    Regards,

    Nirmal

  • Bas van de Sande Profile Picture
    4,383 on at

    Hi Nirmal,

    you need to use the Azure credential.

    Bas

  • Nirmal_CRM Profile Picture
    177 on at

    Hi Bas,

    My CRM Listener is already deployed on Azure. And I have enabled my anaonymas setting in IIS.  So I have kept my security mode as Basic. Hence I do not understand to reason to give Azure credentials in CRMListener which is already deployed to Azure. Please clarify...

    Am I missing anything ? Please clarify how can i solve this ?

    Thanking you in anticipation.

    Regards,

    Nirmal

Under review

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

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans