question

stephenclover-5458 avatar image
0 Votes"
stephenclover-5458 asked SeeyaXi-msft edited

SQL Agent Powershell step running as proxy 'loses' stored credential

When I run a SQL Agent Powershell step 'as' a proxy credential (a domain service account), the credential which has been associated with the service account on the server is not accessible. The credential is for use to access an Azure fileshare.

The proxy is enabled for:
- Operating System (CmdExec)
- SSIS Package Execution
- PowerShell

To reproduce (names of resources have been sanitised):
1. Associate a stored credential for the fileshare with the proxy credential service account:
172304-image.png

  1. Do the same for the SQL Agent service account:
    172305-image.png

  2. Set up a SQL Agent job with two steps which do the same thing, one running as the proxy credential and one as SQL Agent:
    172356-image.png
    172228-image.png

  3. Run the job.

Here's the output:
Step 1: Executed as user: DOMAIN_svc_MyCredential. domain_svc_mycredential Currently stored credentials: NONE . Process Exit Code 0. The step succeeded.
Step 2. Executed as user: DOMAIN_svc_SQLAgent. domain_svc_sqlagent Currently stored credentials: Target: Domain:target=azurefilesharename.file.core.windows.net Type: Domain Password User: fileshareuser. Process Exit Code 0. The step succeeded.


I can't find anything online to explain why the stored credential is not available to the step running as the proxy credential account.





windows-server-powershell
image.png (7.9 KiB)
image.png (7.3 KiB)
image.png (7.6 KiB)
image.png (7.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers