标签: azure-table-storage

将对象更新为Azure表存储 - 有没有办法获得新的时间戳?

我正在使用StorageClient库更新AzureTableStorage中的对象

    context.UpdateObject(obj);
    context.SaveChangesWithRetries(obj);
Run Code Online (Sandbox Code Playgroud)

当我这样做时,有没有办法得到新的时间戳,obj而不向服务器发出另一个请求?

谢谢

斯图尔特

azure azure-storage azure-table-storage

9
推荐指数
2
解决办法
4671
查看次数

如何扩展SQL azure?

出于可伸缩性的原因,我想在Azure云中托管我的WCF服务.例如,将有一些读取数据操作.并且它将处于高负载(1000+用户/秒)之下.(就像我之前的问题一样)

此外,对于任何请求,我都有1秒超时限制.

我的服务将与SQL Azure连接.由于延迟小(根据微软的基准测试不超过7毫秒)我选择了它

每个实例/数据库可以容纳多少个并发连接SQL Azure?

当我达到每个实例的连接限制时,是否有能力扩展SQL Azure?

其他解决方案,我的方案的选项?

谢谢.

cloud scalability azure azure-table-storage azure-sql-database

9
推荐指数
1
解决办法
3479
查看次数

我可以删除Windows Azure表存储中的整个分区吗?

我在分区中有一组代表一些缓存数据的行.我想刷新缓存而不用担心已经存在的东西.是否可以删除整个分区而无需进行任何选择?

azure-table-storage

9
推荐指数
1
解决办法
4959
查看次数

来自CloudTable.ExecuteBatch(..)的意外响应代码

当试图做一个批量插入到Azure的表存储,我得到一个StorageExceptionCloudTable.ExecuteBatch():

TableBatchOperation batchOperation = new TableBatchOperation();

foreach (var entity in entities)
{
    batchOperation.InsertOrReplace(entity);
}

table.ExecuteBatch(batchOperation);
Run Code Online (Sandbox Code Playgroud)

抛出异常:

Microsoft.WindowsAzure.Storage.StorageException:操作的意外响应代码:6位于e:\ projects\azure-中的Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync [T](StorageCommandBase1 cmd,IRetryPolicy策略,OperationContext operationContext) sdk-for-net\microsoft-azure-api\Services\Storage\Lib\DotNetCommon\Core\Executor\Executor.cs:Microsoft.WindowsAzure.Storage.Table.TableBatchOperation.Execute的第737行(CloudTableClient客户端,String tableName,TableRequestOptions requestOptions,OperationContext operationContext)在e:\ projects\azure -sdk-for-net\microsoft-azure-api\Services\Storage\Lib\DotNetCommon\Table\TableBatchOperation.cs:Microsoft.WindowsAzure.Storage.Table第85行.在e:\ projects\azure-sdk-for-net\microsoft-azure-api\Services\Storage\Lib\DotNetCommon\Table\CloudTable.cs:第165行中的CloudTable.ExecuteBatch(TableBatchOperation批处理,TableRequestOptions requestOptions,OperationContext operationContext) Library.Modules.Cloud.TableStorage.StorageTabl eRepository 1.InsertOrReplaceBatch(List1实体)

通常使用插入这些实体TableOperation不会给我带来任何问题.

我无法在互联网或MSDN参考中的任何地方找到此异常.

c# azure azure-storage azure-table-storage

9
推荐指数
1
解决办法
6331
查看次数

Windows Azure表 - 行数?

我们有几个表位于Azure存储表(非Azure SQL表)中,我找不到一种简单的方法来计算表中的行数.

我试过调用.CreateQuery.Count(),但这只是返回:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <code>InvalidInput</code>
  <message xml:lang="en-US">One of the request inputs is not valid.
RequestId:c74f8b4c-4277-42f6-bb5d-0db187358e43
Time:2011-12-21T10:34:12.5379616Z</message>
</error>
Run Code Online (Sandbox Code Playgroud)

azure azure-storage azure-table-storage

8
推荐指数
2
解决办法
2万
查看次数

如何在PartitionKey中使用单引号查询azure表存储

我正在将一些代码从较旧的azure表存储客户端迁移到最新版本,并遇到了一个让我难以理解的问题:我似乎无法在分区密钥中发送带有单引号的查询而不会收到400错误请求.例如:

public class TestEntity : TableEntity
{
    public string TestProperty { get; set; }
}

public class StorageTester
{
    public static void TestInsert()
    {
        CloudStorageAccount acct = CloudStorageAccount.DevelopmentStorageAccount;
        CloudTableClient client = acct.CreateCloudTableClient();
        CloudTable table = client.GetTableReference("testtable");
        table.CreateIfNotExists();

        // insert a test entity -- this works fine
        TestEntity entity = new TestEntity();
        entity.PartitionKey = "what's up";
        entity.RowKey = "blah";
        entity.TestProperty = "some dataz";

        TableOperation op = TableOperation.Insert(entity);
        table.Execute(op);

        // now query the entity -- explicit query constructed for clarity
        string partitionFilter …
Run Code Online (Sandbox Code Playgroud)

c# urlencode azure azure-table-storage

8
推荐指数
1
解决办法
6218
查看次数

如何将Table.ExecuteQuerySegmentedAsync()与Azure表存储一起使用

使用Azure存储客户端库2.1,我正在进行表存储异步查询.我创建了这段代码:

public async Task<List<TAzureTableEntity>> GetByPartitionKey(string partitionKey)
{
    var theQuery = _table.CreateQuery<TAzureTableEntity>()
                         .Where(tEnt => tEnt.PartitionKey == partitionKey);
    TableQuerySegment<TAzureTableEntity> querySegment = null;
    var returnList = new List<TAzureTableEntity>();
    while(querySegment == null || querySegment.ContinuationToken != null)
    {
        querySegment = await theQuery.AsTableQuery()
                                     .ExecuteSegmentedAsync(querySegment != null ?
                                         querySegment.ContinuationToken : null);
        returnList.AddRange(querySegment);
    }
    return returnList;
}
Run Code Online (Sandbox Code Playgroud)

假设有大量数据返回,因此会有很多往返表存储的往返.我遇到的问题是我们正在等待一组数据,将其添加到内存列表中,等待更多数据,将其添加到同一列表中,等待更多数据,将其添加到列表中......等等等等.为什么不围绕常规TableQuery包装Task.Factory.StartNew()?像这样:

public async Task<List<TAzureTableEntity>> GetByPartitionKey(string partitionKey)
{
    var returnList = await Task.Factory.StartNew(() =>
                                                 table.CreateQuery<TAzureTableEntity>()
                                                .Where(ent => ent.PartitionKey == partitionKey)
                                                .ToList());
    return returnList;
}
Run Code Online (Sandbox Code Playgroud)

这样做似乎我们不会来回反复播放SynchronizationContext.或者它真的重要吗?

编辑以改写问题

上面提到的两种情况有什么区别?

c# asynchronous azure azure-table-storage async-await

8
推荐指数
1
解决办法
1万
查看次数

持久保存到Azure表存储时使用POCO

我打算在我的ASP.NET 5(MVC 6)应用程序中使用Azure表存储并添加了WindowsAzure.StorageNuGet包,但是当我注意到我所有的entant模型都需要继承时,我真的很失望Microsoft.WindowsAzure.Storage.Table.TableEntity.现在我认为最好的解决方案是拥有两组实体并在我的主域对象和用于持久存储到表存储的实体对象之间创建映射.我不想将WindowsAzure.Storage包添加到我的所有项目中.

弃用的azure-sdk-for-net在某一点上得到了对POCO的支持,但我在目前的WindowsAzure.Storage中没有看到这一点.

这里的最佳做法是什么?

c# asp.net azure azure-table-storage asp.net-core

8
推荐指数
2
解决办法
3384
查看次数

多区域Azure存储数据复制

如您所知,使用Azure DocumentDB时,您可以自动将所有数据复制到任意数量的区域.

如何在Azure存储(特别是表存储)中实现这样的功能?

我知道您可以在同一数据中心内复制数据副本,也可以复制到第二个数据中心(读取访问地理冗余存储(RA-GRS)),但这更像是灾难恢复解决方案.

我希望我的数据可以在多个区域中使用,并在它们之间自动复制(就像DocumentDB提供的那样).

假设我有一个Web应用程序并使用流量管理器,它分布在4-5个区域.我希望我的Azure存储数据可以在所有区域中使用,并在本地(在同一数据中心)读取数据.

是否有自动进行全局复制的选项?或者我需要自己实现这个吗?

c# azure azure-storage azure-table-storage

8
推荐指数
1
解决办法
950
查看次数

如何在 TableClient.QueryAsync() 中筛选分页查询结果 [Azure.Data.Tables]

我正在使用Azure.Data.Tables包和TableClient.QueryAsync()方法来获取查询结果。我希望结果将其用于分页我在https://learn.microsoft.com/en-us/dotnet/api/azure.data.tables.tableclient.queryasync?view=azure-dotnet中遇到了这段代码

Pageable<T> pageable = client.QueryAsync<T>(filter : value, maxPerPage : 10);
Run Code Online (Sandbox Code Playgroud)

我应该做出哪些改变?

提前致谢 !!:)

c# asp.net azure azure-table-storage azure-tablequery

8
推荐指数
2
解决办法
2万
查看次数