Recently, I needed to change the workflow service account for workflow 2013 platform. While this seemed relatively easy, there were several strange errors that I ran into. We had the Workflow 2013 Platform configured but the RunAs account needed to be changed. We were using the System Account, when we should have had a Service Account created for the workflow service itself. After creating that Service Account for the workflow service we need to set it as the RunAs account.
After a little hunting with google, I stumbled on this powershell script:
Set-SBFarm -RunAsAccount Domain\Username
$RunAsPassword = ConvertTo-SecureString -AsPlainText -Force ‘<password>’
[RunOnAllNodes] Update-SBHost -RunAsPassword $RunAsPassword
It looks easy enough, but if I tried and run Set-SBFarm, I received the below error:
At this point, it’s important to note that we have Workflow Manager 1.0 which has a dependency of Service Bus 1.0. The above cmdlet is part of Service Bus 1.1. So, you’ll need to do some upgrading to use it. Of course, the order of installation matters.
First, you need to install Service Bus 1.0 CU 1: https://support.microsoft.com/en-us/kb/2799752
Secondly, you’ll need to update to Workflow Manager 1.0 CU 1: https://support.microsoft.com/en-us/kb/2799754 or Workflow Manager 1.o CU 2: https://www.microsoft.com/en-us/download/details.aspx?id=42036 both of which have a dependency of Service Bus 1.0 CU 1 and you need Workflow Manager 1.0 CU 2 to install Service Bus 1.1.
Preferably, you should update directly to Workflow Manager 1.0 CU 2 which has support for Service Bus 1.1 which you will need to run the above cmdlet. The Web Platform Installer is preferable in this situation as it will download the correct install for you without having to choose the files yourself.
Finally, you will want to install Service Bus 1.1, which will require you to uninstall Service Bus 1.0. After that you should have the correct cmdlet.
This order is important because Service Bus 1.0 CU 1 is necessary to install Workflow Manager 1.0 CU 1 or Workflow Manager 1.0 CU 2, the latter has support for Service Bus 1.1 which has the cmdlet you will need. The alternate way, if you can’t upgrade, is to remove and reconfigure your farm. Please note that this will cancel all in progress workflows and require them to be republished and manually restarted.
A final note: the installation of Service Bus 1.1 requires you to leave the Service Bus Farm and rejoin it. Make sure that you have the database connection string which you can get by running the get-sbfarm cmdlet and know the certificate auto generation key — if you don’t you can set it by running the set-sbcertificateautogenerationkey cmdlet.
It’s a little frustrating, that before Service Bus 1.1, the only way to change the Service Account is to remove and reconfigure the farm, and while that’s simple, it can be time consuming and, as noted above, requires that you republish and manually restart your workflows.