The user that’s set for your connection will be dictated by the contents of your connection string used in the SQL - Execute Script file step.
It has a parameter called
ConnectionString. In the help text, there is an example which uses Integrated Security e.g.:
This instructs the connection to take the user context from the process running the script, which in the case of an Octopus tentacle, would be the service account running the Windows Service.
If you don’t wish to use Integrated Security, you can provide a SQL username and password in the connection string. For example;
Where myUsername and myPassword would be replaced with the credentials you want to provide. If you’re using SQL authentication like this, then I’d recommend considering placing the password as a sensitive variable in Octopus so that it’s not shown in logs or in plain text.
Alternatively, if you want to use Windows Authentication, then you’d need to change the service account that the tentacle Windows Service is running as to one which has access to the SQL Server in question.
I hope that helps!