ecLearn - Learning Management System built on top of Microsoft Dataverse for Power Platform and Dynamics 365 users

ENGINEERED CODE BLOG

Version 1.2018.2.14 of XrmToolBox Plugin for the Online Management API Released

Since we were so close, we decided to finish off adding support for the entire Online Management API to our XrmToolBox Plugin. We’ve actually released two versions recently: one with the new features, and then another one fixing a bug we had introduced with the new features.

Viewing Instance Type Info

While we were already using the GetInstanceTypesInfo operation to determine if licenses were available to provision a new instance, we figured it would be handy to be able to see that information whenever you wanted. So we’ve added a button that will display how many of each type of instance are licensed, and how many are consumed.

Managing Tenant Application Identities

This is a good news/bad news situation. The good news is that the plugin now allows you to manage Tenant Application Identities, including viewing, creating, deleting, enabling and disabling. The bad news is, right now we have no idea what they are for.

The documentation says that a “tenant application identity enables you to authorize an app on your behalf by using server-to-server (S2S) authentication to perform operations on Customer Engagement instances”. So that leads us to believe they are related to server-to-server authentication.

Typical S2S authentication for Dynamics 365 requires someone to setup an application in Azure AD and then, by using that application, you are able to create a special user in the CRM. We had thought that maybe this API would do this for us, however that doesn’t seem to be the case.

Creating a Tenant Application Identity involves two main inputs: the Azure AD Application ID and the Tenant ID. So my next thought was perhaps it allows you to use S2S authentication for the Online Management API itself, but I can’t find anything regarding how to use the Tenant Application Identity once it’s created.

So at this point we’re not sure if they are to help setup the S2S authentication for the Dynamics 365 organizations, or for S2S authentication with the Online Management API, or something completely different. If anyone happens to know what tenant application identities are used for, at least they can now manage them in the XrmToolBox (and please, share with us in the comments below)!

Bug Fix

We ran into an interesting issue when leveraging the WorkAsync features of the PluginControlBase class that all XrmToolBox plugins use. This features allows us to perform operations on a background thread while displaying the familiar “Working…” message with the spinner. WorkAsync is used as follows:

WorkAsync(new WorkAsyncInfo
{
	Work = (worker, args) =>
	{
		// do work in background thread and show "Working..." spinner 
	},
	PostWorkCallBack = (args) =>
	{
		// do work after background thread work is done
	}
});        

We are using this in a few places, including when displaying a form containing a grid of existing Tenant Application Identities. The error we ran into occurred when selecting a cell and using Ctrl-C to copy the contents of the cell; the exception messages was: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.

In our case, the code that called ShowDialog on the popup form was in the Work function; when we moved that code into the PostWorkCallback, the error went away. I believe this is because the PostWorkCallback function runs on the main UI thread, as opposed to a background thread.

What’s Next?

Nothing! We’ve covered what’s available in Version 1, so unless we get any reports of bugs, or requests for new ways to use the existing API operations, we’ll be waiting patiently for Version 2 (or 1.1, or whatever they decide to call it).

**Update**

We just released version 1.2108.2.19 today… it includes the ability to restore a backup to any sandbox instance within the tenant, not just the instance from which it was created.

One response to “Version 1.2018.2.14 of XrmToolBox Plugin for the Online Management API Released”

  1. […] post Version 1.2018.2.14 of XrmToolBox Plugin for the Online Management API Released appeared first on Engineered […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact

Engineered Code is a web application development firm and Microsoft Partner specializing in web portals backed by Dynamics 365 & Power Platform. Led by a professional engineer, our team of technology experts are based in Regina, Saskatchewan, Canada.