SQL Server Conda.exe failed to run, access is denied C:\Code\JiraData\ExecuteJiraExtract.ps1:31 char:1

e0bqpujr  于 2023-03-07  发布在  其他
关注(0)|答案(1)|浏览(66)

Situation I have a SSIS package that executes a Powershell script that runs a python script in Anaconda. When I execute the SSIS package from my user account it completes fine. When I deploy it to SQL server and execute from a service account it results in this error

PS>TerminatingError(): "Program 'conda.exe' failed to run: Access is deniedAt C:\Code\JiraData\ExecuteJiraExtract.ps1:31 char:1

I believe it may have to do with the difference in permissions between my account and the SQL server agent service account that is executing the script.

Does anyone have any idea if I can grant permissions to a program to access a file, or if there is a way to give the service account higher permissions? I suspect this is the issue.

Link to Powershell Script: https://pastebin.com/HHJi4Prw

conda activate jira
python C:\code\JiraData\ExtractAll.py --jql="ORDER BY created DESC" --start_index=0 --end_index=1000
conda deactivate
wsewodh2

wsewodh21#

Ended up figuring out the issue here.

It ran in my personal login because I had access to the Anaconda program folders including the envs folder that has the individual packages installed for each environment. The service account used a different login 'domain\srvc_dwssis'. To fix this issue I just needed to grant that account access to the Anaconda program folders.

I did this by right clicking the Anaconda program folder--> properties--> select security tab--> click Edit--> click Add--> click object types-->check service accounts (see pic)--> type in service account name and click check name--> then hit okay.

相关问题