How to query Azure Data Explorer from an SSIS package? - ssis

According to this article one can create SSIS jobs to query Kusto with a KQL query.
How can this be done? How would one connect to and query ADX from an SSIS package?

The problem you'll have is that SSIS .NET Tasks don't really understand nuget. The design experience will allow you to build a script/component that uses a nuget package but the moment you close the designer, the packages folder is trashed/not serialized into the package. When the package Executes, the task/component will fail because the expected libraries are not there and the SSIS engine does not have the insight to call a package manager to fix it.
Blessedly, these DLLs ought to be strongly signed so making this work should be a matter of installing them into the Global Assembly Cache (GAC) on your development machine(s) and corresponding servers. Something like the following command, which might need to be run an admin context
gacutil -if \path\to\the\assembly\Microsoft.Azure.Kusto.Data.dll
You likely have a gacutil installed but not in your command path dir /s /b gacutil.exe will ferret out locations.
C:\Program Files (x86)>dir /s /b gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe
From your comment, what is csb for example I presume based on this link that it's a connection string builder object. Which makes sense, the code is requesting that it opens a SqlConnection object and the constructor needs to know where to go, what credentials to use, etc.

Related

Using CsvHelper in SSIS Projects

I am trying to use CsvHelper in my SSIS project specifically as a source component in my data flow. Unfortunately, SSIS doesn’t integrate with NuGet, so I would think that the CsvHelper DLL needs to be registered to the GAC. I haven’t worked directly with the GAC in years. Is it just the CsvHelper DLL that I need to register? If so, how do I find it?
The crux of whether you can put something into the GAC is whether the DLL is strongly signed. Looking at the project, I see an entry for an SNK (strongly named key) so that's checked off the list.
How to find it
Assuming it's on your system from a command/dos prompt
cd /d C:\
dir /s /b csvhelper.dll
If you can find the specified DLL, then you need to GAC it
How to GAC it
Open a visual studio command prompt as a local administrator (or find your GAC installation and open a command prompt as an administrator)
gacutil.exe -if Path\to\my\dll\cvshelper.dll
Note that you may need to specify the path to the gacutil.exe
Gac find
This will be the same mechanism as finding the dll above. Open a command prompt and search for it. Your results may vary but here's what my box looks like
C:\>dir /s /b gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x64\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe
Lather, rinse, repeat
You'll need to ensure the DLL has been GAC'ed on any box that will be running your SSIS solution so keep track of any hiccups you have doing this on your local machine as it'll need repeating on the actual servers.

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 2017 SSRS Report Templates

With the version of SQL Server Data Tools included with SQL Server 2012 you could create a report definition and copy the .rdl into the folder below and it would appear when you created a new project item.
C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject
I'm trying to achieve the same with Visual Studio 2017 and the Report Project extension though this does not appear to work when I copy the file to the folder below:
C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject
How can I get template report items to appear for report projects?
The new location is now under (replace Enterprise with whatever your sku is)
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSDTRS\ProjectItems\ReportProject
UPDATE: This now looks to have changed to
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS\ProjectItems\ReportProject
It looks like the folder path has changed now that SSDT is no longer in Preview - it was released 4-10-2018 for the first complete release. Anyways, I had an SSRS template that disappeared after installing the new release. Upon inspection, I found that the folder path for SSDT templates was moved from the Enterprise to SQL paths (remove the spaces):
SSAS: C:\Program Files (x86)\Microsoft Visual
Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSAS\
SSIS: C:\Program Files (x86)\Microsoft Visual
Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSIS\
SSRS: C:\Program Files (x86)\Microsoft Visual Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSRS\ProjectItems\ReportProject\

Could not load file or assembly error on adding custom libraries in SSRS reports

I have created a custom library(CodeLibrary) which internally references the dlls Microsoft.TeamFoundation.Client and Microsoft.TeamFoundation.WorkItemTracking.Client.
I added this custom Dll codelibrary.dll to my SSRS report. and the expression of one of the field as
=codelibrary.codefunction.GetValue(1000)
codefunction is the class and GetValue is the method.
When I preview the report, I get the error "Error while loading code module: 'CodeLibrary,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null'. Could not load file or assembly 'CodeLibrary,Version1.0.0.0, Culture=neutral,PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
I am using VS2013, I have placed the custom library DLL in the path
C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies
I have tested the custom library with a WPF application and it works fine.
I am not able to figure out what is causing this error.
I didnt have to modify rssrvpolicy.config file.
I added the custom dll to the following paths and it worked:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin
In visual studio 2015, I had to copy the dll to:
C:\Program Files (x86)\MSBuild\14.0\Bin
You should copy your custom library to the ReportServer\Bin folder ex: C:\Program Files\Microsoft SQL Server\MSRS10_50.R2\Reporting Services\ReportServer\bin
Then modify the rssrvpolicy.config in ReportServer folder, find "$CodeGen$" and add the following code
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="CoDeMagSample"
Description="CoDe Magazine Sample. ">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSRS10_50.R2\Reporting Services\ReportServer\bin\YOURLIBRARY.dll"
/>
After that, Stop and Start Reporting Service from Reporting Service Configuration Manager.
Hope this help.
Adding - In Visual studio 2019, I copied the dll to:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS

LNK1104: cannot open file 'glut32.lib'

I am using "CUDA bu Example" book to get started with CUDA.
But when I included all header files given by book then got ERROR as
Error 1 error LNK1104: cannot open file 'glut32.lib' D:\book\book\LINK book
I am using Visual Studio 10
Please help me out of this
I found the same error while setting it up in Visual Studio 2010
However, I also found a fix and wanted to share it.
Just copy and paste the glut32.lib file to MicrosoftSDKs folder, as this is the default location of VC++ linker location. To be exact
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
You probably have to build the "shrUtils_vs2010.sln" solution if you haven't done it.
The file is in "\path_to_SDK\NVIDIA GPU Computing SDK 4.2\shared" folder.
Copy the glut32.lib file from the lib folder in "cuda by example" to the folder below:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\Win32
I have tested this solution and it worked for me in visual studio 2015
1: Copy glut32.dll to your project directory (where your source.cpp is)
2: Copy glut.h to C:\Program Files\Microsoft Visual Studio 14.0\Vc\Include\gl (gl folder should be created manually)
3: Copy glut32.lib to C:\Program Files\Microsoft Visual Studio 14.0\Vc\lib done.