I am deploying BizTalk applications using BizTalk deployment project and azureDevOPS.
I need to add a reference to the another application. BTDF used to have "AppsToReference", how to achieve the same thing using BizTalk Deployment Project.
<ItemGroup>
<AppsToReference Include=" Company.Application.SharedObjects"/>
<AppsToReference Include="BizTalk EDI Application"/>
</ItemGroup>
Related
I have a build definition with the following build steps in the following order:
NuGet Installer
Npm
Gulp
Visual Studio Build
Azure Web App Deployment
In step 3, Gulp generates a dist folder in my application root. The dist folder contains some subfolders and files. The subfolders themselves can contain other subfolders and files.
In step 4, the Visual Studio Build step creates a <ProjectName>.zip zip file when completed.
The Azure Web App Deployment step then deploys that zip file to my Azure Web App.
How do I include the dist folder in <ProjectName>.zip?
I tried doing two Azure Web App Deployments deploying one zip file at a time in the same build definition but the second Azure Web App Deployment build step wipes whatever was deployed by the first one. Is there a way to tell the second Azure Web App Deployment step to "append" to whatever was deployed by the first Azure Web App Deployment step?
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
...
...
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
...
...
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target> -->
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
<Target Name="CustomCollectFiles">
<ItemGroup>
<_CustomFiles Include="dist\**\*" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>dist\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
</Project>
The property CopyAllFilesToSingleFolderForPackageDependsOn must come after the import <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
dist\**\* means take the dist folder that is directly underneath web application root
dist\%(RecursiveDir)%(Filename)%(Extension) means place the dist folder directly underneath the web application root inside of the package
Example package path:
C:\_publish\BuildAgentDemo.zip\Content\C_C\Repos\BuildAgentDemoTest1\BuildAgentDemo\obj\Release\Package\PackageTmp\dist
BuildAgentDemo.zip is one of the artifacts created by the Web Deploy Package publish profile
PackageTmp is your web application root
dist is where your custom folders and files will end up
You can add a custom target in your project file to include the files generated by Gulp. Refer to this question for details: How do you include additional files using VS2010 web deployment packages?
And another way to get the Gulp folder published is enabling the FTP deployment of your Azure Web App. And then you can add a FTP Uploader task after "Azure Web App Deployment" task. Use "Azure Web App Deployment" task to deploy the package generated by VS Build and use "FTP Uploader" task to upload the "dist" folder into Azure Web App. Note: Make sure you unchecked the "Delete old Files" option of the FTP Uploader task.
When building a Service Fabric application on a build server, is there a way to get a deployment package built with .sfproj / nuget combination?
Digging around found that there's a .sfpkg option, but it is not clear how to build that using MSBuild.
The possible duplicate is showing how it package a service fabric application from a command line. I was after achieving the same when building a solution in release mode. This section can be added to the .sfproj file to achieve the goal:
<Target Name="ReleaseAfterBuild" AfterTargets="AfterBuild" Condition=" '$(Configuration)' == 'Release' ">
<MSBuild Projects="$(ProjectPath)" Targets="Package" />
</Target>
How to create a deployment package for Service Fabric that includes all artifacts necessary to run the designed workflows at run-time?
Another option is to package a service fabric application by building a solution in release mode (for example). This section can be added to the .sfproj file to achieve the goal:
<Target Name="ReleaseAfterBuild" AfterTargets="AfterBuild" Condition=" '$(Configuration)' == 'Release' ">
<MSBuild Projects="$(ProjectPath)" Targets="Package" />
</Target>
To create a Service Fabric application package you need to run the "Package" target on the sfproj file.
msbuild app.sfproj /t:Package
This will create a "pkg" directory next to the sfproj file with all the necessary files.
We are using TFS2010 for our web sites's builds and we're in the process of creating fully automated builds. At the moment the sites are built and deployed in remote servers.
The sites contains several configuration files that we would like to transform as part of the build. As there are some rules to create the correct config files we would like to use a custom tool for that purpose (.exe), not to use xml transformations for it.
From what we can see in the build template, MSBuild copies the files to a drop folder and then pushes them to the remote IIS site. We would like to hook our custom tool to this process and do the transformations in the build server before the site is published. The problem is that the MSBuild task is a single node in the build template and we can't find a place where to invoke our tool. Before the MSBuild step, there is no code deployed to the drop folder, after the MSBuild step the code was already deployed to the remote server.
Any ideas on how to plug the custom tool in the correct workflow step?
What is the msbuild target, that you use? I think you can define your own target in csproj file to do the following:
execute your custom tool against required files
run usual build target (or whatever target you normally use)
Edit
E.g. in a .csproj file you could define the following:
<Target Name="buildWithCustomTool">
<!-- Exec your custom tool -->
<Exec Command="your command" />
<!-- Call the build target which will run as normally -->
<CallTarget Targets="Build" />
</Target>
Hope it helps,
Ivan
Given I have a post build process that generates files in \bin\out how can I use a MSBuild targets file to state that all files (recursively) in that directory should be published during web deploy?
Let's split this in two parts:
First, build the web project:
<Target Name="BuildWeb">
<MSBuild Projects="WebExtranet\WebExtranet.csproj"
Properties="Configuration=$(Environment);DeployOnBuild=True;CreatePackageOnPublish=True;BaseIntermediateOutputPath=..\$(DistDir)\Web\" />
</Target>
Then use this to publish to the local IIS (you might need to adjust the msdeploy command to suit your needs)
<Target Name="DeployWeb">
<ItemGroup>
<PackageSourceDir Include='$(DistDir)\Web\$(Environment)\Package\WebExtranet.zip' />
</ItemGroup>
<Message Text="Package path: %(PackageSourceDir.FullPath)" />
<Exec Command=""c:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -allowUntrusted -source:package="%(PackageSourceDir.FullPath)" -setParam:'IIS Web Application Name'='My Web App' -dest:auto"/>
</Target>
Common pitfalls:
The msbuild version is important. I'm using V3.
You have to have the web application already created on IIS. Only need to do it once.
Note that the $(Environment) variable is the build configuration. I have several, but run the first target and check the folder structure created. Then adjust the script.