OData client for MSDyn365FO in combination with Azure Functions

Referring to one of my previous posts, where I described how to create an OData client for Microsoft Dynamics 365 for Finance and Operation, I now want to show you, how to use this client with an Azure Function. The problem with the previously shared solution is that you’re not able to use a temporary file for the client when running an Azure Function, because you do not have access to the file system. The solution for this problem is to reduce the client to the entities you need, to reduce the size of the client.

First you need to get the metadata XML as desired in my previous posts. Next you have to find out which entities you need. Then you’re ready to put both information into the C# tool you can find in the following repository: ODataClientXmlFiltering

The result of executing the C# tool is a “reduced” metadata XML that you can use to generate an OData client without a temporary file.

Please note that the tool in the current state removes all OData actions from the metadata XML. If you´re having a smarter solution feel free to send me a pull request.

Now you’re thinking why should I use an OData client in an Azure Function? My real life example is a monitor feature, where we´re checking the response time of the OData interface and writing the results to an Azure SQL database, to visualize this in PowerBI. To get a feeling what’s possible you can see the results in the banner of this post.

Update:

Ievgen Miroshnikov posted a hint to a “smarter” solution, to “reduced” the metadata XML, on Twitter which has been shared by Shashi Sadasivan. You can find the solution on GitHub: https://github.com/shashisadasivan/EDMXTrimmer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s