SSIS Missing Method Exception with CRM - ssis

I have an SSIS package that I am attempting to set up as a SQL Server Agent Job. This package takes XML files and inserts/ updates records in Dynamics CRM 2011. In my development environment, the execution works correctly. However, when deployed to the server (which is the same domain as the database concerned), when executing a System.MissingMethodException is thrown.
The machine definitely has the DynamicsCRM2011.dll in the GAC - this machine has both the database and teh instance of CRM2011 running on it. On my test machine, I was connecting to this server (which is on a different domain) without incident. I get the same issue for all users whether integrated security is used or not.
The files are correctly read, this error is happening when declaring the CRM service and assigning a new Helper from the service (CRM2011.Proxy.Helper).
Any ideas?

Are you sure u added the dll in GAC? You can copy the dll in the same folder as the SSIS Package.

Related

SSIS Connection Managers - SQL Auth in development, Integrated in Production

I'm using SQL 2016 and we're converting over a bunch of SSIS packages (from way back in 2005). In our old architecture we had development and production. We're moving now to source control in VSO and we're staging our deployments. We have local development on developer machines, then we post to Dev, then to QA, then Staging, then finally production.
We've figured out how to use SSIS Environment Variables (AWESOME!) and we're able to run the files on local dev machines from inside Visual Studio using SDT. Then we deploy as project to an ispac file which we copy to the Dev server and import into our SSIS Catalog in SSMS. Then in SSMS we are trying to change the variables for each environment.
The problem is the Data Connection. I was passing the connection string and the authentication password as a parameter into a shared connection. So the connection read those values in from the project parameter when executing. Then we were going to change those values for each environment. It turns out on the server we need to execute using Integrated Security. Since we're testing remotely we can't use Integrated Security on our local machines. So basically local dev is SQL Authentication but Dev, QA, Staging, and Production environments will all be tested on servers using Integrated Security.
I can't seem to get this to work right. I have two Project Parameters DB_ConnectionString and DB_Password. I also have a shared Connection (OLEDB SQL) which in the package is parameterized. We use the Project Parameters for the connection so at execution it's using the project parameters to plug in the string and password.
When I post to live I need Integrated. So I tried putting an Integrated security connection string into the Environment Password fro DB_ConnectionString and then it requires a Password. But that isn't really working right. I'm getting a connection error.
SSIS Error Code DTS_OLEDBERROR
"Invalid authorization specification"
If you can avoid using parameters you will be better off in my opinion. When publishing to the catalog you can set your connection strings based on your environment. This way you can have sql auth on development machines and integrated auth when running in any of your server environments.

Windows authentication in SSIS package

I am working on my first SSIS package that connects to a SQL server. While I am developing it, I am connecting using Windows authentication which works fine since my Windows user name was added to the security of the database I am working on. Now, my IT department created a service account to deploy the package with. My question is, how can I change the user name/password of the connection before I deploy it? Is there a configuration file that the connection can read from? How can this be handled?
You actually have two security contexts here to be concerned with. The first is the account required to deploy the package or project you've created. The second is the account required to be able to execute the package you've created.
End-to-end Windows Authentication (deployment, execution and data sources)
The deployment account would need to have correct permissions to the server or filesystem on which it will reside. The execution account may be configured with a very different set of permissions, primarily related to the permissions required to execute whatever tasks you've built into the package.
In order to deploy the package under a different user that your own, it may be as simple as opening an application (like Command Prompt, Windows Explorer or SSIS Deployment Utility) as that user account and moving the package to the correct location. This can be handled on your workstation or the server.
For the execution account, you have options depending on how you're going to operationalize the execution of the package. Here's a few scenarios:
If you will have the package be executed by the SQL Server Agent and the account you need to execute the package with is the SQL Server Agent service account, you only need to create the job to run the package. Unless otherwise programmed, packages called from a SQL Agent job will run as the SQL Agent account
If you will have the package be executed through a SQL Server Agent job and the account you need to use for executing the package is NOT the SQL Agent service account, you can create an SSIS Proxy Account and specify that in the SSIS Package execution job step. After creating the credential inside SQL Server, it is as simple as changing a dropdown.
If you will be using command line execution from a SQL Agent job, the above two scenarios are still applicable.
If you will be using another mechanism (like Windows Scheduler or another Enterprise Scheduling tool) that uses a command line execution-like method, you should still be able to have that process "run as" the execution account.
Windows Authentication for deployment and execution only (SQL authentication for data)
The above details still apply for executing SSIS packages via jobs and/or command line, but you will need to pass the username and password to the connection manager at the time the package runs. You have several options to do this and should follow any established patterns or standard your organization has in place. SSIS has long supported using an XML-based .dtsConfig file which can be read into the package at run-time. There is a GUI within SSDT/BIDS that will lead you through the process of creating the file and telling it which package properties you want it to be able to configure.
A word of caution
Be careful when you're trying to SAVE sensitive information inside SSIS packages. There is a property named PackageProtectionLevel which can be set at the project and package level. By default, it is set to EncryptSensitiveWithUserKey. Now, don't let this property trick you into thinking the entire package is encrypted. It is not. This setting specifically refers to how SSIS will handle properties that are typed as sensitive. For example, the passwords in the connection managers are typed as sensitive information. SSIS will encrypt that field so that it doesn't store passwords in plain text. But it ONLY pertains to saving/storing the package. You can pass in plain text through a variable or configuration file that will be read into a sensitive field (like a password) at run-time.
If you need to be able to save a password with the package you've developed, I would recommend changing the PackageProtectionLevel to EncryptSensitiveWithPassword and setting it to something your team is able to remember or uses to protect other assets. Once that setting is in place, you will be able to check the "Save Password" box within the connection manager and have that go where ever the package goes. If you don't need to save that password with the package, change the property to DontSaveSentitive. Like I mentioned, you can still pass in credentials through configurations or other means, but it won't be stored INSIDE the package itself.

How do I read project connections in ssis from SQL Server Agent Job?

I am trying to run my SSIS Package via SQL Server Agent Jobs. In the SSIS Project I have Connections to My SQL Database as PROJECT Connections. I have set them up like this as all Packages call this connection. However when running it in SQL Server Agent I get error saying:
The connection "{}" is not found. This error is thrown by Connections collection when the specific connection element is not found.
It obviously can't locate the connection so how do I do this ? - The package executes successfully when executed via Visual Studio.
Many Thanks In Advance !
Bal
First, you need to create an Integration Services Catalog on your server instance. You will deploy your packages to the catalog.
A best practice for specifying the server in your connection managers is to use a single period, which references the local machine. That way, when you deploy your packages, the local machine will always be used:
After you've created your package(s) with project-level connections, you need to deploy the project. Right-click the project folder in SQL Server Data Tools/BIDS, then click Deploy. In the deployment wizard, specify the destination server (or just use "." again to deploy to the local instance) and the Integration Services (IS) Catalog folder:
Once deployed to your SQL Server instance's IS Catalog, you can set the Package Source in the Job Step Properties to "SSIS Catalog" and select the package that you deployed.
If you're exporting/importing to/from files, you'll want to ensure that the SQL Server Agent Service Account has appropriate rights to the folder where files are imported/exported. The easiest way to do that is to create a credential (usually a Windows user account), then create a SQL Server Agent Proxy that uses the credential, and then specify that proxy in the job step's Run as field.
Here's what your Job Step Properties window would look like after following all of the steps above:
The job should then run successfully.
FYI, you can also execute the package directly from the SSIS Catalog. Simply drill down into the Integration Services Catalog node of your server | right-click the package | click Execute....
Helpful Links
Schedule a Package by using SQL Server Agent
SSIS Tutorial: Deploying Packages
If you setup your configurations on the configurations tab in the Step properties of the SQL Server Job that should allow you to accomplish what you asked.

Issues in running SSIS package over multiple server hops

I am new to SSIS and am facing an issue with reading a File from a remote server
I have a Flat File Connection defined at the Project level where the ConnectionString is defined by a variable say #AbsoluteFilePath.
The value of #AbsoluteFilePath is calculated at run-time to a UNC say :
\\myserver\myfolder\myfile.txt
I have a Web Application which invokes execution of the package.
I am able to view the file folder as a logged in user however the execution of the package ends in an error while reading the file.
The execution fails with error message of return code 0XC020200E
I tried mapping my UNC \\myserver\myfolder to Z: on the machine where SQL 2012 is running. However this too gives me the same error.
Is using UNC advisible in SSIS ? What is the standard way of doing this task ?
Following is the complete workflow I am trying to achieve :
Complete Picture
User picks a file on the web front end. the web application saves the
file at a shared drive and invokes the SSIS package to run. the SSIS
package reads the file from the shared drive and performs required
action it.
Update : Explaining Permissions and running SSIS package from stored procedure
Web Application X runs on a server server-web
SSIS package Y runs on a server server-ssis
accesses database on a server server-database
accesses UNC where on a server server-filesystem
The package is being run by executing a stored procedure by running a stored procedures mentioned here http://msdn.microsoft.com/en-us/library/ff878099.aspx
the connection string used by server-web is of the form
Data Source=server-ssis;Initial Catalog=SSISDB;Integrated Security=SSPI;
I'd bet dollars to dumplin's this is a permissions issue (besides the fact a search for 0XC020200E yields hits on file permissions).
Check the permissions for the account that is running the web application. It needs to be granted permissions to the share. It works with your account or the logged in user but that is probably not the same account that is running the package.
#user1826905 you were right, using a SQL Agent Job to invoke the SSIS package proved to be the simplest way of invoking the SSIS package from a web application.
This link http://msdn.microsoft.com/en-us/library/ms403355.aspx gives out two different way of invoking SSIS packages
using SQL Agent Job
using a web service
There is a third way of invoking SSIS which I was trying using stored procedures http://msdn.microsoft.com/en-us/library/ff878099.aspx but has an issue when working across multiple server hops kerberos delegation explained here
We are still struggling over using this approach to access the UNC due to accessing changing to Anonymous user after the hop

Running SSIS Packages that are saved on the SQL Server vs. running packages saved as dtsx (XML)

When I run VS2008 locally and open up a package that points to a remote database and run, I believe that the data, from the input file to the db server, is running through my PC, even if the data file is on the database server.
However, if the SSIS package is stored in SQL Server and I start the job through SQL Agent, my PC is out of the picture and that data does not flow through my PC and so I should get see a signatificant performance boost.
Is this the case? I just want to confirm. Currently, I do not have permission to save a Package on our development server and I am considering requesting rights to be able to do for the above reason provided that it is a valid reason.
What kind of access does one have to have to be able to save SSIS Packages on a SQL Server? Might there be a reason to deny me rights to do so perhaps because granting me such access would require giving an elevated access level that would also allow me to do other things that the DBA might not want me to do? As a developer, I think that I should be able to shuffle data from UAT, or so iother non production env into a DEV database without having to request that a DBA do it when he gets around to it.
Your understanding of where the package executes is correct, and performance will certainly be improved by moving execution to the server. At least, it will be if the server has more system resources than your workstation, especially RAM. And avoiding using the network unnecessarily is helpful too, of course.
There are specific roles created in the msdb database for managing SSIS packages so your DBA can let you deploy and run them without making you a sysadmin. However, as the documentation says, there is a possible privilege escalation issue if you run the packages from jobs so the recommended solution is to create a proxy account.