SPRZEDAŻ: 1-800-867-1389
EN
Ta zawartość nie jest dostępna w wymaganym języku. Wersja w języku angielskim znajduje się tutaj.

Browsing Storage Resources with Server Explorer

Updated: August 13, 2014

If you've installed the Azure Tools for Microsoft Visual Studio, you can view blob, queue, and table data from your storage accounts for Azure. By using the Azure Storage node in Server Explorer, you can display data from your local storage emulator account and also from storage accounts that you've created for Azure.

To view Server Explorer in Visual Studio, on the menu bar, choose View, Server Explorer. Any Azure storage accounts to which you've connected appear below the Azure Storage node. If your storage account doesn't appear, you can add it by following the instructions at the end of this topic.

noteNote
Server Explorer is automatically configured to display blobs, queues, and tables in your storage emulator account. To see these resources, expand the (Development) node underneath the Azure Storage node. If the storage emulator has not been started when you expand the (Development) node, it will be started. This can take several seconds. You can continue to work in other areas of Visual Studio while the storage emulator starts.

To view resources in your storage account, expand the node for that account in Storage Explorer. The following nodes will be displayed:

  • Blobs

  • Queues

  • Tables

The Blobs node displays a list of containers for the selected storage account.

  1. To create a blob container, open the shortcut menu for the Blobs node, and then choose Create Blob Container.

  2. Enter the name of the new container in the Create Blob Container dialog box and then choose Ok.

    Adding a new blob container
    noteNote
    The blob container name must begin with a number (0-9) or lowercase letter (a-z).

  3. To delete a blob container, open the shortcut menu for the blob container you want to remove and then choose Delete.

  4. To view the contents of a blob container, open the shortcut menu for the blob container and then choose View.

  • To display a list of the items contained in a blob container, open the shortcut menu for a blob container name in the list and then choose View Blob Container.

    VST_SE_BlobDesigner

    When you view the contents of a blob container, it appears in a tab known as the blob container view. You can perform the following operations on blobs by using the buttons in the top-right corner of the blob container view:

    • Enter a filter value and apply it

    • Refresh the list of blobs in the container

    • Upload a file

    • Delete a blob

    • Open a blob

    • Save a blob to the local computer

    When you select a blob, its properties appear in the Properties window. These properties are updated with the most recent value from the Blob service only if the container is refreshed.

  • You can filter the blobs that are displayed by specifying a common prefix. For example, if you enter the prefix Hello in the filter text box and then choose the Execute button, only blobs that begin with Hello appear.

    VST_SE_FilterBlobs
    noteNote
    The filter field is case-sensitive and doesn’t support filtering with wildcard characters. Blobs can only be filtered by prefix. The prefix may include a delimiter if you are using a delimiter to organize blobs in a virtual hierarchy. For example, filtering on the prefix HelloFabric/ returns all blobs beginning with that string. See Enumerating Containers and Blobs for more information about how to use prefixes and delimiters to filter a list of blobs.

  • Open the shortcut menu for one or more blobs and then choose Open, or choose the blob name and then choose the Open button, or double-click the blob name.

    The progress of a blob download appears in the Azure Activity Log window. The blob opens in the default editor for that file type. If the operating system recognizes the file type, the file opens in a locally installed application; otherwise, you're prompted to choose an application that’s appropriate for the file type of the blob. The local file that’s created when you download a blob is marked as read-only.

    Blob data is cached locally and checked against the blob's last modified time in the Blob service. If the blob has been updated since it was last downloaded, it will be downloaded again; otherwise the blob will be loaded from the local disk.

    By default a blob is downloaded to a temporary directory. To download blobs to a specific directory, open the shortcut menu for the selected blob names and choose Save As. When you save a blob in this manner, the blob file is not opened, and the local file is created with read-write attributes.

  • Choose the Upload Blob button when the container is open for viewing in the blob container view.

    You can choose one or more files to upload, and you can upload files of any type. The Azure Activity Log shows the progress of the upload. For more information about how to work with blob data, see How to use the Azure Blob Storage Service in .NET.

  • If you are using Azure Diagnostics to log data from your Azure application and you have transferred logs to your storage account, you’ll see containers that were created by Azure for these logs. Viewing these logs in Server Explorer is an easy way to identify problems with your application, especially if it’s been deployed to Azure. For more information about Azure Diagnostics, see Collect Logging Data by Using Azure Diagnostics.

  • Open the blob’s shortcut menu and then choose Copy URL.

  • Select the blob and then choose the Open Blob button.

    The file is downloaded to a temporary location and opened on the local computer. You must upload the blob again after you make changes.

Storage services queues are hosted in a storage account and you can use them to allow your cloud service roles to communicate with each other and with other services by a message passing mechanism. You can access the queue programmatically through a cloud service and over a web service for external clients. You can also access the queue directly by using Server Explorer in Visual Studio.

When you develop a cloud service that uses queues, you might want to use Visual Studio to create queues and work with them interactively while you develop and test your code.

In Server Explorer, you can view the queues in a storage account, create and delete queues, open a queue to view its messages, and add messages to a queue. When you open a queue for viewing, you can view the individual messages, and you can perform the following actions on the queue by using the buttons in the top-left corner:

  • Refresh the view of the queue

  • Add a message to the queue

  • Dequeue the topmost message.

  • Clear the entire queue

The following image shows a queue that contains two messages.

Viewing a Queue

For more information about storage services queues, see How to: Use the Queue Storage Service. For information about the web service for storage services queues, see Queue Service Concepts. For information about how to send messages to a storage services queue by using Visual Studio, see Sending Messages to a Storage Services Queue.

WarningWarning
Storage services queues are distinct from service bus queues. For more information about service bus queues, see Service Bus Queues, Topics, and Subscriptions.

Expand the Tables node to see a list of tables for the storage account. To display the data in a table, open the shortcut menu for a table and then choose View Table. The table is organized by entities (shown in rows) and properties (shown in columns). For example, the following illustration shows entities listed in the Table Designer:

An Azure table in Solution Explorer

You can create tables by using Server Explorer. To create a table, open the shortcut menu for the Tables node, and then choose Create Table.

  • Open the shortcut menu for an entity (a single row) or a property (a single cell) and then choose Edit.

    Add or Edit a Table Entity

    Entities in a single table aren’t required to have the same set of properties (columns). Keep in mind the following restrictions on viewing and editing table data.

    • You can’t view or edit binary data (type byte[]), but you can store it in a table.

    • You can’t edit the PartitionKey or RowKey values, because table storage in Azure doesn't support that operation.

    • You can’t create a property called Timestamp, Azure Storage services use a property with that name.

    • If you enter a DateTime value, you must follow a format that's appropriate to the region and language settings of your computer (for example, MM/DD/YYYY HH:MM:SS [AM|PM] for U.S. English).

    To delete a table permanently, open the table’s shortcut menu, and then choose Delete.

  • Choose the Add Entity button, which is near the top-right corner of the table view.

    Add Entity

    In the Add Entity dialog box, enter the values of the PartitionKey and RowKey properties. Enter the values carefully because you can't change them after you close the dialog box unless you delete the entity and add it again.

    Add Entity Dialog Box

  1. You can customize the set of entities that appear in a table if you use the query builder. To open the query builder, open a table for viewing.

  2. Choose the rightmost button on the table view’s toolbar. The Query Builder dialog box appears.

    The following illustration shows a query that's being built in the query builder.

    Query Builder
  3. When you’re done building the query, close the dialog box. The resulting text form of the query appears in a text box as a WCF Data Services filter.

  4. To run the query, choose the green triangle icon.

    You can also filter entity data that appears in the Table Designer if you enter a WCF Data Services filter string directly in the filter field. This kind of string is similar to a SQL WHERE clause but is sent to the server as an HTTP request. For information about how to construct filter strings, see Constructing Filter Strings for the Table Designer.

    The following illustration shows an example of a valid filter string:

    VST_SE_TableFilter

When Server Explorer connects to or gets data from a storage account, it might take up to a minute for the operation to complete. If it can’t connect, the operation might time out. While data is retrieved, you can continue to work in other parts of Visual Studio. To cancel the operation if it’s taking too long, choose the Stop Refresh button on the Server Explorer toolbar.

  • Select the Blobs node beneath Azure Storage and choose the Refresh button on the Server Explorer toolbar. To refresh the list of blobs that is displayed, choose the Execute button.

  • Select the Tables node and choose the Refresh button. To refresh the list of entities that is displayed in the Table Designer, choose the Execute button on the Table Designer.

  • Choose the Queues node, and then choose the Refresh button.

  • Choose the account name, and then choose the Refresh button on the toolbar for Server Explorer.

There are two ways to add storage accounts by using Server Explorer. You can create a new storage account in your Azure subscription, or you can attach an existing storage account.

  1. Open the shortcut menu for the Storage node, and then choose Create Storage Account.

    Create a new Azure storage account
  2. Select or enter the following information for the new storage account in the Create Storage Account dialog box.

    • The Azure subscription to which you want to add the storage account.

    • The name you want to use for the new storage account.

    • The region or affinity group (such as West US or East Asia).

    • The type of replication you want to use for the storage account, such as Geo-Redundant.

  3. When you’re done, choose Create.

    The new storage account appears in the Storage list in Solution Explorer.

  1. In Server Explorer, open the shortcut menu for the Azure Storage node, and then choose Attach External Storage.

  2. Select or enter the following information for the new storage account in the Create Storage Account dialog box.

    • The name of the existing storage account you want to attach. You can enter a name or select it from the list.

    • The key for the selected storage account. This value is typically provided for you when you select a storage account. If you want Visual Studio to remember the storage account key, select the Remember account key box.

    • The protocol to use to connect to the storage account, such as HTTP, HTTPS, or a custom endpoint. See Configuring Azure Connection Strings for more information about custom endpoints.

    After you enter this information, Visual Studio creates a connection string to attach to the specified storage account. This connection string appears in the Preview connection string box.

  3. To remove a storage account from Server Explorer, open the shortcut menu for the account name, and then choose Delete. If you delete a storage account, any saved key information for that account is also removed.

    noteNote
    If you delete a storage account from Server Explorer, it doesn’t affect your storage account or any data that it contains; it simply removes the reference from Server Explorer. To permanently delete a storage account, use the Management Portal.

See Also

Czy oceniasz te materiały jako pomocne?
(Pozostało znaków: 1500)
Dziękujemy za opinię.
Pokaż:
© 2014 Microsoft