GitHub Self-Hosted Runner inside a container

EDIT (02/03/2021): You can use tmate action inside a Windows runner.

If you are using GitHub Actions, you have four choices for the runner:

  1. Windows Runner
  2. Ubuntu Runner
  3. MacOS Runner (Preview)
  4. Self-Hosted Runner

GitHub Actions for Microsoft Power Platform support only Windows Runner (as of Dec 2020). If you are building some workflows using the GitHub hosted runner, the only way you can troubleshoot the workflow is by using the logs, that can be turned on using the ACTIONS_RUNNER_DEBUG and ACTIONS_STEP_DEBUG environment variables.

You cannot use act or tmate because you are using Windows Runner. One way to work around the jam is to use self-hosted runner, if you are troubleshooting the Action. Rather than configuring the runner on your local machine, what if you could run it inside a container? This way you can run multiple runners on the same machine, all using the same underlying Windows Servercore image.

You need to install the following in your local machine:

  1. Docker Desktop
  2. VSCode
  3. Docker Extension for VSCode

During or after installation of Docker, switch to Windows Container, rather than Linux containers, as we need to use the Windows Servercore image. Now, clone this repo on your local machine. Next, go to and create a Personal Access Token with repo scope.

Personal Access Token

Once you have the token, you can run the runner-setup PowerShell script to create the environment file for the container that has the repo url where the Actions with self-hosted runner will run, and the personal access token required to connect to the GitHub API.

PowerShell to configure env file

Now run docker-compose up –build and you should see the container being built and started with the GitHub Runner.

Building the container
Actions Runner

You should now be able to see the runner on the repo that you setup the env file for.

Now let us create a new workflow that utilises the self-hosted runner. The key this here is to mention the self-hosted runner on “runs-on”.

Sample Workflow

Since this workflow uses workflow_dispatch trigger, you can run it manually. If you now run the workflow, you should start see the logs appear on the container’s console.

Action Logs

With the latest version of the Docker extension for VSCode, you can also explore the container’s file system, which is quite handy, in case you want to inspect the artifacts produced by the workflow.

Exploring container’s file system

I hope this tip will help you when you are stuck building workflows with Power Platform Actions.

Automating PCF Build using GitHub Actions

Guido runs a great site called where there are over 200+ PCF components. The components on the site are hosted on GitHub and have solutions that can be installed on CDS. Some components have managed solution, some have unmanaged, and some have both. Since lot of the components are open-source and are hosted in GitHub, I thought it would be good to automate this using GitHub Actions and ensure every component has both managed and unmanaged solutions.

GitHub Actions is similar to Azure DevOps. If you want to know more about GitHub Actions and how it compares to Azure DevOps, listen to DevOps and GitHub Actions with Edward Thomson on Hanselminutes. I created a starter repo with a workflow yml that anyone can use in their PCF repo hosted on GitHub. You can access this repo on

In order to use this workflow on your repo do these steps:

  1. Clone this repo and copy the .github folder from the cloned repo into the root of your repo.
  2. Update the msbuildtarget environment variable on the yml to point to the folder with the “Other” folder. This folder would have been created when you ran the “pac solution init” command.PCF YAML
  3. The “Other” folder will have the xml files that will be packaged up into the solution.PCF Other
  4. Make sure that you update the value for “SolutionPackageType” on your cdsproj file to “Both”, so that the Solution Packager can build both Managed and Unmanaged Solutions.cdsproj

Once you make these changes commit the changes to your repo. The build command will run everytime you commit something to the repo. You can download the managed and unmanaged solutions from the artifact area on the build.

PCF Build

Once you are ready to release the solutions, tag the commit using “git tag”. If the tag is in this format: v* e.g. v1.0, v.1.0.0 etc., the workflow will run the Release steps, which will create a new release and add both the managed and unmanaged solutions to the release.

PCF Release

PCF Release TagPCF Releases

Both the Solution Name and the Solution Version will be picked up from the Solution.xml file, so as you release new versions, make sure you update this information on the file.

I hope this makes it little easier to automate your PCF builds and releases on GitHub.



XrmToolBox Tool: Entity Image Updater

Around middle of last week, I published v1.0 of a new XrmToolBox tool called Entity Image updater. I created this tool so that it is easier to update the images on the crm record, if that entity has an image field.

When an entity has an image field and no image has been uploaded, it displays the default person image next to the primary name label.


You can upload an image, by clicking the person image and choosing a local file.

UploadImageOnce the image is upload, the form looks much nicer IMHO.

AfterImageEven though this capability exists, not many people seem to use this because:

  1. You need source the images
  2. Manually upload them one by one OR write code to upload them based on some conditions

There are so many APIs available to retrieve this data. The most useful of these APIs for this task are

  1. Clearbit – Retrieve logo based on an organisation URL
  2. Twitter – Retrieve logo based on a Twitter handle
  3. Gravatar – Retrieve logo based on a person’s email. This works only if this person has a Gravatar profile

We can try to first source the logo/avatar from these APIs, and we fail to retrieve we can still fallback to uploading an image that is relevant. This is where I believe this tool will be useful. Here is how it looks after the tool has updated the entity images.

Entity Image Updater ScreenshotThe tool actually updates a field called “entityimage” in the entity.



  1. Download the latest version of XrmToolBox.
  2. Install the tool from the XrmToolBox store. Refer for additional details.

Using the Tool

  1. After opening the tool, click “Load Entities” to display all entities
  2. Choose an entity that has an entity image field. You’ll know that an entity has this field, if it has the person default image on the form. This is important, as I currently don’t check if the entity has this field or not. I plan to do this in the next version.
  3. Choose a source for the images. If you chose “Local Folder” you will be asked to select the folder that has the images. Please ensure that the folder has the right sized images. I plan to add resize, upload capability in the future version for “Local Folder” option
  4. Choose an attribute whose value you would use to search. For eg. if you choose “Clearbit”, select a field that has the company’s Url. This could be the file name, if you chose “Local Folder” (only png, jpg and jpeg images can be used, if you chose this option)
  5. Click on “Update All“, if you would like to lookup and update all the records for this entity
  6. If you would like to specify a criteria for update, then click the “Selective Update” field. For eg. you might want to only update records that were created by you. This will open FetchXML Builder that will help you build the conditions. Currently there is a 5-10 second delay in opening the FXB tab. I am still investigating the reason for this delay and will update the tool, once I figure out the fix. The tool will start the update process, straight after you click “Return FetchXML” in the FetchXML Builder tool

The tool will display all the images that were updated in the results window. I haven’t added the capability to save these images to disk, but I will add it in the future if that is a useful feature. I hope this tool will help all CRM folks to fully utilise the entity image field. Please feel free to use the Entity Image Uploader Issues area to log any issues that you encounter.

Thank you to

  • Guido and Adam for their feedback and suggestions
  • Tanguy for XrmToolBox
  • Daryl aka DLaB for the XrmToolBox improvements
  • Jonas for FetchXml Builder

Source code for this tool can be found at

Performing Outer Join in Advanced Find

It is currently not possible to perform left outer join using Advanced Find, even though that capability exists in CRM2015. For e.g. if you want to get a list of contacts, that don’t have an invoice, you cannot do it using an ad-hoc Advanced Find.

This limitation is usually overcome by creating a system view that does a regular inner join, and then updating the view’s fetchxml using a tool like FXB or even editing the customisation file directly. There is also the rollup field approach described in But if you are going to do an ad-hoc advanced find query, you really don’t want to create one system view for each entity, for which you want to do an outer join.

I present to you a solution for this problem: AdvancedQueryOuterJoin

This is a plugin that runs on the pre-stage of RetrieveMultiple, and alters the fetchxml with the correct left outer join condition. This means you can do an Advanced Find Query like this one below.


The above query is for Account, who have child contacts, but don’t have any opportunities. When the plugin sees a link entity in the query, with a null primary key condition, it replaces that condition with a left outer join on the parent entity. The code itself is very simple, and you can have a look at the github repo to understand how this works.

You can download the solution from Download the solution file that works best for your CRM instance i.e. 7.0 or 7.1. Please also use the github issues area, for entering details about any problems that you encounter.

EDIT (01/06/15): Using this plugin will not correct the fetchxml you download by clicking the Download Fetch XML in the Advanced Find window. If you are going to run your downloaded query in FXB, make sure you change the Output type to Grid.


If you use FetchResult, you won’t see any results, as the plugin would not have executed in the background.

EDIT (02/10/15): Refer to the newer post for doing this using bookmarklet.