This post is the fifth part related to currently named Windows Azure Workflow 1.0. I describe how to configure the Workflow Host farm.You can find the whole series also in the blog.

If you choose to create the farm, the configuration wizard will create three required databases:

Management Database
Resource Management Database
Instance Management Database

At this step you don’t have to change anything.


Then enter credentials of the user who will run the hosting processes.
As a certificate generation key enter some typical password and remember it!!!


After all configure required TCP and HTPP management ports. I would recommend to leave them at default.


In the next step Service Bus farm settings are being configured. First of all the following databases will be created:

-Farm Management Database
-Gateway Database
-Message Container Database


Then like in previous step service account. It is good to know that the wizard will automatically check if the user exists after you have entered the user name.
Also enter the password for certificate generation key. This can be a different one  than that in the case of Workflow Host.


At the end you will have to enter TCP and HTTP port of the Service Bus server and the admin group name.


Before the farm is configured you will get a summary:

image image

You are finished if you see following:


How to do all this with PowerShell?

Following script is exactly executed by Wizard:

# To be run in Workflow PowerShell Console which has both Workflow and Service Bus installed.

# Create new SB Farm
$SBCertAutoGenerationKey = ConvertTo-SecureString -AsPlainText -Force -String '***** Replace with Service Bus Certificate Auto-generation key******';

New-SBFarm -FarmMgmtDBConnectionString 'Data Source=HOSTInitial Catalog=SbManagementDB;Integrated Security=True' -PortRangeStart 9000 -TcpPort 9354 -RunAsName 'appfabricserviceuser@DOMAIN-AdminGroup 'BUILTIN\Administrators' -GatewayDBConnectionString 'Data Source=HOST;Initial Catalog=SbGatewayDatabase;Integrated Security=True' -CertAutoGenerationKey $SBCertAutoGenerationKey -ContainerDBConnectionString 'Data Source=Auxo.DAENET.LAN;Initial Catalog=SBMessageContainer01;Integrated Security=True';

# To be run in Workflow PowerShell Console which has both Workflow and Service Bus installed.

# Create new WF Farm
$WFCertAutoGenerationKey = ConvertTo-SecureString -AsPlainText -Force -String '***** Replace with Workflow Certificate Auto-generation key******';

New-WFFarm -FarmMgmtDBConnectionString 'Data Source=HOST;Initial Catalog=WFManagementDB;Integrated Security=True' -RunAsName 'appfabricserviceuser@DOMAIN' -AdminGroup 'BUILTIN\Administrators' -HttpsPort 12290 -HttpPort 12291 -InstanceMgmtDBConnectionString 'Data Source=HOST;Initial Catalog=WFInstanceManagementDB;Integrated Security=True' -ResourceMgmtDBConnectionString 'Data Source=HOST;Initial Catalog=WFResourceManagementDB;Integrated Security=True' -CertAutoGenerationKey $WFCertAutoGenerationKey;

# Add SB Host
$SBRunAsPassword = ConvertTo-SecureString -AsPlainText -Force -String '***** Replace with RunAs Password for Service Bus ******';

Add-SBHost -FarmMgmtDBConnectionString 'Data Source=Auxo.DAENET.LAN;Initial Catalog=SbManagementDB;Integrated Security=True' -RunAsPassword $SBRunAsPassword -CertAutoGenerationKey $SBCertAutoGenerationKey;

# Create new SB Namespace
New-SBNamespace -Name 'WorkflowDefaultNamespace' -AddressingScheme 'Path' -ManageUsers 'appfabricserviceuser@HOST','svcuser@DOMAIN';

Start-Sleep -s 90
Catch [system.InvalidOperationException]

# Get SB Client Configuration
$SBClientConfiguration = Get-sbclientConfiguration -Namespaces 'WorkflowDefaultNamespace';

# Add WF Host
$WFRunAsPassword = ConvertTo-SecureString -AsPlainText -Force -String '***** Replace with RunAs Password for Workflow ******';

Add-WFHost -FarmMgmtDBConnectionString 'Data Source=HOST;Initial Catalog=WFManagementDB;Integrated Security=True' -RunAsPassword $WFRunAsPassword -SBClientConfiguration $SBClientConfiguration -EnableHttpPort -CertAutoGenerationKey $WFCertAutoGenerationKey;

How to join an existing Farm?

Joining an existing farm is more or less a trivial operation, at least from the point of view of configuration. You have to provide database host name, credentials and generation keys for the Workflow Host and Service Bus.

image image

Note that the joining process does not create databases. Instead, it joins the node to farm described by the set of existing databases.

What if something goes wrong?

During creation of the farm some things can go wrong. Here is one example which shows how my configuration wizard failed to add the host to the farm.

When something similar happens, it can be that installation state remains inconsistent. Assuming the databases have been created, which is probably the case, you can join the farm as described in the previous topic.
If this does not work, start configuration wizard again


and this time leave the farm:


After that I also stopped all services:

and deleted all created databases in SQL Management Studio. After that you can start a fresh new configuration by selecting Create New Farm.