在 azure 中可能出现以下情况吗?:
我需要构建一个应用程序,该应用程序将根据用户提交进行一些繁重的处理,并将结果作为文件返回给用户。
类似于:在用户拨打电话后,服务将响应:这是您的报告在 2 分钟后返回的网址...
我正在尝试在Windows控制台应用程序中下载azure blob.当我构建和调试应用程序时,我的azure连接字符串抛出异常.这个字符串在我的其他asp.net应用程序中工作正常.
违规行是:
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["DefaultEndpointsProtocol=https;AccountName=xxxxx;AccountKey=xxxxx==;BlobEndpoint=https://xxxxx.blob.core.windows.net/;TableEndpoint=https://xxxxx.table.core.windows.net/;QueueEndpoint=https://xxxxx.queue.core.windows.net/;FileEndpoint=https://xxxxx.file.core.windows.net/"].ConnectionString);
Run Code Online (Sandbox Code Playgroud)
我的代码是:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
using System.Configuration;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Threading;
namespace CPGetAdverts
{
class Program
{
static void Main(string[] args)
{
// Retrieve storage account from connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["DefaultEndpointsProtocol=https;AccountName=xxxxx;AccountKey=xxxxx==;BlobEndpoint=https://xxxxx.blob.core.windows.net/;TableEndpoint=https://xxxxx.table.core.windows.net/;QueueEndpoint=https://xxxxx.queue.core.windows.net/;FileEndpoint=https://xxxxx.file.core.windows.net/"].ConnectionString);
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve a reference to a container.
var container = blobClient.GetContainerReference("newadverts").ListBlobs(); …Run Code Online (Sandbox Code Playgroud) 是否可以以编程方式删除批量中的Azure blob对象?逐个删除对象有时需要几天时间.
我们在Azure Blob存储上放置了大量新文件以及我们想要删除的所有过时文件,以避免不必要的费用.
我用Google搜索了网络/ MSDN/Stack Overflow,发现2014年MSDN上只有一个主题是微软网站上的创建功能请求.
我正在从 blob 容器下载文件并保存到流中并尝试阅读 pdf。
//creating a Cloud Storage instance
CloudStorageAccount StorageAccount = CloudStorageAccount.Parse(connectionstring);
//Creating a Client to operate on blob
CloudBlobClient blobClient = StorageAccount.CreateCloudBlobClient();
// fetching the container based on name
CloudBlobContainer container = blobClient.GetContainerReference(containerName);
//Get a reference to a blob within the container.
CloudBlockBlob blob = container.GetBlockBlobReference(fileName);
var memStream = new MemoryStream();
blob.DownloadToStream(memStream);
try
{
PdfReader reader = new PdfReader(memStream);
}
catch(Exception ex)
{
}
Run Code Online (Sandbox Code Playgroud)
例外:未找到 PDF 标头签名。
我有以下代码将文件上传到我的 Azure 存储:
读取文件流如下:
FileStream fileStream = File.OpenRead(filePath);
Run Code Online (Sandbox Code Playgroud)
并传递给函数 =>
public async Task<Response<BlobContentInfo>> UploadBlob(string containerName, string blobName, Stream stream, string contentType,
IDictionary<string, string> metadata = null)
{
IDictionary<string, string> metadataEncoded = new Dictionary<string, string>();
if (metadata != null)
{
foreach (KeyValuePair<string, string> keyValuePair in metadata)
{
string encodedValue = TextUtilities.Base64Encode(keyValuePair.Value);
metadataEncoded.Add(keyValuePair.Key, encodedValue);
}
}
await using (stream)
{
BlobClient blobClient = GetBlobClient(containerName, blobName);
BlobHttpHeaders httpHeaders = new BlobHttpHeaders { ContentType = contentType };
BlobRequestConditions conditions = new BlobRequestConditions();
Response<BlobContentInfo> uploadAsync …Run Code Online (Sandbox Code Playgroud) 问题陈述:我们需要将日志数据从 Xamarin.IOS 应用程序上传到 Azure 存储。日志不是由应用程序的用户创建的,并且在生成日志后,用户在任何时间内保持应用程序打开没有任何限制。我们希望可靠地上传我们的日志,并牢记以下几点:
在查看此问题的潜在解决方案时,Xamarin 文档指出在 iOS7+ 中:
NSURLSession 允许我们创建任务来:
- 通过网络和设备中断传输内容。
- 上传和下载大文件(后台传输服务)。
所以看起来 NSURLSession 是这类工作的一个很好的候选者,但我想知道我是否在重新发明轮子。WindowsAzure.Storage客户端库是否尊重应用后台基于NSURLSession的上传实现,或者如果我想在后台上传数据,是否需要上传到我用POST方法控制的中间服务器,然后中继数据到 Azure 存储?公共 Azure 文档中似乎没有任何迹象表明可以通过计划任务完成上传。
我正在使用@azure/storage-blob,我可以上传文件,但如何检索它?任何想法如何获取存储的 SAS url?
我需要生成几分钟后过期的 url,并且 url 是基于令牌的,因为容器不用于公共访问。请在 node.js 中提供帮助或指导我使用一些插件来帮助获取/生成 blob 存储中该文件的 sas url。先感谢您!
我正在尝试获取一个容器(如果它存在的话)来创建它。
我的困惑是因为GetBlobContainersAsync返回 aBlobContainerItem并CreateBlobContainerAsync返回 a BlobContainerClient。
当我找到容器时,我怎样才能BlobContainerClient从BlobContainerItem?
这是我到目前为止所拥有的:
var blobServiceClient = new BlobServiceClient(this.ConnectionString);
BlobContainerItem archiveContainer = null;
await foreach (var container in blobServiceClient.GetBlobContainersAsync(prefix: Uploader.ContainerName))
{
if (String.Compare(container.Name, Uploader.ContainerName,
CultureInfo.CurrentCulture, CompareOptions.Ordinal) == 0)
{
archiveContainer = ???
break;
}
}
if (archiveContainer == null)
{
archiveContainer = await blobServiceClient.CreateBlobContainerAsync(Uploader.ContainerName);
}
Run Code Online (Sandbox Code Playgroud) SAS 密钥是否会因存储帐户中的设置更改而变得无效?例如:如果我们更改网络访问或 IP 白名单?SAS 密钥可以启用或不启用 IP,重要吗?
azure ×7
c# ×4
azure-sdk ×1
bulk ×1
itext ×1
node.js ×1
nsurlsession ×1
powershell ×1
xamarin ×1
xamarin.ios ×1