Azure Devops Build SSIS task - ssis

I have created an SSIS package using VS 2017 and added the project to Azure Devops. I am trying to setup a build task in Azure Devops using the SQL Integration Service add in. Everything I am doing is setup on my machine which includes the Agent Pool etc. When trying to setup parameters for the SSIS build the Devenv Version selection only gives me 12 and 14. VS2017 doesn't appear. As a result it appears that when I do a build the incorrect version on devenv is used and the build (even though it doesn't say its failed) fails.
The version the build is using is C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Devenv.com but should be using C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE>Devenv.com
How do I get to DEVENV config parameter to include the Hosted VS2017 version?
The following web page gives an idea of what I am trying to achieve: -
http://chamindac.blogspot.com/2018/09/build-and-deploy-ssis-with-azure-devops.html

I ended up using a powershell script instead.
The script has one line to run the build.
&"${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com" "C:\Users\me\Downloads\vsts-agent-win-x64-2.140.0_work\2\s\POC_SSIS.sln" /rebuild
I place the code in a .ps1 file and put it into the root of my repo. I then used the Powershell config to reference the file and it worked.
I did a similar thing for the deployment where I used : -
ISDeploymentWizard /S /SP:C:\Users\me\Downloads\vsts-agent-win-x64-2.140.0_work\2\s\POC_SSIS\bin\Development\POC_SSIS.ispac /DS:serverName /DP:/SSISDB/POC_SSIS/POC_SSIS

Related

Unable to build SSIS package from command line: Missing switch argument. Configuration name required for /build switch

I am trying to script out the building of an SSIS solution in VS 2013.
I keep getting the error: Missing switch argument. Configuration name required for /build switch.
My Command is this from PowerShell:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE> .\devenv.exe C:\Dev\SSIS\RCLShippedFileProcess\RCLShippedFileProcess.sln /build /project RCLShippedFile /projectconfig "Debug"
When I build within Visual Studio, I can see that my ProjectName and the Config are what I am passing in. This certainly has me stumped!
Documentation about this is here.
I ended up resolving the issue, I needed to call the devenv.com application, which is ultimately what devenv.exe calls. If you call devenv.com directly it worked.
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE> .\devenv.exe C:\Dev\SSIS\RCLShippedFileProcess\RCLShippedFileProcess.sln /build "Debug"

Visual Studio Team Services Building JSON Scripts

I'm currently building scripts using Selenium Builder (which saves files as JSON) and i'm having a hard time running these scripts on VSTS. My question specifically is, can Visual Studio Team Services build JSON scripts and tie them in with its C.I.? If so, which approach must I take in order to do this / make it possible?
Thanks!
Here is my steps for your reference:
Deploy your own private build agent by following this link.
Configure the required environment on the build agent like Selenium Driver, Firefox so that the testing can be run on the build agent.
Upload the json file generated by Selenium Builder into VSTS Repository.
Create a build definition with two Command Line tasks: The first one runs npm install command to install se-interpreter:
And the second one run se-interpreter command to run the test in json file:
Queue the build, you will see the test been executed during the build:

Building SSIS .dtproj inside a VSTS Hosted Build Agent

I'm trying to build a SSIS 2016 project, that's been configured with the Project Deployment model in a VSTS build with the intent to deploy the .ispac file onto a SQL Server VM hosted in Azure.
Using MSBuild to build the project file returns the following error:
The default XML namespace of the project must be the MSBuild XML namespace.
If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element.
If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.
I found a blog post here describing the same issue
https://speaksql.wordpress.com/2013/06/07/a-journey-to-db-deployment-automaton-ssis-build-using-msbuild/
However, the solution depends on installed SQL Server Data Tools into a build agent.
Is there a method where I can use a VSTS Hosted agent, and not have to create an on-premises agent with SSDT installed?
Just released new Extension for VSTS/TFS
https://github.com/ToxicGlobe/VSTS-SSIS-Extension
It build Visual Studio project, containing packages and parameters to a project deployment file (.ispac)
https://marketplace.visualstudio.com/items?itemName=TG.VSTS-SSIS
For similar scenario i used devenv.exe
Tool : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Arguments : .\Code\Database\NameOfSolution.sln /build $(BuildConfiguration)
devenv.exe /build does not require ssdt to installed on build agent
Looks like Microsoft is not supporting this just yet based off UserVoice
https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/11543292-install-sql-server-data-tools-ssdt-for-sql-serve
https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/4850300-install-sql-server-data-tools-for-bi-on-the-team-f

Using Visual Studio Online to build Windows Store Apps?

I have a Windows Store Application (Windows 8.1), hosted on a GIT repo on Visual Studio Online.
I created a build definition, left all the default values as they were, ran the build and downloaded the artifacts.
I didn't find the Powershell script used to side load (install) the application, instead I found an .exe file.
What can be missing to generate the Powershell script needed to install the app?
The default build configuration is copying the files in "bin" folder to artifacts, that's why you see exe file.
To copy the package files to artifacts, please configure your build definition as following:
In "Visual Studio Build" step, add following argument in "MSBuild Arguments":
/p:AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\\"
And in "Publish Build Artifacts" steps, set "Path to Publish" as following:
$(Build.BinariesDirectory)\AppxPackages
To package Windows Store App during the TFS build process, you can (assume you're using XAML build):
1). Set MSBuild Arguments to be: /p:DeployOnBuild=true;DeployMethod=Package /p:DefaultPackageOutputDir="$(TF_BUILD_BINARIESDIRECTORY)"\StoreAppPackage
2). Set Output location to be 'SingleFolder' or 'PerProject'.
Then, after you queue one build, you will find one folder called StoreAppPackage in the TFS Build Drop folder. You can then find the Add-AppDevPackage.ps1 file.

"The binary code for the script is not found"

I used the script found here
... And every time that I generate this dynamic package, it needs to open the script task and click "Ok" because the "The binary code for the script is not found." error aways appears. Is there a way to solve this without BIDS ? Thanks and sorry my bad english.
I got this error when a SSISDB was upgraded to 2016 from 2012 and the package was not re-deployed using newer visual studio with project set to deploy to SQL Server 2016 in the project deployment properties.
This is often caused to to an error or omission in the code in the script task. If you are certain that the code is correct you can go to the script properties and set the PrecompileiIntoBindaryCode to False, the default is set to true. This is under the Properties or in the Script option of the properties window.
This worked for us
From Project properties, change TargetServerVersion to SQL Server 2019 (Or desired version)
open the .dtsx file for each package in Notepad++ or other text editor
remove the following for each dtsx file (there will be 1 occurence per script component in packages)
<PropertyGroup>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
save the .dtsx file
go back into Visual Studio and rebuild the project file (as well rebuild individual script task)
I just ran into this error, after I changed my package deployment configuration to 2012. In the script some references we no longer linked. I had to reset the version of the .Net framework in the VS script environment, references were now legit, rebuild success.
In Visual Studio 2017, SSIS 2017 solution, had same error on a script task. Compared to another solution with similar process and discovered the issue was the Reference which had an error did not have a path listed for the dll. Removed the reference and added again. This resolved the issues.
Uninstall VS 2015 and SSDT 14.
Re Install VS 2015 and SSDT 14.
Open a new Integration project and import the SSIS project using the ispac file
Open the task having the error
Click On Edit Script.
Then either do this:
In Build tab click on Run code analysis on solution or Build or Clean and then Build
Save All the solution
Close the window
Click on OK in the task window.
OR just click on edit script and then OK button
The error should go off
This is for Visual Studio 2015 Community/SSDT 14
use SSMS V17.8.1 and upgrade your SSISDB and it will work, I tried it.
For me, I found that using string interpolation caused the issue.
For example:
This line caused the error:
command += $"test {property.Name}";
Changing it to this fixed the error:
command += "test " + property.Name;
After changing from VS 2017 to VS 2019, I saw this error in SQL Server / Integration Services Catalog / "My Package" / Validate... These messages are also visible in Standard Reports / All Executions.
My particular error messages were "VS_ISBROKEN" in the SSIS.Pipeline and "The binary code for the script is not found." in my scripting task.
I opened up the scripting task (C#) and changed the project target to x86 instead of None (MSIL), rebuilt it, closed the scripting solution, pressed Ok to keep the script changes, saved, built and deployed.
That worked for me.
Addendum:
It turns out that I was deploying a single package using VS2019 while the original Project was deployed using VS2017.
I think that the two deployments are not 100% compatible, and recommend that users either deploy an entire project, or deploy a package update using the same version as was used for the initial release.
You should probably ignore my suggestion above about changing project target.
Check your references, make sure all external references are added to the server's GAC.
For adding your dll(for example csvhelper.dll) in GAC you can use the following command in cmd.
C:\test>"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7 Tools\gacutil.exe" -i csvhelper.dll
**Put your dll in a folder (for example in test folder)
**Pay attention which version of .Netframework you have(Here I used .net4.7)