nerdexam
Microsoft

DP-300 · Question #416

Drag and Drop Question You have an Azure subscription that contains a SQL Server on Azure virtual Machines instance named SQLVM1. You need to ensure that SQL Server Agent jobs on SQLVM1 can run…

The correct answer is USE msdb; CREATE CREDENTIAL; EXEC dbo.sp_add_proxy; EXEC dbo.sp_grant_login_to_proxy; EXEC dbo.sp_grant_proxy_to_subsystem. To enable SQL Server Agent jobs to run operating system (CmdExec) commands, you must create a proxy account in the msdb database, which is the system database that SQL Server Agent uses. The correct sequence is: switch to msdb context, create a credential (which stores the…

Submitted by ricky.ec· Mar 6, 2026Implement a secure environment for database solutions - specifically configuring SQL Server Agent proxies and credentials to control job step execution security contexts on SQL Server running on Azure Virtual Machines.

Question

Drag and Drop Question You have an Azure subscription that contains a SQL Server on Azure virtual Machines instance named SQLVM1. You need to ensure that SQL Server Agent jobs on SQLVM1 can run operating system commands. Which four T-SQL statements should you execute in sequence? To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order. Answer:

Exhibit

DP-300 question #416 exhibit

Answer Area

Drag items

USE masterCREATE CREDENTIALEXEC dbo.sp_grant_login_to_proxyEXEC dbo.sp_grant_proxy_to_subsystemUSE msdbEXEC dbo.sp_add_proxy

Correct arrangement

  • USE msdb
  • CREATE CREDENTIAL
  • EXEC dbo.sp_add_proxy
  • EXEC dbo.sp_grant_login_to_proxy
  • EXEC dbo.sp_grant_proxy_to_subsystem

Explanation

To enable SQL Server Agent jobs to run operating system (CmdExec) commands, you must create a proxy account in the msdb database, which is the system database that SQL Server Agent uses. The correct sequence is: switch to msdb context, create a credential (which stores the Windows account credentials the proxy will run as), create the proxy linked to that credential using sp_add_proxy, grant a login access to use the proxy with sp_grant_login_to_proxy, and finally grant the proxy permission to the CmdExec subsystem using sp_grant_proxy_to_subsystem. This sequence is mandatory because each step depends on the previous one - the proxy cannot exist without a credential, and subsystem/login grants cannot be made without an existing proxy.

Topics

#SQL Server Agent#Proxy Accounts#T-SQL Administration#Azure SQL on VMs

Community Discussion

No community discussion yet for this question.

Full DP-300 Practice