Permissions Issue running SSIS package from Sql Job - sql-server-2008

I have an SSIS package deployed to Sql Server 2008. This package runs fine in BIDS as well as from the server within the stored packages directory. As soon as i tie this package to a sql job i start to see permission issues accessing a specific file from within the SSIS package. So through my research i see that using a proxy account may be the solution to my problems. These are the steps i have taken so far:
Setup an Active Directory User Account
Under Security - Credentials - Created a Credential Tied to the account in step 1.
Under Sql Server Agent - Proxies - SSIS Package Execution - Created a proxy tied to the credential above and selected the "SQL Server Integration Services Package" check box.
Created a login with roles "SQLAgentOperatorRole", "SQLAgentReaderRole", "SQLAgentUserRole" and "Public" on the msdb database.
Create job to run my SSIS package. Job owner is tied to the login created in step 4. Under the step properties of my job i set the type to "Sql Server Integration Services Package" and the Run as option to my proxy account created in step 3 and pointed it to my SSIS package.
Gave Full control to the account from step 1 access to the folder/file that the SSIS package is pointing to.
When i kick the job off i continually get and error:
Executed as user: "Account from step 1" - Could not load package. Login Failed for user: "Account from step 1". The package could not be loaded.
What step could i be missing to accomplish this task?
Thank you for you time,
Billy

Figured this one out. Resolved by setting up the same AD account as a login on sql sever with the same login roles as those above in step 4.
Hope this helps someone.

Have you looked at the windows services to see the account that runs the SQL Server Agent? If that login (the one that runs the service) has sufficient rights to run a query on the database then you could just change the service login to yours (for testing purpose). Once thats done, restart the service and give it a try.
Let us know what you find.

Related

SSIS Connection Manager using service account

How do I specify my SSIS package to use a domain service account when deployed and called from an Agent Job?
The Connection Manager is set to use [Windows Authentication], so I think it is using my windows credentials during development. However I want the package to use a domain service account with a non-expiring password when running as a Job on SQL Server.
How can I do this? Thanks for any guidance.
You or your DBA should do the following on the SQL Server:
Create a SQL Credential for a desired Domain Account.
Create a SQL Agent Proxy of type SSIS Package Execution and bind it to the Credential created.
On the SQL Job step - specify created Proxy in Run As: dropdown
These steps allows to run specified SSIS Package under account of the SQL Credential.
Here is a good sample on how to set it up.

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.

Why wouldn't SSIS package running in SQL Server Agent job transfer files to a network folder?

I've run into this twice now where I can run my SSIS package in BIDS and Integration Services but it fails when it's run through SQL Server Agent. Both of these packages transfer a file as a final step to a folder on our network.
The error I receive is Could not find a part of the path then the path and file name. When I schedule them in Windows Task Scheduler they execute fine but I'd rather have them run through sql server agent.
Has anyone run into this issue and found a work around? Is there a setting that I'm missing in sql server?
Any help would be appreciated.
You need to run the SQL Server job using a proxy account that is configured to run jobs of type SQL Server Integration Services Packages. The jobs usually run under SQL Server Agent Service account, which does not have access to network folders. To access network folders, you need to set up a proxy with a domain account credentials (preferably) so you can access network path.
Below answer in SO question has the detailed steps on how to set up a proxy account
How do I create a step in my SQL Server Agent Job which will run my SSIS package?

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