我正在使用ListBlobs Segemented但是在下一页获得continuationTOken时遇到问题.这是我的代码
CloudBlobContainer container = GetContainerReference(fileType);
BlobRequestOptions blobOptions = new BlobRequestOptions();
ResultContinuation continuationToken=null;
ResultSegment<IListBlobItem> blobs = container.ListBlobsSegmented(5000,continuationToken,blobOptions);
Run Code Online (Sandbox Code Playgroud)
我从来没有得到HasMoreResults = true虽然我知道前面有结果.并且无法访问continuationToken.不知道哪个属性在哪里?我可以在ResultContinuationClass的非公共属性中看到它
我已经编写了一个过程,在该过程中,将文件加密并上传到Azure,然后必须对下载过程进行解密,否则将失败,并显示“填充无效且无法删除”错误,或者“要解密的数据长度为无效。” 错误。
我已经尝试了许多在线解决方案,包括使用RijndaelManaged和CryptoStream解密C#mp3文件,但是它们似乎都不起作用,我最终只是在这两个错误之间来回跳动。加密过程使用的是解密使用的相同密钥/ IV对,并且由于它将解密一部分流,因此我感觉工作正常-最终会死于上述错误。
这是我的代码,有什么想法吗?请注意,三个变种(cryptoStream.CopyTo(decryptedStream),do {}和while)不跑起来-他们在这里展示我已经尝试过的选项,所有这一切的失败。
byte[] encryptedBytes = null;
using (var encryptedStream = new MemoryStream())
{
//download from Azure
cloudBlockBlob.DownloadToStream(encryptedStream);
//reset positioning for reading it back out
encryptedStream.Position = 0;
encryptedBytes = encryptedStream.ConvertToByteArray();
}
//used for the blob stream from Azure
using (var encryptedStream = new MemoryStream(encryptedBytes))
{
//stream where decrypted contents will be stored
using (var decryptedStream = new MemoryStream())
{
using (var aes = new RijndaelManaged { KeySize = …Run Code Online (Sandbox Code Playgroud) 如何从一个blob读取文件并上传到另一个blob?我的要求是将文件从一个blob复制到另一个具有不同文件名的blob?在C#中
我按照本文所述为Azure设置blob索引和全文搜索:使用Azure搜索在Azure Blob存储中索引文档.
我的一些文档在索引器中失败,导致返回以下错误:
字段"内容"包含的字词太大而无法处理.UTF-8编码术语的最大长度为32766字节.导致此错误的最可能原因是在此字段上启用了筛选,排序和/或分面,这会导致整个字段值被索引为单个术语.请避免在大字段中使用这些选项.
产生此错误的特定pdf是3.68 MB,包含各种内容(文本,表格,图像等).
索引和索引器的设置与该文章中描述的完全相同,但增加了一些文件类型限制.
指数:
{
"name": "my-index",
"fields": [{
"name": "id",
"type": "Edm.String",
"key": true,
"searchable": false
}, {
"name": "content",
"type": "Edm.String",
"searchable": true
}]
}
Run Code Online (Sandbox Code Playgroud)
索引:
{
"name": "my-indexer",
"dataSourceName": "my-data-source",
"targetIndexName": "my-index",
"schedule": {
"interval": "PT2H"
},
"parameters": {
"maxFailedItems": 10,
"configuration": {
"indexedFileNameExtensions": ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.html,.xml,.eml,.msg,.txt,.text"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试搜索他们的文档和其他一些相关文章,但我找不到任何信息.我猜这是因为此功能仍在预览中.
我有一个天蓝色的SQL数据库,并希望使用数据库中的数据进行Azure流分析 - 我知道我必须使用Blob存储才能将我的数据用作流分析作业的参考数据.
现在,将我的SQL数据导入流分析作业以丰富我的传入数据的最佳方法是什么?
azure azure-storage-blobs azure-stream-analytics azure-sql-database
我有Azure Storage一个blob容器,此容器中有多个文件夹,以及这些文件夹中的文本文件.
我想管理访问权限SAS tokens.我找到了很多例子,但我没有得到我需要的所有答案.
我可以在我的容器的不同级别设置policies和生成SAS tokens吗?喜欢 :
有哪些选择?
似乎Azure Portal只允许我SAS tokens在容器级别生成.是policies仅通过代码创建的吗?具体是否相同SAS tokens(选项2和3)?
谢谢
刚刚完成MVA"Azure流分析实践"课程之一.但不知怎的,它不清楚这个概念,事件中心如何存储数据或者它存储数据的位置,无论是BLOB Store还是Data lake,或者我们可以改变这种类型的商店.
我想获得对blob的引用并为其生成SAS URL.
怎么样?没有公开我的存储帐户密钥?
我尝试了什么?使用SAS(blob容器或存储帐户)获取blob的引用.我的推荐:https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1?toc =%2fazure%2fstorage%2fblobs%2ftoc.json
我看到的例外情况:" 除非使用帐户密钥凭据,否则无法创建共享访问签名 "
但我(显然)不想公开我的帐户密钥!这甚至可能吗?如果没有,还有其他方法吗?
我有一个文件,如Parent.zip与解压缩时,会产生这些文件:child1.jpg,child2.txt,child3.pdf.
运行Parent.zip下面的函数时,文件正确解压缩为:
some-container/child1.jpg
some-container/child2.txt
some-container/child3.pdf
Run Code Online (Sandbox Code Playgroud)
如何将文件解压缩到其父文件夹?期望的结果是:
some-container/Parent/child1.jpg
some-container/Parent/child2.txt
some-container/Parent/child3.pdf
Run Code Online (Sandbox Code Playgroud)
如上所示,文件夹Parent已创建.
我用它来创建blob中的文件:
using (var stream = entry.Open ()) {
//check for file or folder and update the above blob reference with actual content from stream
if (entry.Length > 0) {
await blob.UploadFromStreamAsync (stream);
}
}
Run Code Online (Sandbox Code Playgroud)
这是完整的来源:
[FunctionName ("OnUnzipHttpTriggered")]
public static async Task<IActionResult> Run (
[HttpTrigger (AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log) {
log.LogInformation ("C# …Run Code Online (Sandbox Code Playgroud) 我们在Azure存储上创建了一个文件夹结构,如下所示:
parentcontainer -> childcontainer -> {pdffiles are uploaded here}
Run Code Online (Sandbox Code Playgroud)
我们有存储.pdf文件的URL 。我们不想硬编码任何容器名称,只需使用其URL下载文件即可。
我们当前的尝试是:
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(StorageConnectionString);
CloudBlobClient blobClient = cloudStorageAccount.CreateCloudBlobClient();
CloudBlobContainer cloudBlobContainer = blobClient.GetRootContainerReference();
CloudBlockBlob blockBlob = cloudBlobContainer.GetBlockBlobReference(pdfFileUrl);
var blobRequestOptions = new BlobRequestOptions
{
RetryPolicy = new NoRetry()
};
// Read content
using (MemoryStream ms = new MemoryStream())
{
blockBlob.DownloadToStream(ms, null, blobRequestOptions);
var array = ms.ToArray();
return ms.ToArray();
}
Run Code Online (Sandbox Code Playgroud)
但是我们在这里收到“ 400错误请求”:
blockBlob.DownloadToStream(ms, null, blobRequestOptions);
Run Code Online (Sandbox Code Playgroud)
我们如何仅使用URL下载Azure BLOB存储文件?