Tag: azure

用于执行大规模并行查询的通用类。 反馈?

我不明白为什么,但客户端库中似乎没有机制可以并行执行Windows Azure表存储的许多查询。 我创建了一个可用于节省大量时间的模板类,欢迎您随意使用它。 不过,如果你能把它分开,我会很感激,并就如何改进这门课提供反馈。 public class AsyncDataQuery where T: new() { public AsyncDataQuery(bool preserve_order) { m_preserve_order = preserve_order; this.Queries = new List<CloudTableQuery>(1000); } public void AddQuery(IQueryable query) { var data_query = (DataServiceQuery)query; var uri = data_query.RequestUri; // required this.Queries.Add(new CloudTableQuery(data_query)); } /// /// Blocking but still optimized. /// public List Execute() { this.BeginAsync(); return this.EndAsync(); […]

无法连接到redis服务器; 创建断开连接的多路复用器

我有以下代码连接到azure redis缓存。 public class CacheConnectionHelper { private static Lazy lazyConnection = new Lazy(() => { return ConnectionMultiplexer.Connect(SettingsHelper.AzureRedisCache); }); public static ConnectionMultiplexer Connection { get { return lazyConnection.Value; } } } 我这样用它 public static List GetModules() { IDatabase cache = CacheConnectionHelper.Connection.GetDatabase(); List listOfModules = new List(); listOfModules = (List)cache.Get(“ApplicationModules”); if (listOfModules == null) { listOfModules = […]

Azure Active Directory回复URL未按预期工作

我在Azure Active Directory网站配置回复URL中指定了两个URL。 一个在我运行本地代码时重定向到我的localhost环境,一个在我运行prod网站时重定向到我的Azure托管网站。 但Azure Active目录似乎忽略了该设置。 它只使用一个或另一个URL,但不能同时使用两者。 我看到了一个描述问题的链接和一个可能的解决方案,但它对我不起作用。 链接是: Azure AD Single Sign On with multiple environments (Reply URLs) 如何设置Azure Active Directory以重定向到适当的环境?

您可以在一个Windows Azure实例上部署多个Web应用程序吗?

有可能在一个windows azure小型计算实例中运行一堆Web应用程序吗? 我正在寻找使用Azure作为一个地方坐在一堆开发和非生产准备的项目(Web应用程序)。 有些实际上是蛾子,但我想在某个地方有一个活跃的实例。 我不想为每个应用程序支付单独的计算时间,这只是90%的时间。 我正在考虑另一个选项来获得这些项目的共享主机帐户。

将最多100,000条记录插入DocumentDB的最快方法

正如标题所示,我需要以编程方式将100,000多条记录插入到DocumentDb集合中。 这些数据将在稍后用于创建报告。 我正在使用Azure Documents SDK和用于批量插入文档的存储过程(请参阅使用存储过程查询Azure documentdb批量插入 )。 以下控制台应用程序显示了我如何插入文档。 InsertDocuments生成500个测试文档以传递给存储过程。 main函数调用InsertDocuments 10次,整体插入5,000个文档。 运行此应用程序会导致每隔几秒钟插入500个文档。 如果我增加每次通话的文件数量,我就会开始收到错误并丢失文件。 任何人都可以推荐更快的方式来插入文件? static void Main(string[] args) { Console.WriteLine(“Starting…”); MainAsync().Wait(); } static async Task MainAsync() { int campaignId = 1001, count = 500; for (int i = 0; i < 10; i++) { await InsertDocuments(campaignId, (count * i) + 1, (count * i) + […]

将单个文件上载到Blob Storage Azure

如何使用C#上传文件? 我需要从dialogWindow上传文件。

Azure – 删除ADLS文件时出现ADlsError / WebHDFS错误

我正在使用C#进行ADLS身份validation,并希望执行一些文件操作,如删除,重命名。 使用以下代码进行身份validation和删除操作 var context = new AuthenticationContext(“https://login.windows.net/” + tenantId); ClientCredential clientCredential = new ClientCredential(appId, secretKey); var tokenResponse = context.AcquireTokenAsync(“https://management.azure.com/”, clientCredential).Result; var accessToken = tokenResponse.AccessToken; using (var client = new HttpClient()) { client.DefaultRequestHeaders.Add(“Authorization”, “Bearer ” + accessToken); client.BaseAddress = new Uri(“https://management.azure.com/”); } ServiceClientCredentials creds = new TokenCredentials(tokenResponse.AccessToken);// tokenResponse.IdToken, tokenResponse.AccessTokenType); DataLakeStoreFileSystemManagementClient _adlsFileSystemClient = new DataLakeStoreFileSystemManagementClient(creds); _adlsFileSystemClient.FileSystem.Delete(_adlsAccountName, FilenameWPath); […]

Mongo DB对象Id使用JSON序列化程序进行反序列化

var docToJson = doc.ToJson(); story Featured = JsonConvert.DeserializeObject(docToJson); public class story { [JsonProperty(“_id”), JsonConverter(typeof(ObjectIdConverter))] public ObjectId Id { get; set; } …. public class ObjectIdConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { serializer.Serialize(writer, value.ToString()); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { JToken token […]

USQL Query从Json Data创建表

我有一个类似于[{}, {}, {}]的json,即可以有多行,每行有许多属性 – 值对,每行保持固定。 @json = EXTRACT MainId string, Details string FROM @INPUT_FILE USING new Microsoft.Analytics.Samples.Formats.Json.JsonExtractor(); 这给了我json作为一个字符串。 我不知道如何得到: row[3].property4就像属性给定行的值。 使属性复杂化的是{Name:“XXX”,Value:“YYY”} @jsonnodes = SELECT JsonApp.JsonFunctions.JsonTuple(@json, “event”, “id”) AS json_map FROM @json; 现在,上面的查询我试过,但它没有用。 它给了我错误: Rowset variable ‘@json’ is not a scalar variable. 我如何获得行属性对并将它们放在csv文件或表中? 谢谢你的帮助。 JSON看起来像: [{“MainId”:”24201803″,”System”:[{“Name”:”event”,”Value”:”S”},{“Name”:”id”,”Value”:””}], “Details”:[{“Name”:”EventName”,”Value”:”W”},{“Name”:”previd”,”Value”:”88″}], “ttl”:8640000}, ….Multiple Rows of the Same type as before….] […]

无法将REST API用于Windows Server 1.1的Service Bus(OnPremises)

我正在使用Window Server Service Bus 1.1。 我能够使用以下基址从Window Server Service Bus生成OAuth令牌 string baseAddressHttp = “https://” + ServerName + “:9355/” + Namespace + “/$STS/OAuth/”; 对于用于将消息发送到队列的Window Azure Service Bus,我可以在以下队列地址上发出请求 string serviceNamespace = “ServiceBusDefaultNamespace”; string queueName = “SampleQueuName”; string message =”This is my first message”; string queueAddress = “https://” + serviceNamespace + “.servicebus.windows.net/”+ queueName + “/messages”; WebClient webClient = new […]