'Load Balanced Application - Running Tasks on each machine on demand

So we currently run a console application tied to the start of a web app on each of our hosted (windows) machines in Azure. This runs a process to alter the SNI config on IIS and a couple other small tasks, however It would be nicer if we could run this on demand via an API call, or stick with a task that does not need a separate application.

Is there a way to do this? I was thinking originally having these via an endpoint that is called from a Logic App or Workbook in Azure that will use Azure Management tools to call the API on the Load Balancer to find out which one to query perhaps, but was wondering what other alternatives there are as I'm not sure the original method is sustainable.

TIA.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source