संपादित करें

इसके माध्यम से साझा किया गया


Get storage account configuration information

This article shows how to get configuration information and properties for an Azure Storage account by using the Azure portal, PowerShell, or Azure CLI.

Get the resource ID for a storage account

Every Azure Resource Manager resource has an associated resource ID that uniquely identifies it. Certain operations require that you provide the resource ID. You can get the resource ID for a storage account by using the Azure portal, PowerShell, or Azure CLI.

To display the Azure Resource Manager resource ID for a storage account in the Azure portal, follow these steps:

  1. Navigate to your storage account in the Azure portal.

  2. On the Overview page, in the Essentials section, select the JSON View link.

  3. The resource ID for the storage account is displayed at the top of the page.

    Screenshot showing how to copy the resource ID for the storage account from the portal

You can also get the resource ID for a storage account by calling the Storage Accounts - Get Properties operation in the REST API.

For more information about types of resources managed by Azure Resource Manager, see Resource providers and resource types.

Get the account type, location, or replication SKU for a storage account

The account type, location, and replication SKU are some of the properties available on a storage account. You can use the Azure portal, PowerShell, or Azure CLI to view these values.

To view the account type, location, or replication SKU for a storage account in the Azure portal, follow these steps:

  1. Navigate to your storage account in the Azure portal.

  2. Locate these properties on the Overview page, in the Essentials section

    Screenshot showing account configuration in the portal

Get service endpoints for the storage account

The service endpoints for a storage account provide the base URL for any blob, queue, table, or file object in Azure Storage. Use this base URL to construct the address for any given resource.

To get the service endpoints for a storage account in the Azure portal, follow these steps:

  1. Navigate to your storage account in the Azure portal.

  2. In the Settings section, locate the Endpoints setting.

  3. On the Endpoints page, you'll see the service endpoint for each Azure Storage service, as well as the resource ID.

    Screenshot showing how to retrieve service endpoints for a storage account.

If the storage account is geo-replicated, the secondary endpoints will also appear on this page.

Get a connection string for the storage account

You can use a connection string to authorize access to Azure Storage with the account access keys (Shared Key authorization). To learn more about connection strings, see Configure Azure Storage connection strings.

Important

Your storage account access keys are similar to a root password for your storage account. Always be careful to protect your access keys. Use Azure Key Vault to manage and rotate your keys securely. Avoid distributing access keys to other users, hard-coding them, or saving them anywhere in plain text that is accessible to others. Rotate your keys if you believe they may have been compromised.

Microsoft recommends using Microsoft Entra ID to authorize requests against blob, file, and queue data if possible, rather than using the account keys (Shared Key authorization). Authorization with Microsoft Entra ID provides superior security and ease of use over Shared Key authorization. For more information, see Authorize access to data in Azure Storage or Authorize access to file data in the Azure portal.

To get a connection string in the Azure portal, follow these steps:

  1. Navigate to your storage account in the Azure portal.
  2. In the Security + networking section, locate the Access keys setting.
  3. To display the account keys and associated connection strings, select the Show keys button at the top of the page.
  4. To copy a connection string to the clipboard, select the Copy button to the right of the connection string.

Get the creation time of the account access keys for a storage account

If the keyCreationTime property of one or both of the account access keys for a storage account is null, then you will need to rotate the keys before you can configure a key expiration policy or a SAS expiration policy. You can check the keyCreationTime for a storage account by using the Azure portal, PowerShell, or Azure CLI.

To display the creation time of the account access keys for a storage account in the Azure portal, follow these steps:

  1. Navigate to your storage account in the Azure portal.

  2. On the Overview page, in the Essentials section, select the JSON View link.

  3. On the Resource JSON page, select the most recent API version.

  4. In the JSON under properties you will see the keyCreationTime for key1 and key2.

    Screenshot of the JSON View of a storage account showing one account access key with null values and another with a date and time stamp.

You can also get the keyCreationTime for a storage account by calling the Storage Accounts - Get Properties operation in the REST API.

Next steps