Create Azure Resource for Azure Table Storage | DP-900 Exam Study Guide

Create an Azure Resource for Azure Table Storage

Question

You need to create an Azure resource to store data in Azure Table storage.

Which command should you run?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D

https://docs.microsoft.com/en-us/cli/azure/storage/container?view=azure-cli-latest

The correct answer is D. az storage container create.

Explanation:

Azure Table storage is a NoSQL key-value store that allows you to store large amounts of structured data. To store data in Azure Table storage, you need to create a storage account and then create a container within that account. You can use the Azure CLI command az storage container create to create a container in Azure Table storage.

Here's how you can create a container using the Azure CLI:

  1. Install the Azure CLI on your local machine.

  2. Open a command prompt or terminal window.

  3. Log in to your Azure account using the Azure CLI. Run the following command and follow the prompts:

    az login
  4. Create a storage account using the following command. Replace <resource-group-name> and <storage-account-name> with your own values:

    lua
    az storage account create \ --name <storage-account-name> \ --resource-group <resource-group-name> \ --location <location> \ --sku Standard_LRS \ --kind StorageV2

    This command creates a new storage account in the specified resource group and location. The --sku parameter specifies the performance tier of the storage account, and --kind specifies the type of storage account.

  5. Once you have created a storage account, you can create a container within that account using the following command:

    lua
    az storage container create \ --name <container-name> \ --account-name <storage-account-name> \ --account-key <storage-account-key>

    Replace <container-name>, <storage-account-name>, and <storage-account-key> with your own values. The <storage-account-key> is a secret key that provides access to the storage account.

  6. After running the command, you should see output similar to the following:

    json
    { "created": true }

    This indicates that the container was created successfully.

In summary, to create an Azure resource to store data in Azure Table storage, you need to create a storage account using the az storage account create command, and then create a container within that account using the az storage container create command.