PortBinding Files not getting data from SettingsFileGenerator and PortBindingsMaster

Topics: Bindings File, Settings Management and SSO, Server Deployment
Dec 13, 2011 at 7:28 PM
Edited Dec 13, 2011 at 7:32 PM

Hi,

I am using VS 2010 for my BizTalk Application and trying to automate the Deployment using Deployment Framework. I build the MSI and copied into test server for manual deployment(as first step before automate the deployment).

I have environment settings in test server with

ENV_Settings   C:\Program Files (x86)\TestProject\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml

 

My SettingsFileGenerator.xml looks like this

Environment Name: Default Values Local Development Dev Development QA Production
Generate File?   Yes Yes Yes Yes
Settings File Name:   Exported_LocalSettings.xml Exported_DevSettings.xml Exported_QASettings.xml Exported_ProdSettings.xml
           
Settings:          
SsoAppUserGroup BizTalk Application Users BizTalk Application Users BizTalk Application Users BizTalk Application Users BizTalk Application Users
SsoAppAdminGroup BizTalk Server Administrators BizTalk Server Administrators BizTalk Server Administrators BizTalk Server Administrators BizTalk Server Administrators
PROJECTURL http://dev.com https://dev.com https://dev.com https://qa.com https://prod.com

 

When I deploy the project from start menu "Deploy TestProject", everything seems to be deployed until I got this error.

C:\Program Files (x86)\TestProject\1.0\Deployment\Framework\BizTalkDeploymentFramework.targets(1621,5): error MSB3073: The command ""C:\Program Files (x86)\TestProject\1.0\Deployment\Framework\DeployTools\SSOSettingsFileImport.exe" "TestProject" /settingsFile:"C:\Program Files (x86)\TestProject\1.0\Deployment\PortBindingsMaster.xml" /userGroupName:"" /adminGroupName:""" exited with code -1.

I am not sure what did I missed out. Any help is greatly appreciated.

Coordinator
Dec 13, 2011 at 9:21 PM

You'll need this in your .btdfproj:

  <ItemGroup>
    <!-- We are asking the Deployment Framework to create MSBuild properties from the values
        in our environment settings spreadsheet named here. -->
    <PropsFromEnvSettings Include="SsoAppUserGroup;SsoAppAdminGroup" />
  </ItemGroup>

Thanks,
Tom

Dec 13, 2011 at 9:39 PM
Edited Dec 13, 2011 at 9:40 PM

Thanks Tom.

I do have this settings in my .btdfproj which was added as default by Deployment Framework.

  <ItemGroup>
    <PropsFromEnvSettings Include="SsoAppUserGroup;SsoAppAdminGroup" />
  </ItemGroup>

 

When I edit C:\Program Files (x86)\TestProject\1.0\Deployment\Framework\ServerDeploy.bat to include SET ENV_SETTINGS=C:\Program Files (x86)\TestProject\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml

and deploy the project from start menu "Deploy TestProject", deployment works fine without errors and can see the file "Exported_QASettings.xml" generated . Since I want to automate the deployment later, I don't want to edit this file manually.

 

Is there any way to tell the deployment framework which environment settings to be used without editing the file "ServerDeploy.bat"?

 

Tnx,
Suresh

Coordinator
Dec 13, 2011 at 10:16 PM

I assume that you built the MSI using the Build Server Deploy MSI command in Visual Studio?  Then when you install the MSI on the BizTalk server and deploy either via the checkbox at the end of the installer, or via the Start menu command, the first thing you see should be an install wizard dialog box.  The wizard (which is defined by InstallWizard.xml and UnInstallWizard.xml in your project) asks which environment settings file you wish to use, and you would choose Exported_QASettings.xml.  The wizard then passes that along to MSBuild.

Thanks,
Tom

Dec 13, 2011 at 11:23 PM
Edited Dec 13, 2011 at 11:38 PM

Thanks Tom for your help.

For your question related to Build process, I am using TFS Build and Deployment Framework for generating MSI as noted in http://lajak.wordpress.com/2011/02/19/build-biztalk-deployment-framework-projects-using-tfs2010/. Whenever any commit happens in BizTalk Repository, TFS Build will be kick off automatically and generate MSI in the Deployment\bin\Release folder of the Build server.

I was choosing wrong file (PortBindingsMaster.xml) for the Environment Setting file in the Install Wizard Dialog Box. I believe that's the reason why deployment framework is not able to locate the settings. As you pointed out, the deployment works fine when i choose the Exported_QASettings.xml.

Now I can see the settings in Edit SSO Settings utility with the values

 

PROJECTURL          https://qa.com
ProjectPath         C:\Program Files (x86)\TestProject\1.0
SourceSettingsFile  C:\Program Files (x86)\TestProject\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml
SsoAppAdminGroup    BizTalk Server Administrators
SsoAppUserGroup     BizTalk Application Users

 

 

Part of the PortBindingsMaster.xml contains

<PrimaryTransport>
        <Address>${PROJECTURL}</Address>
        <TransportType Name="WCF-BasicHttp" Capabilities="899" ConfigurationClsid="467c1a52-373f-4f09-9008-27af6b985f14" />
        <TransportTypeData>&lt;CustomProps&gt;&lt;MessageEncoding vt="8"&gt;Text&lt;/MessageEncoding&gt;&lt;ServiceCertificate vt="8" /&gt;&lt;InboundBodyPathExpression vt="8" /&gt;&lt;OutboundBodyLocation vt="8"&gt;UseBodyElement&lt;/OutboundBodyLocation&gt;&lt;InboundNodeEncoding vt="8"&gt;Xml&lt;/InboundNodeEncoding&gt;&lt;CloseTimeout vt="8"&gt;00:05:00&lt;/CloseTimeout&gt;&lt;StaticAction vt="8" /&gt;&lt;ProxyAddress vt="8" /&gt;&lt;MaxReceivedMessageSize vt="3"&gt;65536&lt;/MaxReceivedMessageSize&gt;&lt;ClientCertificate vt="8" /&gt;&lt;AlgorithmSuite vt="8"&gt;Basic256&lt;/AlgorithmSuite&gt;&lt;ProxyUserName vt="8" /&gt;&lt;OutboundXmlTemplate vt="8"&gt;&amp;lt;bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="xml"/&amp;gt;&lt;/OutboundXmlTemplate&gt;&lt;TextEncoding vt="8"&gt;utf-8&lt;/TextEncoding&gt;&lt;PropagateFaultMessage vt="11"&gt;0&lt;/PropagateFaultMessage&gt;&lt;SecurityMode vt="8"&gt;Transport&lt;/SecurityMode&gt;&lt;ProxyToUse vt="8"&gt;Default&lt;/ProxyToUse&gt;&lt;TransportClientCredentialType vt="8"&gt;None&lt;/TransportClientCredentialType&gt;&lt;OpenTimeout vt="8"&gt;00:05:00&lt;/OpenTimeout&gt;&lt;InboundBodyLocation vt="8"&gt;UseBodyElement&lt;/InboundBodyLocation&gt;&lt;MessageClientCredentialType vt="8"&gt;UserName&lt;/MessageClientCredentialType&gt;&lt;SendTimeout vt="8"&gt;00:05:00&lt;/SendTimeout&gt;&lt;UseSSO vt="11"&gt;0&lt;/UseSSO&gt;&lt;/CustomProps&gt;</TransportTypeData>
        <RetryCount>3</RetryCount>
        <RetryInterval>5</RetryInterval>
        <ServiceWindowEnabled>false</ServiceWindowEnabled>
        <FromTime>2011-12-07T08:00:00</FromTime>
        <ToTime>2011-12-08T07:59:59</ToTime>
        <Primary>true</Primary>
        <OrderedDelivery>false</OrderedDelivery>
        <DeliveryNotification>1</DeliveryNotification>
        <SendHandler Name="BizTalkServerSendHost" HostTrusted="true">
          <TransportType Name="WCF-BasicHttp" Capabilities="899" ConfigurationClsid="467c1a52-373f-4f09-9008-27af6b985f14" />
        </SendHandler>
      </PrimaryTransport>

 

After deployment, I am still seeing the URI in Send Port as ${PROJECTURL} instead of https://qa.com. Is there anything else I am missing?

 

Tnx
Suresh

Coordinator
Dec 14, 2011 at 6:46 AM

You probably need <RequireXmlPreprocessDirectives>false</RequireXmlPreprocessDirectives> in your .btdfproj.

Thanks,
Tom

Dec 14, 2011 at 5:19 PM

Thanks Tom. That works.

Tnx
Suresh

Dec 15, 2011 at 12:16 AM
Edited Dec 15, 2011 at 12:18 AM

Tom,

I have multiple BizTalk projects(Ex: Project1, Project2 etc..,) to be deployed in the same server. For each project, environment settings files will be in different locations (Ex: C:\Program Files (x86)\Project1\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml, C:\Program Files (x86)\Project2\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml etc..,)

Project1's InstallWizard.xml has

<?xml version="1.0" encoding="utf-8" ?>
<SetEnvUIConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <DialogCaption>Project1</DialogCaption>
   <SetEnvUIConfigItem>
      <PromptText>Enter the domain-qualified account name used by the BizTalk host instance to read/write from/to FILE port physical paths:</PromptText>
      <PromptValue />
      <ValueType>Text</ValueType>
      <EnvironmentVarName>BTSACCOUNT</EnvironmentVarName>
   </SetEnvUIConfigItem>
  <SetEnvUIConfigItem>
    <PromptText>Select the XML file that contains configuration information specific to this environment:</PromptText>
    <PromptValue></PromptValue>
    <ValueType>FileSelect</ValueType>
    <EnvironmentVarName>PROJECT1_FILE_ENV_SETTINGS</EnvironmentVarName>
  </SetEnvUIConfigItem>
  <SetEnvUIConfigItem>
      <PromptText>Is this the LAST server in the BizTalk Group you are deploying to?  
If so, BizTalk assemblies will be deployed to the BizTalk Management Database.</PromptText>
      <Caption>This is the LAST server in the BizTalk Group</Caption>
      <PromptValue>true</PromptValue>
      <ValueType>Checkbox</ValueType>
      <EnvironmentVarName>BT_DEPLOY_MGMT_DB</EnvironmentVarName>
   </SetEnvUIConfigItem>
</SetEnvUIConfig>

When I set the Environment Variable with name PROJECT1_FILE_ENV_SETTINGS and value C:\Program Files (x86)\Project1\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml, deployment fails with error

Target InitSettingsFilePath:
                Invalid settings file path (OK on server undeploy).
            Target InitializeAppName:
                BizTalk Application Name is Project1
            Target PreprocessBindings:
                Clearing file attributes for 'PortBindings.xml'.
                "C:\Program Files (x86)\Project1\1.0\Deployment\Framework\DeployTools\xmlpreprocess.exe" /f /v /c /noDirectives /i:"C:\Program Files (x86)\Project1\1.0\Deployment\PortBindingsMaster.xml" /o:"C:\Program Files (x86)\Project1\1.0\Deployment\PortBindings.xml" /d:CurDir="C:\Program Files (x86)\Project1\1.0" /s:""

When I set the Environment Variable with name ENV_SETTINGS and value C:\Program Files (x86)\Project1\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml, deployment works fine. But this wont work for my case since I need multiple projects to be deployed.

Can you help me fix this?

Tnx
Suresh

Coordinator
Dec 15, 2011 at 4:28 AM

Hi Suresh,

What led you to change ENV_SETTINGS to PROJECT1_FILE_ENV_SETTINGS?  From what you described, you have (correctly) built a separate MSI for each project.  They may all use the same environment variable names in Install/UnInstallWizard.xml.  The environment variables are only used to bridge from the install wizard into the MSBuild script.  Once you complete a deployment for Project1, the environment variables are gone.  You can start a deploy for Project2 using the same env var names with no trouble.  Have you experienced a specific problem leaving the name the same?  In this case, you've changed a "well-known" env var name that the MSBuild script expects (requires) to be defined.

Thanks,
Tom

Dec 15, 2011 at 6:32 PM
Edited Dec 15, 2011 at 6:34 PM

Tom,

If we have to use same Environment variable, Deployment steps would be

1) Run Batch File to set Environment Variable "ENV_SETTINGS" to Project1 Environment Setting FileName

2) Deploy Project1

3) Run Batch File to set Environment Variable "ENV_SETTINGS" to Project2 Environment Setting FileName

4) Deploy Project2

.......

 

But I was planning to use the below steps

1) SET values of different project's Environment Variables like "PROJECT1_ENV_SETTINGS", "PROJECT2_ENV_SETTINGS" etc..,. Reason: I have to set this only one time but not for every time of my deployment.

2) Deploy Project1

3) Deploy Project2

.......

If this is not supported, I could follow the first process flow. I thought that as the dynamic variable name.

Tnx
Suresh

Coordinator
Dec 15, 2011 at 6:47 PM

Sorry, I'm confused with what you're trying to accomplish.  Are you trying to script the whole deployment and avoid showing the wizard(s)?

Thanks,
Tom

Dec 15, 2011 at 7:17 PM

Yes Tom

Coordinator
Dec 16, 2011 at 1:19 AM

OK.  There are a number of other posts here that discuss fully automating deployments with the Deployment Framework.  In that case, you don't need to set an environment variable at all.  You can simply call MSBuild against your .btdfproj using the /p parameter to pass in name/value pairs.  One of the name/value pairs that you'll pass to MSBuild is ENV_SETTINGS and a path.  That way you can bypass env vars altogether.

Thanks,
Tom

Dec 16, 2011 at 6:52 PM

Thanks Tom