Using BTDF to deploy ftp ports with userName and password into diff environments

Topics: Bindings File, Settings Management and SSO
Nov 7, 2012 at 4:51 PM

Hi,

I have developed a Biztalk messaging only application which has a ftp receive port and couple of ftp send ports. When I used BTDF deployment the passwords for the ftp are lost and the deployed ports error with login failure.

When I looked into the binding file for ftp settings the configuration is not same as for the other port types.

Can someone advice on how to configure the ftp ports in the binding file of BTDF framework to deploy biztalk application please?

Many thanks,

Coordinator
Nov 7, 2012 at 8:15 PM

You can use the master bindings XML file as a template along with the SettingsFileGenerator.xml Excel spreadsheet to capture the usernames and passwords for each environment (see BasicMasterBindings BTDF sample app).  When you export a bindings XML file, BizTalk Admin always strips out sensitive information.  In your PortBindingsMaster.xml, find the FTP username and password elements and set the vt attribute to vt="8".  In the element value, insert the replacement token that matches up to the setting in the Excel spreadsheet (see documentation links above).

Thanks,
Tom

Nov 8, 2012 at 2:26 PM

Hi Tom,

Thank you I managed to configure the ftp passwords and it works fine. But I have one more issue. For my application I even create the new host and host instances, but as I'm using the ftp adapter these newly created host's are not added for ftp receive and send handlers.

Can you advice me on how to add the host's to ftp adapter handlers please?

Many thanks,

Kishore

Coordinator
Nov 12, 2012 at 6:56 AM

Hi Kishore,

There is nothing built-in to configure adapter handlers.  However, you can run a script to do it.  Here's a VBScript subroutine that I've used before for moving receive handlers between hosts:

Sub UpdateReceiveHandlers (HostNameToSwitchTo, HostNameToSwitchTo32Only, Is64Bit)
    On Error Resume Next

    Dim NewHostName
    Dim Query, ReceiveHandlerInstSet, Inst

    ' Look for the target WMI Class MSBTS_ReceiveHandler instance
    Query = "SELECT * FROM MSBTS_ReceiveHandler WHERE HostName <> ""BizTalkServerIsolatedHost"""
    Set ReceiveHandlerInstSet = GetObject("Winmgmts:!root\MicrosoftBizTalkServer").ExecQuery(Query)

    If ReceiveHandlerInstSet.Count > 0 Then
        For Each Inst In ReceiveHandlerInstSet
            NewHostName = HostNameToSwitchTo

            If Is64Bit Then
                Select Case Inst.AdapterName
                    Case "SQL", "FTP", "POP3", "Windows SharePoint Services"
                        NewHostName = HostNameToSwitchTo32Only
                End Select
            End If

            ' Update host association
            Inst.HostNameToSwitchTo = NewHostName
            Inst.Put_(UpdateOnly)

            ' Check for error condition before continuing.
            CheckWMIError
            wscript.echo "Receive Handler '" & Inst.AdapterName & "' has been moved to host '" & NewHostName & "' successfully."
        Next
    Else
        wscript.echo "No non-isolated receive handlers found to move to host " & HostNameToSwitchTo & "."
    End If
End Sub

You can put this (and additional code to call UpdateReceiveHandlers) in a .vbs file and include the .vbs file into the MSI via an AdditionalFiles ItemGroup.  You can then call the script from one of the extensibility points.

Thanks,
Tom

Nov 12, 2012 at 10:32 PM

Thank you Tom, but I managed to add the new handlers using the BTDF framework. I have added the new Host and added the newly created host to the ftp adatper handler.

Many thanks,

Kish

Coordinator
Nov 13, 2012 at 5:10 AM

OK, great!  When you say you did it using the "BTDF framework", what did you use to complete these steps?

Thanks,
Tom

Nov 14, 2012 at 11:16 AM

Hi Tom,

 

Well in the I have created a new Host and Host instance in the btdfproj file as

<ItemGroup>

           <HostInstance Include="PricingSend">
            <HostName>PricingSend</HostName>
            <HostType>InProcess</HostType>
            <HIAccountName>Empty</HIAccountName>
            <HIAccountPassword>Empty</HIAccountPassword>
            <HIForce>true</HIForce>
        </HostInstance>
    </ItemGroup>

And I then created Receive/Send handlers as:

    <ItemGroup>

            <RHAdapterName Include="PricingReceive">
            <HostName>PricingReceive</HostName>
            <Protocol>FTP</Protocol>
            <RHForce>true</RHForce>
        </RHAdapterName>
    </ItemGroup>

Which on deploy created a new host/host instance and then added this newly created host to ftp adapter which I need for my interface.

Thank you,

Kish

Coordinator
Nov 14, 2012 at 5:26 PM

You must have also called another MSBuild task, right?  The Deployment Framework doesn't recognize either of those ItemGroup element names.  Did you call something from the SDC tasks?

Thanks,
Tom

Nov 19, 2012 at 10:51 AM

Hi Tom,

You are right, well using the MSBuild task is been put in the targets file by our architect, so I was using existing targets file to create new host's. And the code in the target file to create host is

<MSBuild.ExtensionPack.BizTalk.BizTalkHost Condition="'$(HostExists)' == 'False'"
                                                   TaskAction="Create"
                                                   DatabaseServer="$(BTSMngDatabaseServer)"
                                                   Database="$(BTSMngDatabase)"
                                                   HostName="%(Host.HostName)"
                                                   Tracking="%(Host.HostTracking)"
                                                   WindowsGroup="%(Host.HostWindowsGroup)"
                                                   HostType="%(Host.HostType)"
                                                   Trusted="%(Host.HostTrusted)"
                                                   Use32BitHostOnly="%(Host.HostUse32BitHostOnly)"/>

 

Although I'm not sure this is something we should be doing to create the host's using the BTDF.

Thank you,

Kish

Coordinator
Nov 20, 2012 at 2:09 AM

Thanks, that makes sense.  I typically treat host setup as an infrastructure/server setup task, so I have a VBScript file that is run at the time of initial BizTalk group setup.  I'm not sure doing it at application-level deployment is ideal, but if it works for your environment than there's nothing wrong with it!

Thanks,
Tom

Nov 21, 2012 at 1:52 PM

Yes, even I thought so but I was unable to convince my architect not to create the host's using framework for every application.

On the same note, I'm about to deploy the biztalk solution onto the QA but I don't have passwords for the QA biztalk accounts, how would I supply the passwords in the spreadsheet as I don't have with them and they are held only with the infrastructure guys.

Many thanks,

Coordinator
Nov 27, 2012 at 9:05 AM

In that case, I usually recommend that they keep their own secure copy of the spreadsheet.  The infrastructure tech can first install your BTDF MSI, then overwrite the SettingsFileGenerator.xml with their secure copy.  When the deployment process is started, the settings will end up being exported from their version.

Does that make sense?

Thanks,
Tom