Azure SQL Managed Instance - Agent Jobs wont run - azure-sql-managed-instance

What's the 'trick' to run jobs on a Sql Managed Instance with Sql Server and Windows Auth enabled and login authentication set to Azure Active Dir - universal with MFA?
SQL Server Agent jobs created by our dba's are failing with
'Executed as user: DBC40\AasdfppEWawer. Login Failed. The login is from an untrusted domain and cannot be used with integrated authentication. [sqlstate 28000](Error 18452).'
Tried specifying the user to run the job under - same outcome
Tried specifying the user to run the step under - same outcome
We installed the OLA tools with no issues, those jobs run just fine.
rm

Related

SQL Server Agent job: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication

I am trying to execute an SSIS package from SQL Server Agent however receiving the error:
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
The job itself very simple, grabbing data from a table from server A into another database from Server B. and the connection manager is OLEDB.
This job has been executed many many times in the past without any issues, but just recently this error occurred. I also have another job (SSIS package) using the same connection manager, but that job is so far so good.
What am I missing? Any help would be greatly appreciated!

SSIS Deployment Error while deploying packages into SQL Server

I was Trying to deploy SSIS package from Visual studio 2019 into MS SQL Server 2016, I have been facing deployment error as shown below:
"“A .NET Framework error occurred during execution of user-defined routine or aggregate "deploy_project_internal": System.ComponentModel.Win32Exception: A required privilege is not held by the client.”
After few hours of debugging found that the error is actually from SQL Server. SQL Server is unable to run the stored procedure from SSISDB "[catalog].[check_schema_version] ".
Hence we realized that there are certain privileges for the current service account on which SQL Server is running. Hence we have created a new local admin account and provided all privileges.
• As per Microsoft suggestion, we have added the SQl server service account & SQL server integration service account in the below Configs :
o Edited DCOM config properties and provided granted the Local Launch and Local Activation permissions for the below component services
 Microsoft SQL Server Integration Services 11.0, Microsoft SQL Server Integration Services 12.0 and Microsoft SQL Server Integration Services 13.0
o Further we extended permissions for both the service accounts as below :
 Log on as a service .
 Permission to write to application event log.
 Impersonate a client after authentication.
 Adjust memory quotas for a process
Below are the two group policies yet to be added :
 Bypass traverse checking
 Replace a process-level token
I would like to know if this resolves the issue and please suggest anything that we are missing here to resolve the issue.
After adding the New service account to the listed group policies, the deployment got succeeded.
I ran into this problem after a new Security Policy was put in place that broke WinRM (disabled "Allow remote server management through WinRM"). Even after rolling back the change I could not deploy SSIS packages. I finally fixed the problem by running the "Repair" SQL option from the installation disk and then restarting the server. After that deployments worked as normal.

SQL Server Agent start and stop script which can be run by normal user not system admin

I have created couple of jobs in SQL Server Agent. Now I need to deploy these jobs on client machines. Client SQL Servers don't have system admin login.
What I want to do is to let normal SQL login (not system admin) users run the start and stop SQL Agent Service script.
You could create a stored procedure with execute as owner. That procedure will run as system admin and can start and stop jobs with sp_start_job.
You can then give normal users execute rights on the stored procedure. That will allow them to start/stop jobs.

Run SSIS package from SQL client

I deployed my working package on server which is enterprise edition, SSIS installed on it. When I tries to run package by connecting to integration services engine from my desktop SQL client (which doesn't have SSIS installed) I get error "The task "Send Mail Task" cannot run on this edition of Integration Services. It requires a higher level edition."
Does it mean that I need to login to the server (RDP) and then run the package?
Also, when I schedule the package thru SQL agent it fails saying login time out but my windos auth login works for everything from connecting, deployment. Any clue?
For your first problem - yes, you need to RDP into the server in order to use SSMS to start the package. When you start it using SSMS on your client, it's attempting to launch the DTExec process on your client machine. It's not running DTExec on the server.
Your second problem is likely a permissions issue. Possibility #1: The connections you have set up on your package require your authentication information, and they don't have it because they're running as the Agent account. You can fix that by creating a Proxy for your account and using that to run your job step. Possibility #2: The connections you have set up on your package are having their sensitive information stripped out due to the default encryption on the packages that prevents anyone but "you" from seeing it - including a SQL Agent job that isn't running "as you". The same resolution as above can help that (as well as others).

SQL Server agent job account issue

I am using SQL Server 2008. I am confused about which account will be used when a SQL Server agent job runs. My confusions are,
SQL Server agent as a Windows Service which we could control from Windows Service Management Console, from there we could set the account to run SQL Server Agent (LocalSystem in my computer);
Could I set SQL Server agent job level account to run on?
Could I set in each step which account SQL Server agent job step will run on?
I have above confusions because 3 different account systems may be used and my concern is what is the actual account each step will run on, and I want to avoid any permisson issues (i.e. I want to make sure the account have enough permission.). Any comments or advice? Appreciate anyone could clarify the 3 levels of accounts, which makes me very confused.
thanks in advance,
George
I would typically run the SQL Server Agent jobs under the same account as your app accesses the database.
If that account is too limited in its permissions (which might be a good thing!), I would create a single account for that app and all its SQL jobs (if that's possible) and run all SQL jobs under that account.
You could potentially run each step under a different account, but I wouldn't use that in general (it just makes it really hard to know and understand what is run under which account). Only use it if you have to run a particularly sensitive step that needs a bunch of extra permissions and those permissions are only available to a particular system account or something.
The account under which the SQL Server Agent windows service runs really doesn't have an impact on what your job steps will be run under.
So it boils down to really just two accounts:
one account is needed to run the SQL Server Agent Windows service - this is a Windows account on your machine / server which needs to have enough permissions to run the service, start and stop it - either use LocalSystem, Network Service, or whatever other Windows account you have to run services with
The other account would be the account to run your SQL Server Agent steps under - that's typically a SQL Server account (which could be based on a Windows account), and it needs enough privileges inside SQL Server to do its job, e.g. it needs access to the database objects and all. I would strive to have just one account for each app that runs the SQL Server jobs - makes life a whole lot easier!
Marc
PS: To set the user to run a step under, you need to use the "Advanced" page on the Job step property dialog and select the user from a popup window:
You can create Credentials in SQL Server (use Mgt Studio, under Security). Then create a Proxy in SQL Agent to use those credentials, telling it what kind of job steps can be used by the proxy. Then you get the choice to use that Proxy in the job step itself.
So... I make accounts for various SSIS packages to run under, so that I can keep the SQL Agent Service Account low privilege, and use a proxied credential with slightly higher privilege (not admin though, just enough permission to connect to other systems, including the File System).
Rob