- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在考虑使用 Azure AD 来验证对 Azure 存储帐户的访问。
using Microsoft.Azure.Services.AppAuthentication; // 1.1.0-preview
using Microsoft.WindowsAzure.Storage; // 9.3.0
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Queue;
using Microsoft.WindowsAzure.Storage.Table;
using System;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string storageAccountName = "fill_in";
AzureServiceTokenProvider azureServiceTokenProvider = new AzureServiceTokenProvider();
string accessToken = await azureServiceTokenProvider.GetAccessTokenAsync("https://storage.azure.com/");//, tenantId);
TokenCredential tokenCredential = new TokenCredential(accessToken);
StorageCredentials storageCredentials = new StorageCredentials(tokenCredential);
// blobs access
CloudBlobClient cloudBlobClient = new CloudBlobClient(new StorageUri(new Uri($"https://{storageAccountName}.blob.core.windows.net")), storageCredentials);
ContainerResultSegment containerResultSegment = await cloudBlobClient.ListContainersSegmentedAsync(null);
CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference("test" + DateTime.Now.Ticks);
await cloudBlobContainer.CreateIfNotExistsAsync();
// queue access
CloudQueueClient cloudQueueClient = new CloudQueueClient(new StorageUri(new Uri($"https://{storageAccountName}.queue.core.windows.net")), storageCredentials);
QueueResultSegment queueResultSegment = await cloudQueueClient.ListQueuesSegmentedAsync(null);
CloudQueue cloudQueue = cloudQueueClient.GetQueueReference("test" + DateTime.Now.Ticks);
await cloudQueue.CreateIfNotExistsAsync();
// table access
CloudTableClient cloudTableClient = new CloudTableClient(new StorageUri(new Uri($"https://{storageAccountName}.table.core.windows.net")), storageCredentials);
// this http request results in "HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature."
TableResultSegment tableResultSegment = await cloudTableClient.ListTablesSegmentedAsync(null);
CloudTable cloudTable = cloudTableClient.GetTableReference("test" + DateTime.Now.Ticks);
await cloudTable.CreateIfNotExistsAsync();
}
}
尝试使用表会导致 Microsoft.WindowsAzure.Storage.StorageException:“服务器无法验证请求。确保授权 header 的值格式正确,包括签名。'
在 Portal.azure.com 中,我确实看到了以下角色
以这种方式使用 Azure 存储表目前超出了范围,还是我遗漏了某些内容?
问候,弗洛里安
最佳答案
AAD 身份验证尚不支持表。只有 Blob 和队列,正如您从可用角色中看到的那样。
关于c# - 通过 AzureServiceTokenProvider 对 CloudTableClient 进行 Azure 存储身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51593931/
如何为依赖于 Azure 表存储的类编写单元测试,即 Microsoft.Azure.Cosmos.Table.CloudTableClient ? 我发现了这个 GitHub 问题,Azure St
使用 CloudTableClient 时,我看到三个选项: (1) 每次需要访问云表时创建一个新客户端。 (2) 在应用程序启动时创建一个新客户端,并在所有需要访问的资源之间共享它。 (3) 在应用
我正在使用新的 WindowsAzure.Storage 2.0(可能不是相关信息),并且我正在使用 CloudTableClient 实现数据访问。我见过的大多数示例都是在 ASP MVC Cont
我在这里关注 Azure 关于 Java API 的基本教程:https://www.windowsazure.com/en-us/develop/java/how-to-guides/table-s
经过一些研究后,我仍然不确定如何最好地保持与 Azure 表存储的“连接”。是否应该跨请求重用 CloudTableClient 或 CloudTable 实例? 我们在公共(public)高流量 A
我有一个 .NET Core 2.2 Web 应用程序,我正在尝试与我的 Azure 表存储资源进行通信。到目前为止我所拥有的: using Microsoft.WindowsAzure.Storag
我正在努力寻找一些关于是否应该在 ASP.Net WebAPI 应用程序中共享 Azure 表存储对象集实例的真正指导。 为了完整起见,从表存储中检索实体如下所示。 当在数据层中集成类似的东西时,我在
我知道 CloudTableClient.BaseUri.AbsoluteUri 返回一个表示主端点的字符串值。但是,如果出现故障,该值是否会更新到辅助端点? 最佳答案 根据document ,Clo
我正在考虑使用 Azure AD 来验证对 Azure 存储帐户的访问。 https://learn.microsoft.com/en-us/azure/active-directory/manage
我正在构建 Outlook WEB 插件,并将 Microsoft.Azure.Storage.Common 和 Microsoft Azure.CosmosDB.Table nuget 添加到我的项
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 3 年前。 Improv
我把头撞在墙上,试图找出为什么我缺少这个功能。 缺少 CloudTableClient GetTableReference var tableClient = new CloudTableClient
我使用 Microsoft.WindowsAzure.Storage C# 库通过存储凭据访问我的 Azure Table Storage 帐户,如下所示。 _CloudStorageAccount
我是一名优秀的程序员,十分优秀!