The correct answer is to run `az storage account update --name mystorageaccount --resource-group myResourceGroup --https-only true`. This command works because it sets the `supportsHttpsTrafficOnly` property on the storage account to true, which enforces HTTPS by rejecting any HTTP requests and ensuring all traffic is encrypted in transit. On the Microsoft Azure Developer Associate AZ-204 exam, this scenario tests your understanding of secure transfer settings for Azure Storage, often appearing as a configuration step after account creation. A common trap is confusing this with the Azure portal toggle or assuming the setting is enabled by default, but it must be explicitly applied via CLI, PowerShell, or the portal. Remember the memory tip: “HTTPS only, no HTTP” — the `--https-only true` flag is the direct CLI parameter that locks down the endpoint, so if you see a question about enforcing HTTPS for an Azure Storage account, look for that exact flag in the command options.
AZ-204 Develop for Azure storage Practice Question
This AZ-204 practice question tests your understanding of develop for azure storage. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. 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. The following is an Azure CLI command and its output:
az storage account show \
--name mystorageaccount \
--resource-group myResourceGroup \
--query "{kind:kind, accessTier:accessTier, supportsHttpsTrafficOnly:supportsHttpsTrafficOnly}"
Output:
{
"kind": "StorageV2",
"accessTier": "Cool",
"supportsHttpsTrafficOnly": false
}
You have an Azure Storage account configured as shown in the exhibit. You need to ensure that all traffic to the storage account uses HTTPS. Which Azure CLI command should you run next?
Refer to the exhibit. The following is an Azure CLI command and its output:
az storage account show \
--name mystorageaccount \
--resource-group myResourceGroup \
--query "{kind:kind, accessTier:accessTier, supportsHttpsTrafficOnly:supportsHttpsTrafficOnly}"
Output:
{
"kind": "StorageV2",
"accessTier": "Cool",
"supportsHttpsTrafficOnly": false
}
A
az storage account create --name mystorageaccount --resource-group myResourceGroup --https-only true
Why wrong: This command creates a new storage account, does not update existing.
B
az storage account update --name mystorageaccount --resource-group myResourceGroup --secure-transfer-required true
Why wrong: Correct parameter for secure transfer is '--https-only'.
C
az storage account update --name mystorageaccount --resource-group myResourceGroup --enable-https-traffic-only true
Why wrong: Incorrect parameter; correct is '--https-only'.
D
az storage account update --name mystorageaccount --resource-group myResourceGroup --https-only true
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
az storage account update --name mystorageaccount --resource-group myResourceGroup --https-only true
Option D is correct because the `az storage account update` command with the `--https-only true` parameter enforces HTTPS for all traffic to the storage account by setting the `supportsHttpsTrafficOnly` property to true. This is the specific Azure CLI parameter that controls this setting, and it must be applied after account creation. The command directly meets the requirement to ensure all traffic uses HTTPS.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
az storage account create --name mystorageaccount --resource-group myResourceGroup --https-only true
Why it's wrong here
This command creates a new storage account, does not update existing.
✗
az storage account update --name mystorageaccount --resource-group myResourceGroup --secure-transfer-required true
Why it's wrong here
Correct parameter for secure transfer is '--https-only'.
✗
az storage account update --name mystorageaccount --resource-group myResourceGroup --enable-https-traffic-only true
Read the scenario before looking for a memorised answer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often confuse the `--https-only` parameter with `--secure-transfer-required` or `--enable-https-traffic-only`, which are not valid Azure CLI parameters for the `az storage account update` command, leading them to choose incorrect options that sound plausible but do not exist in the CLI syntax.
Trap categories for this question
Command / output trap
This command creates a new storage account, does not update existing.
Detailed technical explanation
How to think about this question
The `--https-only` parameter sets the `supportsHttpsTrafficOnly` property on the storage account, which when enabled, rejects any HTTP requests and only allows HTTPS traffic. This is enforced at the Azure Storage service level by checking the protocol in the incoming request's URL scheme. In a real-world scenario, this is critical for compliance with security policies like PCI DSS or HIPAA, and it can be combined with Azure Policy to audit or enforce HTTPS-only across all storage accounts in a subscription.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this AZ-204 question in full detail.
Develop for Azure storage — This question tests Develop for Azure storage — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: az storage account update --name mystorageaccount --resource-group myResourceGroup --https-only true — Option D is correct because the `az storage account update` command with the `--https-only true` parameter enforces HTTPS for all traffic to the storage account by setting the `supportsHttpsTrafficOnly` property to true. This is the specific Azure CLI parameter that controls this setting, and it must be applied after account creation. The command directly meets the requirement to ensure all traffic uses HTTPS.
What should I do if I get this AZ-204 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
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 AZ-204 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 AZ-204 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.