The answer is that the script uses Out-GridView, which is unsupported in Azure Automation runbooks. This cmdlet attempts to display results in an interactive GUI window, but Azure Automation runs in a non-interactive sandbox environment with no desktop interface, so the command fails silently and produces no output. Since the alert logic depends on capturing that output to evaluate DTU usage, the condition is never met. On the DP-300 exam, this tests your understanding of Azure Automation’s execution constraints versus local PowerShell—a common trap is assuming all cmdlets behave identically in cloud runbooks. Remember that any cmdlet requiring user interaction, like Out-GridView or Read-Host, will break automation workflows. Memory tip: “Grid blocks the flow” — if it needs a screen, it won’t run in a runbook.
DP-300 Configure and manage automation of tasks Practice Question
This DP-300 practice question tests your understanding of configure and manage automation of tasks. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Refer to the exhibit.
```
Invoke-SqlCmd -ServerInstance 'myserver.database.windows.net' -Database 'mydb' -Query "SELECT * FROM sys.dm_db_resource_stats" -Credential $cred | Out-GridView
```
You are reviewing a PowerShell script that is part of an Azure Automation runbook. The script is intended to monitor resource usage of an Azure SQL Database and trigger an alert if DTU usage exceeds 80%. The script runs successfully but does not trigger the alert. What is the most likely reason?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "most likely"
Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The script uses Out-GridView, which is not supported in Azure Automation.
The script uses 'Out-GridView', which displays results in a GUI window. In Azure Automation, there is no interactive desktop, so the command fails silently or does not output anything. The alert logic likely depends on the output. Option B is wrong because 'Invoke-SqlCmd' works with Azure SQL Database if the credential has access. Option C is wrong because the 'Query' is valid. Option D is wrong because 'Out-GridView' does not block execution but prevents output from being captured.
Key principle: NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
The script must use the -OutputAs parameter to return results.
Why it's wrong here
The issue is not with output format but with Out-GridView.
✓
The script uses Out-GridView, which is not supported in Azure Automation.
Why this is correct
Out-GridView requires an interactive session and does not work in Azure Automation runbooks.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Static NAT maps one inside address to one outside address.
✗
The Invoke-SqlCmd cmdlet is not compatible with Azure SQL Database.
Why it's wrong here
Invoke-SqlCmd works with Azure SQL Database.
✗
The query syntax is incorrect for Azure SQL Database.
Why it's wrong here
The query is valid for Azure SQL Database.
Common exam traps
Common exam trap: NAT rules depend on direction and matching traffic
NAT is not only about the public address. The inside/outside interface roles and the ACL or rule that matches traffic are just as important.
Trap categories for this question
Command / output trap
The issue is not with output format but with Out-GridView.
Detailed technical explanation
How to think about this question
NAT questions usually test address translation, overload/PAT behaviour, static mappings and whether the right traffic is being translated. Read the interface direction and address terms carefully.
KKey Concepts to Remember
Static NAT maps one inside address to one outside address.
PAT allows many inside hosts to share one public address using ports.
Inside local and inside global describe the private and translated addresses.
NAT ACLs identify traffic for translation, not always security filtering.
TExam Day Tips
→Identify inside and outside interfaces first.
→Check whether the scenario needs static NAT, dynamic NAT or PAT.
→Do not confuse NAT matching ACLs with normal packet-filtering intent.
Key takeaway
NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.
Real-world example
How this comes up in practice
A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this DP-300 question in full detail.
Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related DP-300 NAT questions on configuration and troubleshooting.
Configure and manage automation of tasks — This question tests Configure and manage automation of tasks — Static NAT maps one inside address to one outside address..
What is the correct answer to this question?
The correct answer is: The script uses Out-GridView, which is not supported in Azure Automation. — The script uses 'Out-GridView', which displays results in a GUI window. In Azure Automation, there is no interactive desktop, so the command fails silently or does not output anything. The alert logic likely depends on the output. Option B is wrong because 'Invoke-SqlCmd' works with Azure SQL Database if the credential has access. Option C is wrong because the 'Query' is valid. Option D is wrong because 'Out-GridView' does not block execution but prevents output from being captured.
What should I do if I get this DP-300 question wrong?
Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related DP-300 NAT questions on configuration and troubleshooting.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
What is the key concept behind this question?
Static NAT maps one inside address to one outside address.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.