Mocking the Dataverse

We use D365 CE and what used to be called the Common Data Service, and is now called the Dataverse.

Specifically, we want to send many thousands of updates through the API from a service bus. The Dataverse has various API quota and rate limiting which interfere with this plan.

As most of our D365 CE installation was created by contractors, apparently with no oversight whatsoever, it is boasts a horrific architecture.

Updating anything leads to a long chain of synchronous plugins and workflows, which then flows, synchronously, across to D365 Fin & Ops, and back again. This takes time, and very often hits every rate limit or quota its possible to hit with any kind of load over a couple of thousand updates.

Despite this, its necessary, for business reasons, for it to handle several thousand updates every night, within 15 mins. The update system provided by our contractors does not do this and also manages to lose a significant percentage of updates along the way.

I think it would be handy to have a mock system we can use that will replicate the rate limiting and quotas and produce the large number of errors produced by the real system.

It would be handy if it recorded what errors it produced, to tally against what the update system reported and the volume of updates processed along with the time it took.

With this, we can test alternative systems easily to ensure they are not unnecessarily slow, not losing updates and reporting all errors correctly.

Dataverse REST API

Th Dataverse has an ODATA 4.0 Rest API. There are probably already tools which can mock this, but as this is a lock down holiday project I decided not to look at them and make my own instead.

Tools

I wanted to use Azure Functions, since the system providing the updates is primarily a service bus and Azure Functions and I wanted to get acquainted with Azure Durable Functions, if I can find any way to crowbar them into my solution.

I was tempted to write this in Go, as I want to learn more about that and I might yet do this.

I have used Azure Functions for the web service and Terraform and a DevOps pipeline for deployment.

tbc …