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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom Azure Service Bus messages from CRM plugin

(0) ShareShare
ReportReport
Posted on by 216

Hi,

I'd like to send custom messages to Azure Service Bus from an MS CRM plugin. By "custom" I mean I want control over the message contents. I know that, in general, it's possible to send messages registering a service endpoint, but this ends up sending a serialized "RemoteExecutionContext" which is not what I'm looking for.

My first attempt was to simply load up the WindowsAzure.ServiceBus nugget into the project and use that (along with ILmerging the new assembly). This only works in an on-premise setting however - attempting to use the same code in a sandbox plugin environment ends up with a "That assembly does not allow partially trusted callers" error (I don't know how exactly the WindowsAzure.ServiceBus library works, but apparently the CRM sandbox doesn't like it).

There's the whole Azure REST API as well, but using it seems like an incredible hassle and overkill for sending a simple message to a Service Bus. Are there any ways to solve this? Again, the default method CRM does isn't ideal in my case, as I want to have full control over the contents that will be sent to Service Bus.

*This post is locked for comments

I have the same question (0)
  • Mani M Profile Picture
    on at

    Hi,

    Did you ever get this resolved?

    I have the same scenario and I get the  Unable to load plug-in assembly error when I try to register the Assembly.

    Regards,

    Manish

  • Verified answer
    MateuszBender Profile Picture
    216 on at

    Yeah, I wrote a custom REST API for Azure SBus. Alas, no ready made code for that.

  • Mani M Profile Picture
    on at

    That is great. Would you be able to share a sample or provide a link for reference?

  • Verified answer
    MateuszBender Profile Picture
    216 on at

    Alas, I can't share the classes I created for obvious reasons. But, I can say I used this as a starting point: code.msdn.microsoft.com/Service-Bus-HTTP-client-fe7da74a

    Do note, that for some reason, I could not get this code to work reliably to RECEIVE messages from Service Bus. But, if all you need to do is to SEND messages, then the above should work fine. Also to note - the MS Service Bus NuGet uses a BinaryXmlSerializer underneath to handle messages, so if you want to keep using that on your receiving application, then you need to also use this serializer when preparing messages to send via the REST API.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans