通过 .NET SDK 开始使用 Azure Cosmos DB 表 API 和 Azure 表存储Get started with Azure Cosmos DB Table API and Azure Table storage using the .NET SDK

Tip

本文中的内容适用于 Azure 表存储和 Azure Cosmos DB 表 API。The content in this article applies to Azure Table storage and the Azure Cosmos DB Table API. Azure Cosmos DB 表 API 是表存储的高级产品,可提供吞吐量优化表、全局分发和自动辅助索引。The Azure Cosmos DB Table API is a premium offering for table storage that offers throughput-optimized tables, global distribution, and automatic secondary indexes.

可以使用 Azure Cosmos DB 表 API 或 Azure 表存储将结构化的 NoSQL 数据存储在云中,以便通过无架构设计提供密钥/属性存储。You can use the Azure Cosmos DB Table API or Azure Table storage to store structured NoSQL data in the cloud, providing a key/attribute store with a schema less design. 由于 Azure Cosmos DB 表 API 和表存储是无架构的,因此随着应用程序需求的发展,可以轻松调整数据。Because Azure Cosmos DB Table API and Table storage are schema less, it's easy to adapt your data as the needs of your application evolve. 可以使用 Azure Cosmos DB 表 API 或表存储来存储灵活的数据集,例如 Web 应用程序的用户数据、通讯簿、设备信息,或者服务需要的其他类型的元数据。You can use Azure Cosmos DB Table API or the Table storage to store flexible datasets such as user data for web applications, address books, device information, or other types of metadata your service requires.

本教程介绍了一个示例,展示如何将适用于 .NET 的 Azure Cosmos DB 表库用于 Azure Cosmo DB 表 API 和 Azure 表存储方案。This tutorial describes a sample that shows you how to use the Azure Cosmos DB Table Library for .NET with Azure Cosmo DB Table API and Azure Table storage scenarios. 必须使用特定于 Azure 服务的连接。You must use the connection specific to the Azure service. 这些方案使用 C# 示例进行讨论,说明了如何创建表、插入/更新数据、查询数据和删除表。These scenarios are explored using C# examples that illustrate how to create tables, insert/ update data, query data and delete the tables.

先决条件Prerequisites

若要成功完成此示例,需要以下项:You need the following to complete this sample successfully:

创建 Azure Cosmos DB 表 API 帐户Create an Azure Cosmos DB Table API account

  1. 在新浏览器窗口中,登录到 Azure 门户In a new browser window, sign in to the Azure portal.

  2. 在左侧导航窗格中,选择“创建资源”。In the left navigation pane, select Create a resource. 选择“数据库”,然后选择“Azure Cosmos DB”。Select Databases and then select Azure Cosmos DB.

    Azure 门户的屏幕截图,其中突出显示“更多服务”和“Azure Cosmos DB”

  3. 在“创建 Azure Cosmos DB 帐户”页中,输入新 Azure Cosmos DB 帐户的设置:On the Create Azure Cosmos DB Account page, enter the settings for the new Azure Cosmos DB account:

    设置Setting Value DescriptionDescription
    订阅Subscription 订阅Your subscription 选择要用于此 Azure Cosmos DB 帐户的 Azure 订阅。Select the Azure subscription that you want to use for this Azure Cosmos DB account.
    资源组Resource Group 新建Create new

    然后输入在 ID 中提供的同一唯一名称Then enter the same unique name as provided in ID
    选择“新建”。Select Create new. 然后输入帐户的新资源组名称。Then enter a new resource group name for your account. 为简单起见,可以使用与 ID 相同的名称。For simplicity, use the same name as your ID.
    帐户名Account Name 输入唯一的名称Enter a unique name 输入标识此 Azure Cosmos DB 帐户的唯一名称。Enter a unique name to identify your Azure Cosmos DB account.

    该 ID 只能使用小写字母、数字和连字符 (-) 字符。The ID can use only lowercase letters, numbers, and the hyphen (-) character. 长度必须在 3 到 31 个字符之间。It must be between 3 and 31 characters long.
    APIAPI Azure 表Azure Table API 确定要创建的帐户的类型。The API determines the type of account to create. Azure Cosmos DB 提供五种 API:适用于文档数据库的 Core(SQL)、适用于图形数据库的 Gremlin、适用于文档数据库的 MongoDB、Azure 表和 Cassandra。Azure Cosmos DB provides five APIs: Core(SQL) for document databases, Gremlin for graph databases, MongoDB for document databases, Azure Table, and Cassandra. 目前,你必须为每种 API 创建单独的帐户。Currently, you must create a separate account for each API.

    选择“Azure 表”,因为在本快速入门中,将创建一个使用表 API 的表。Select Azure Table because in this quickstart you're creating a table that works with the Table API.

    详细了解表 APILearn more about the Table API.
    位置Location 选择离用户最近的区域Select the region closest to your users 选择用于托管 Azure Cosmos DB 帐户的地理位置。Select a geographic location to host your Azure Cosmos DB account. 使用离用户最近的位置,使他们能够以最快的速度访问数据。Use the location that's closest to your users to give them the fastest access to data.

    可以将“异地冗余”和“多区域写入”选项保留为默认值(“禁用”)以避免产生额外的 RU 费用。You can leave the Geo-Redundancy and Multi-region Writes options at their default values (Disable) to avoid additional RU charges. 可以跳过“网络”和“标记”部分。You can skip the Network and Tags sections.

  4. 选择“查看 + 创建”。Select Review+Create. 完成验证后,选择“创建”以创建帐户。After the validation is complete, select Create to create the account.

    Azure Cosmos DB 的“新建帐户”页

  5. 创建帐户需要几分钟时间。It takes a few minutes to create the account. 你将看到一条说明“部署正在进行”的消息。You'll see a message that states Your deployment is underway. 等待部署完成,然后选择“转到资源”。Wait for the deployment to finish and then select Go to resource.

    Azure 门户“通知”窗格

创建 .NET 控制台项目Create a .NET console project

在 Visual Studio 中,创建新的 .NET 控制台应用程序。In Visual Studio, create a new .NET console application. 以下步骤演示了如何在 Visual Studio 2019 中创建控制台应用程序。The following steps show you how to create a console application in Visual Studio 2019. 可以在任意类型的 .NET 应用程序(包括 Azure 云服务或 Web 应用,以及桌面和移动应用程序)中使用 Azure Cosmos DB 表库。You can use the Azure Cosmos DB Table Library in any type of .NET application, including an Azure cloud service or web app, and desktop and mobile applications. 为简单起见,我们在本指南中使用控制台应用程序。In this guide, we use a console application for simplicity.

  1. 选择“文件” > “新建” > “项目” 。Select File > New > Project.

  2. 选择“控制台应用程序 (.NET Core)”,然后选择“下一个” 。Choose Console App (.NET Core), and then select Next.

  3. 在“项目名称”字段中,输入应用程序的名称,例如“CosmosTableSamples” 。In the Project name field, enter a name for your application, such as CosmosTableSamples. (可根据需要提供其他名称。)(You can provide a different name as needed.)

  4. 选择“创建” 。Select Create.

本示例中的所有代码示例都可以添加到控制台应用程序的 Program.cs 文件的 Main() 方法 。All code examples in this sample can be added to the Main() method of your console application's Program.cs file.

安装所需的 NuGet 包Install the required NuGet package

要获取 NuGet 包,请执行以下步骤:To obtain the NuGet package, follow these steps:

  1. 在“解决方案资源管理器” 中,右键单击自己的项目并选择“管理 NuGet 包” 。Right-click your project in Solution Explorer and choose Manage NuGet Packages.

  2. 联机搜索 Microsoft.Azure.Cosmos.TableMicrosoft.Extensions.ConfigurationMicrosoft.Extensions.Configuration.JsonMicrosoft.Extensions.Configuration.Binder,并选择“安装”以安装 Azure Cosmos DB 表库 。Search online for Microsoft.Azure.Cosmos.Table, Microsoft.Extensions.Configuration, Microsoft.Extensions.Configuration.Json, Microsoft.Extensions.Configuration.Binder and select Install to install the Azure Cosmos DB Table Library.

配置存储连接字符串Configure your storage connection string

  1. Azure 门户,导航到 Azure Cosmos 帐户或表存储帐户。From the Azure portal, navigate to your Azure Cosmos account or the Table Storage account.

  2. 打开“连接字符串”或“访问密钥”窗格 。Open the Connection String or Access keys pane. 使用窗口右侧的复制按钮复制“主连接字符串”。 Use the copy button on the right side of the window to copy the PRIMARY CONNECTION STRING.

    在“连接字符串”窗格中查看并复制“主连接字符串”

  3. 要配置连接字符串,请在 Visual Studio 中右键单击项目“CosmosTableSamples” 。To configure your connection string, from visual studio right click on your project CosmosTableSamples.

  4. 依次选择“添加”、“新项” 。Select Add and then New Item. 创建新文件“Settings.json”,其文件类型为“TypeScript JSON 配置”文件 。Create a new file Settings.json with file type as TypeScript JSON Configuration File.

  5. 将 Settings.json 文件中的代码替换为以下代码并分配主连接字符串:Replace the code in Settings.json file with the following code and assign your primary connection string:

    {
    "StorageConnectionString": <Primary connection string of your Azure Cosmos DB account>
    }
    
  6. 右键单击项目“CosmosTableSamples” 。Right click on your project CosmosTableSamples. 选择“添加”、“新项”,并添加名为“AppSettings.cs”的类 。Select Add, New Item and add a class named AppSettings.cs.

  7. 将以下代码添加到 AppSettings.cs 文件。Add the following code to the AppSettings.cs file. 此文件从 Settings.json 文件中读取连接字符串,并将其分配给配置参数:This file reads the connection string from Settings.json file and assigns it to the configuration parameter:

    namespace CosmosTableSamples
    {
    using Microsoft.Extensions.Configuration;
    public class AppSettings
    {
        public string StorageConnectionString { get; set; }
        public static AppSettings LoadAppSettings()
        {
            IConfigurationRoot configRoot = new ConfigurationBuilder()
                .AddJsonFile("Settings.json")
                .Build();
            AppSettings appSettings = configRoot.Get<AppSettings>();
            return appSettings;
        }
    }
    }
    

分析和验证连接详细信息Parse and validate the connection details

  1. 右键单击项目“CosmosTableSamples” 。Right click on your project CosmosTableSamples. 选择“添加”、“新项”,并添加名为“Common.cs”的类 。Select Add, New Item and add a class named Common.cs. 将编写代码来验证连接详细信息并在此类中创建表。You will write code to validate the connection details and create a table within this class.

  2. 按如下所示定义方法 CreateStorageAccountFromConnectionStringDefine a method CreateStorageAccountFromConnectionString as shown below. 此方法将分析连接字符串详细信息,并验证“Settings.json”文件中提供的帐户名称和帐户密钥详细信息是否有效。This method will parse the connection string details and validate that the account name and account key details provided in the "Settings.json" file are valid.

    using System;
    
    namespace CosmosTableSamples
    {
        using System.Threading.Tasks;
        using Microsoft.Azure.Cosmos.Table;
        using Microsoft.Azure.Documents;
    
        public class Common
        {
            public static CloudStorageAccount CreateStorageAccountFromConnectionString(string storageConnectionString)
            {
                CloudStorageAccount storageAccount;
                try
                {
                    storageAccount = CloudStorageAccount.Parse(storageConnectionString);
                }
                catch (FormatException)
                {
                    Console.WriteLine("Invalid storage account information provided. Please confirm the AccountName and AccountKey are valid in the app.config file - then restart the application.");
                    throw;
                }
                catch (ArgumentException)
                {
                    Console.WriteLine("Invalid storage account information provided. Please confirm the AccountName and AccountKey are valid in the app.config file - then restart the sample.");
                    Console.ReadLine();
                    throw;
                }
    
                return storageAccount;
            }
        }
    }
    

创建表Create a Table

CloudTableClient 类使你能够检索存储在表存储中的表和实体。The CloudTableClient class enables you to retrieve tables and entities stored in Table storage. 由于 Cosmos DB 表 API 帐户中没有任何表,请将 CreateTableAsync 方法添加到 Common.cs 类来创建表 :Because we don't have any tables in the Cosmos DB Table API account, let's add the CreateTableAsync method to the Common.cs class to create a table:

public static async Task<CloudTable> CreateTableAsync(string tableName)
  {
    string storageConnectionString = AppSettings.LoadAppSettings().StorageConnectionString;

    // Retrieve storage account information from connection string.
    CloudStorageAccount storageAccount = CreateStorageAccountFromConnectionString(storageConnectionString);

    // Create a table client for interacting with the table service
    CloudTableClient tableClient = storageAccount.CreateCloudTableClient(new TableClientConfiguration());

    Console.WriteLine("Create a Table for the demo");

    // Create a table client for interacting with the table service 
    CloudTable table = tableClient.GetTableReference(tableName);
    if (await table.CreateIfNotExistsAsync())
    {
      Console.WriteLine("Created Table named: {0}", tableName);
    }
    else
    {
      Console.WriteLine("Table {0} already exists", tableName);
    }

    Console.WriteLine();
    return table;
}

定义实体Define the entity

实体使用派生自 TableEntity的自定义类映射到 C# 对象。Entities map to C# objects by using a custom class derived from TableEntity. 要将实体添加到表,请创建用于定义实体的属性的类。To add an entity to a table, create a class that defines the properties of your entity.

右键单击项目“CosmosTableSamples” 。Right click on your project CosmosTableSamples. 选择“添加”、“新建文件夹”并将其命名为“模型” 。Select Add, New Folder and name it as Model. 在“模型”文件夹中添加名为“CustomerEntity.cs”的类,并向其添加以下代码 。Within the Model folder add a class named CustomerEntity.cs and add the following code to it.

namespace CosmosTableSamples.Model
{
    using Microsoft.Azure.Cosmos.Table;
    public class CustomerEntity : TableEntity
    {
        public CustomerEntity()
        {
        }

        public CustomerEntity(string lastName, string firstName)
        {
            PartitionKey = lastName;
            RowKey = firstName;
        }

        public string Email { get; set; }
        public string PhoneNumber { get; set; }
    }
}

此代码定义将客户的名字和姓氏分别用作行键和分区键的实体类。This code defines an entity class that uses the customer's first name as the row key and last name as the partition key. 实体的分区键和行键共同唯一地标识表中的实体。Together, an entity's partition and row key uniquely identify it in the table. 查询分区键相同的实体的速度快于查询分区键不同的实体的速度,但使用不同的分区键可实现更高的并行操作可伸缩性。Entities with the same partition key can be queried faster than entities with different partition keys but using diverse partition keys allows for greater scalability of parallel operations. 需要存储在表中的实体必须是受支持的类型,例如,必须派生自 TableEntity 类。Entities to be stored in tables must be of a supported type, for example derived from the TableEntity class. 要存储在表中的实体属性必须是相应类型的公共属性,并且允许获取和设置值。Entity properties you'd like to store in a table must be public properties of the type, and support both getting and setting of values. 此外,实体类型必须公开无参数构造函数。Also, your entity type must expose a parameter-less constructor.

插入或合并实体Insert or merge an entity

以下代码示例创建实体对象并将其添加到表中。The following code example creates an entity object and adds it to the table. TableOperation 类中的 InsertOrMerge 方法用于插入或合并实体。The InsertOrMerge method within the TableOperation class is used to insert or merge an entity. 调用 CloudTable.ExecuteAsync 方法来执行此操作。The CloudTable.ExecuteAsync method is called to execute the operation.

右键单击项目“CosmosTableSamples” 。Right click on your project CosmosTableSamples. 选择“添加”、“新项”,并添加名为“SamplesUtils.cs”的类 。Select Add, New Item and add a class named SamplesUtils.cs. 此类存储对实体执行 CRUD 操作所需的全部代码。This class stores all the code required to perform CRUD operations on the entities.

public static async Task<CustomerEntity> InsertOrMergeEntityAsync(CloudTable table, CustomerEntity entity)
    {
      if (entity == null)
    {
       throw new ArgumentNullException("entity");
    }
    try
    {
       // Create the InsertOrReplace table operation
       TableOperation insertOrMergeOperation = TableOperation.InsertOrMerge(entity);

       // Execute the operation.
       TableResult result = await table.ExecuteAsync(insertOrMergeOperation);
       CustomerEntity insertedCustomer = result.Result as CustomerEntity;

        // Get the request units consumed by the current operation. RequestCharge of a TableResult is only applied to Azure CosmoS DB 
        if (result.RequestCharge.HasValue)
          {
            Console.WriteLine("Request Charge of InsertOrMerge Operation: " + result.RequestCharge);
          }

        return insertedCustomer;
        }
        catch (StorageException e)
        {
          Console.WriteLine(e.Message);
          Console.ReadLine();
          throw;
        }
    }

从分区获取实体Get an entity from a partition

可以通过使用 TableOperation 类下的 Retrieve 方法从分区获取实体。You can get entity from a partition by using the Retrieve method under the TableOperation class. 以下代码示例获取客户实体的分区键行密钥、电子邮件和电话号码。The following code example gets the partition key row key, email and phone number of a customer entity. 此示例还打印出用于查询实体的请求单元。This example also prints out the request units consumed to query for the entity. 要查询实体,请将以下代码追加到“SamplesUtils.cs”文件 :To query for an entity, append the following code to SamplesUtils.cs file:

public static async Task<CustomerEntity> RetrieveEntityUsingPointQueryAsync(CloudTable table, string partitionKey, string rowKey)
    {
      try
      {
        TableOperation retrieveOperation = TableOperation.Retrieve<CustomerEntity>(partitionKey, rowKey);
        TableResult result = await table.ExecuteAsync(retrieveOperation);
        CustomerEntity customer = result.Result as CustomerEntity;
        if (customer != null)
        {
          Console.WriteLine("\t{0}\t{1}\t{2}\t{3}", customer.PartitionKey, customer.RowKey, customer.Email, customer.PhoneNumber);
        }

        // Get the request units consumed by the current operation. RequestCharge of a TableResult is only applied to Azure CosmoS DB 
        if (result.RequestCharge.HasValue)
        {
           Console.WriteLine("Request Charge of Retrieve Operation: " + result.RequestCharge);
        }

        return customer;
        }
        catch (StorageException e)
        {
           Console.WriteLine(e.Message);
           Console.ReadLine();
           throw;
        }
    }

删除条目Delete an entity

在检索实体之后,可使用更新实体的相同演示模式轻松删除该实体。You can easily delete an entity after you have retrieved it by using the same pattern shown for updating an entity. 以下代码检索并删除一个客户实体。The following code retrieves and deletes a customer entity. 要删除实体,请将以下代码追加到“SamplesUtils.cs”文件 :To delete an entity, append the following code to SamplesUtils.cs file:

public static async Task DeleteEntityAsync(CloudTable table, CustomerEntity deleteEntity)
   {
     try
     {
        if (deleteEntity == null)
     {
        throw new ArgumentNullException("deleteEntity");
     }

    TableOperation deleteOperation = TableOperation.Delete(deleteEntity);
    TableResult result = await table.ExecuteAsync(deleteOperation);

    // Get the request units consumed by the current operation. RequestCharge of a TableResult is only applied to Azure CosmoS DB 
    if (result.RequestCharge.HasValue)
    {
       Console.WriteLine("Request Charge of Delete Operation: " + result.RequestCharge);
    }

    }
    catch (StorageException e)
    {
        Console.WriteLine(e.Message);
        Console.ReadLine();
        throw;
    }
}

对示例数据执行 CRUD 操作Execute the CRUD operations on sample data

定义创建表、插入或合并实体的方法后,对示例数据运行这些方法。After you define the methods to create table, insert or merge entities, run these methods on the sample data. 要执行此操作,请右键单击项目“CosmosTableSamples” 。To do so, right click on your project CosmosTableSamples. 选择“添加”、“新项”,然后添加名为“BasicSamples.cs”的类,并向其添加以下代码 。Select Add, New Item and add a class named BasicSamples.cs and add the following code to it. 此代码将创建表并向该表添加实体。This code creates a table, adds entities to it. 如果要删除项目末尾的实体和表,请从以下代码中删除 table.DeleteIfExistsAsync()SamplesUtils.DeleteEntityAsync(table, customer) 方法中的注释:If you wish to delete the entity and table at the end of the project remove the comments from table.DeleteIfExistsAsync() and SamplesUtils.DeleteEntityAsync(table, customer) methods from the following code:

using System;
namespace CosmosTableSamples
{
    using System.Threading.Tasks;
    using Microsoft.Azure.Cosmos.Table;
    using Model;

    class BasicSamples
    {
        public async Task RunSamples()
        {
            Console.WriteLine("Azure Cosmos DB Table - Basic Samples\n");
            Console.WriteLine();

            string tableName = "demo" + Guid.NewGuid().ToString().Substring(0, 5);

            // Create or reference an existing table
            CloudTable table = await Common.CreateTableAsync(tableName);

            try
            {
                // Demonstrate basic CRUD functionality 
                await BasicDataOperationsAsync(table);
            }
            finally
            {
                // Delete the table
                // await table.DeleteIfExistsAsync();
            }
        }

        private static async Task BasicDataOperationsAsync(CloudTable table)
        {
            // Create an instance of a customer entity. See the Model\CustomerEntity.cs for a description of the entity.
            CustomerEntity customer = new CustomerEntity("Harp", "Walter")
            {
                Email = "Walter@contoso.com",
                PhoneNumber = "425-555-0101"
            };

            // Demonstrate how to insert the entity
            Console.WriteLine("Insert an Entity.");
            customer = await SamplesUtils.InsertOrMergeEntityAsync(table, customer);

            // Demonstrate how to Update the entity by changing the phone number
            Console.WriteLine("Update an existing Entity using the InsertOrMerge Upsert Operation.");
            customer.PhoneNumber = "425-555-0105";
            await SamplesUtils.InsertOrMergeEntityAsync(table, customer);
            Console.WriteLine();

            // Demonstrate how to Read the updated entity using a point query 
            Console.WriteLine("Reading the updated Entity.");
            customer = await SamplesUtils.RetrieveEntityUsingPointQueryAsync(table, "Harp", "Walter");
            Console.WriteLine();

            // Demonstrate how to Delete an entity
            //Console.WriteLine("Delete the entity. ");
            //await SamplesUtils.DeleteEntityAsync(table, customer);
            //Console.WriteLine();
        }
    }
}

上述代码会创建以“demo”开头的表并将生成的 GUID 追加到表名。The previous code creates a table that starts with "demo" and the generated GUID is appended to the table name. 然后,它会添加姓名为“Harp Walter”的客户实体,并稍后更新此用户的电话号码。It then adds a customer entity with first and last name as "Harp Walter" and later updates the phone number of this user.

在本教程中,你生成了对表 API 帐户中存储的数据执行基本 CRUD 操作的代码。In this tutorial, you built code to perform basic CRUD operations on the data stored in Table API account. 还可以执行高级操作,例如批量插入数据、查询分区中的所有数据、查询分区中的一系列数据、列出名称以指定前缀开头的帐户中的表。You can also perform advanced operations such as - batch inserting data, query all the data within a partition, query a range of data within a partition, Lists tables in the account whose names begin with the specified prefix. 可以从 azure-cosmos-table-dotnet-core-getting-started GitHub 存储库中下载完整的示例。You can download the complete sample form azure-cosmos-table-dotnet-core-getting-started GitHub repository. AdvancedSamples.cs 类具有可对数据执行的更多操作。The AdvancedSamples.cs class has more operations that you can perform on the data.

运行项目Run the project

从项目“CosmosTableSamples” ,From your project CosmosTableSamples. 打开名为“Program.cs” 的类。然后将以下代码添加到其中,以便在项目运行时调用 BasicSamples。Open the class named Program.cs and add the following code to it for calling BasicSamples when the project runs.

using System;

namespace CosmosTableSamples
{
    class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Azure Cosmos Table Samples");
            BasicSamples basicSamples = new BasicSamples();
            basicSamples.RunSamples().Wait();

            Console.WriteLine();
            Console.WriteLine("Press any key to exit");
            Console.Read();
        }
    }
}

立即生成解决方案并按 F5 运行该项目。Now build the solution and press F5 to run the project. 运行项目时,将在命令提示符中看到以下输出:When the project is run, you will see the following output in the command prompt:

来自命令提示符的输出

如果收到说明在运行项目时无法找到 Settings.json 文件的错误,可以通过将以下 XML 条目添加到项目设置来解决该问题。If you receive an error that says Settings.json file can't be found when running the project, you can resolve it by adding the following XML entry to the project settings. 右键单击 CosmosTableSamples,选择“编辑 CosmosTableSamples.csproj”并添加以下 itemGroup:Right click on CosmosTableSamples, select Edit CosmosTableSamples.csproj and add the following itemGroup:

  <ItemGroup>
    <None Update="Settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>

现在可以登录到 Azure 门户,并验证表中是否存在数据。Now you can sign into the Azure portal and verify that the data exists in the table.

门户中的结果

后续步骤Next steps

现在可以继续学习下一教程,了解如何将数据迁移到 Azure Cosmos DB 表 API 帐户。You can now proceed to the next tutorial and learn how to migrate data to Azure Cosmos DB Table API account.