What is the Azure CLI command to create a new storage account?
Use az storage account create with parameters like --name, --resource-group, and --location to create a new storage account.
Click to reveal answer
beginner
How do you list all containers in an Azure Storage account using CLI?
Use az storage container list with the storage account name and key or connection string to list all containers.
Click to reveal answer
beginner
Which command uploads a file to an Azure Blob container?
Use az storage blob upload specifying the container name, file path, and blob name.
Click to reveal answer
intermediate
How can you generate a Shared Access Signature (SAS) token for a storage account?
Use az storage account generate-sas with permissions, expiry time, and resource types to create a SAS token.
Click to reveal answer
beginner
What command deletes a blob from a container in Azure Storage?
Use az storage blob delete with the container name and blob name to remove a blob.
Click to reveal answer
Which Azure CLI command lists all blobs in a container?
Aaz storage blob list
Baz storage container list
Caz storage account list
Daz storage blob upload
✗ Incorrect
The command az storage blob list lists blobs inside a specified container.
What parameter is required to specify the storage account when using Azure storage CLI commands?
A--location
B--resource-group
C--subscription
D--account-name
✗ Incorrect
The --account-name parameter specifies which storage account the command targets.
How do you authenticate Azure CLI storage commands without using account keys?
AUse a SAS token only
BUse a connection string only
CUse Azure Active Directory (AAD) login
DUse a storage account key only
✗ Incorrect
Azure CLI supports authentication via Azure Active Directory login for storage commands.
Which command uploads a local file to Azure Blob Storage?
Aaz storage blob upload
Baz storage container create
Caz storage blob delete
Daz storage account create
✗ Incorrect
The az storage blob upload command uploads files to blob containers.
What does the az storage container create command do?
ADeletes a storage account
BCreates a new container in a storage account
CLists all blobs in a container
DUploads a blob to a container
✗ Incorrect
It creates a new container inside an Azure Storage account.
Explain how to upload a file to Azure Blob Storage using CLI commands.
Think about the command and required parameters.
You got /5 concepts.
Describe the steps to create a new storage account and a container inside it using Azure CLI.
Start with the storage account, then container.
You got /3 concepts.
Practice
(1/5)
1. What does the Azure CLI command az storage account create do?
easy
A. Lists all storage accounts in your subscription
B. Deletes an existing storage account
C. Creates a new storage account in Azure
D. Uploads a file to a storage container
Solution
Step 1: Understand the command purpose
The command az storage account create is used to create a new storage account in Azure.
Step 2: Compare with other options
Other options describe deleting, listing, or uploading, which are different commands.
Final Answer:
Creates a new storage account in Azure -> Option C
Quick Check:
Create storage account = Creates new account [OK]
Hint: Create means make new storage account [OK]
Common Mistakes:
Confusing create with delete
Thinking it lists accounts
Mixing upload with account creation
2. Which of the following is the correct syntax to list blobs in a container using Azure CLI?
easy
A. az storage account list --container mycontainer
B. az storage blob list --container-name mycontainer
C. az storage blob upload --container mycontainer
D. az storage container list --blob-name myblob
Solution
Step 1: Identify the command to list blobs
The command to list blobs is az storage blob list with the container name specified.
Step 2: Check option syntax correctness
az storage blob list --container-name mycontainer uses correct command and parameter --container-name. Other options misuse commands or parameters.
Final Answer:
az storage blob list --container-name mycontainer -> Option B
Quick Check:
List blobs = az storage blob list [OK]
Hint: List blobs uses 'az storage blob list' with container name [OK]
Common Mistakes:
Using container list instead of blob list
Mixing upload command with list
Wrong parameter names
3. What will be the output of the following command if the container photos has three blobs named img1.jpg, img2.jpg, and img3.jpg?
az storage blob list --container-name photos --output table
medium
A. A table listing img1.jpg, img2.jpg, img3.jpg blobs
B. An error saying container not found
C. A list of storage accounts
D. An empty list with no blobs
Solution
Step 1: Understand the command and container contents
The command lists blobs in the container named 'photos'. The container has three blobs: img1.jpg, img2.jpg, img3.jpg.
Step 2: Predict the output format
The --output table option formats the output as a table showing blob names.
Final Answer:
A table listing img1.jpg, img2.jpg, img3.jpg blobs -> Option A
Quick Check:
List blobs with table output = table of blob names [OK]
Hint: List blobs shows all files in container as table [OK]
Common Mistakes:
Expecting error when container exists
Confusing blobs with storage accounts
Assuming empty output incorrectly
4. You run the command az storage blob upload --container-name docs --file report.pdf but get an error. What is the most likely cause?
medium
A. The file report.pdf does not exist locally
B. The command syntax is incorrect
C. The container docs does not exist
D. Missing the storage account connection string or credentials
Solution
Step 1: Check command requirements
The upload command requires authentication details like connection string or account key to access storage.
Step 2: Analyze common error causes
Missing credentials is the most common cause of upload failure, even if file and container exist.
Final Answer:
Missing the storage account connection string or credentials -> Option D
Quick Check:
Upload error usually means missing credentials [OK]
Hint: Upload needs credentials; missing them causes errors [OK]
Common Mistakes:
Assuming file missing without checking
Ignoring authentication requirements
Thinking syntax is wrong when it is correct
5. You want to automate backing up files from your local folder backup to an Azure blob container named backup-container. Which sequence of commands correctly achieves this?
hard
A. 1) az storage container create --name backup-container
2) az storage blob upload-batch --source backup --destination backup-container
B. 1) az storage account create --name backup-container
2) az storage blob upload --file backup
C. 1) az storage blob list --container-name backup-container
2) az storage blob download --container-name backup-container
D. 1) az storage container delete --name backup-container
2) az storage blob upload-batch --source backup --destination backup-container
Solution
Step 1: Create the container if it does not exist
The command az storage container create creates the container named 'backup-container'.
Step 2: Upload all files from local folder to container
The command az storage blob upload-batch uploads all files from the local 'backup' folder to the container.
Final Answer:
1) az storage container create --name backup-container
2) az storage blob upload-batch --source backup --destination backup-container -> Option A
Quick Check:
Create container then batch upload = backup done [OK]
Hint: Create container first, then upload batch files [OK]
Common Mistakes:
Trying to upload without container
Confusing account creation with container
Deleting container before upload
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.