Tag: azure

如何从程序中启动Azure存储模拟器

我有一些使用Azure存储的unit testing。 在本地运行这些时,我希望它们使用Azure存储模拟器,它是Azure SDK v1.5的一部分。 如果模拟器没有运行,我希望它能够启动。 要从命令行启动模拟器,我可以使用: “C:\Program Files\Windows Azure SDK\v1.5\bin\csrun” /devstore 这很好用。 当我尝试使用这个C#代码启动它时,它会崩溃: using System.IO; using System.Diagnostics; … ProcessStartInfo processToStart = new ProcessStartInfo() { FileName = Path.Combine(SDKDirectory, “csrun”), Arguments = “/devstore” }; Process.Start(processToStart); 我试过摆弄一些ProcessStartInfo设置,但似乎没有任何效果。 有人有这个问题吗? 我检查了应用程序事件日志,找到了以下两个条目: 事件ID:1023 .NET运行时版本2.0.50727.5446 – 致命执行引擎错误(000007FEF46B40D2)(80131506) 事件ID:1000故障应用程序名称:DSService.exe,版本:6.0.6002.18312,时间戳:0x4e5d8cf3故障模块名称:mscorwks.dll,版本:2.0.50727.5446,时间戳:0x4d8cdb54exception代码:0xc0000005故障偏移:0x00000000001de8d4故障处理id:0x%9错误应用程序启动时间:0x%10错误应用程序路径:%11错误模块路径:%12报告ID:%13

SQL Azure和SQL Server 2008有什么区别?

现在我正在寻找Azure,并希望在这个上迁移。 但我不确定这样做不会出问题。 你能解释一下有什么区别吗? 我无法用SQL Azure做什么?

在Azure Web角色中禁用IIS空闲超时

为防止AppPool每20分钟回收一次,我想在Azure Web角色启动时删除IIS AppPool空闲超时。 我的网站是一个Web应用程序项目。 我该怎么做呢?

ASP.Net Core 2配置占用了大量内存。 如何以不同方式获取配置信息?

好的,所以我有一个应用程序可以获得相当多的流量。 我一直在与Microsoft Azure和Coding团队合作解决内存问题。 他们已经看到了GB的日志,以及当我们处于高负荷状态时,发现Microsoft.Extensions.Configuration代码占据了RAM的大部分份额。 在我的API代码中,我有一个“基本控制器”,所有其他控制器都inheritance自。 这允许我分享常用方法等。 在这个基本控制器中,我创建了一个全局变量: public IConfigurationRoot _configuration { get; } 我相信这是罪魁祸首……但我不知道如何摆脱它。 这个_configuration变量允许我访问我的appsettings.json环境变量。 我不知道如何以不同的方式访问这些。 例如……在GET调用中,我需要知道是否有缓存。 bool isCaching = bool.Parse(_configuration[“Data:Cache”]); 我有一个想法是将_configuration设置为BaseController私有,并在其中创建方法以获取我需要的属性(即缓存),以便其他控制器不必传递此_configuration对象。 不确定是否私有会做任何事情,但….

无法将参数’log’绑定到类型TraceWriter

在执行右键单击项目时获取以下消息 – >调试 – >启动新实例。 [1/7/2018 6:48:54 AM]发生ScriptHost错误[1/7/2018 6:48:54 AM]执行HTTP请求:{[1/7/2018 6:48:54 AM] Microsoft .Azure.WebJobs.Host:错误索引方法’TestFilesIngestJobs.RunScheduleAsync’。 Microsoft.Azure.WebJobs.Host:无法绑定参数’log’以键入TraceWriter。 确保绑定支持参数Type。 如果您正在使用绑定扩展(例如ServiceBus,Timers等),请确保您已在启动代码中调用扩展的注册方法(例如config.UseServiceBus(),config.UseTimers()等)。 [1/7/2018 6:48:54 AM]“requestId”:“dbb282d7-44e2-44b4-907e-877beac9da2d”,[1/7/2018 6:48:54 AM]错误索引方法’MasterDataFilesIngestJobs.RunScheduleAsync’ [1/7/2018 6:48:54 AM]“方法”:“GET”,

Azure API身份validation

我在C#代码中使用Azure API并在库下使用 using Microsoft.Rest; using Microsoft.Rest.Azure.Authentication; using Microsoft.Azure.Management.DataLake.Store; using Microsoft.Azure.Management.DataLake.StoreUploader; using Microsoft.Azure.Management.DataLake.Analytics; using Microsoft.Azure.Management.DataLake.Analytics.Models; using Microsoft.WindowsAzure.Storage.Blob; 要创建与Azure的连接, private static ServiceClientCredentials AuthenticateAzure(string domainName, string nativeClientAppCLIENTID) { // User login via interactive popup SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); // Use the client ID of an existing AAD “Native Client” application. var activeDirectoryClientSettings = ActiveDirectoryClientSettings.UsePromptOnly(nativeClientAppCLIENTID, new Uri(“urn:ietf:wg:oauth:2.0:oob”)); return UserTokenProvider.LoginWithPromptAsync(domainName, activeDirectoryClientSettings).Result; } […]

从Azure Service Fabric群集模拟10,000个Azure IoT Hub设备连接

我们正在开发一个.Net Core服务,该服务将托管在Azure Service Fabric中。 此SF服务需要通过其AMQP 1.0 SSL TLS端点与在Azure IoT Hub中注册的10,000个设备进行交互。 每个IoT Hub设备都有自己的安全令牌和IoT Hub服务提供的连接字符串。 对于我们的场景,我们需要收听来自10,000 IoT Hub设备实例的所有云到设备消息,并将这些消息“路由”到该字段中实际“网关”监听的中央服务总线主题。 所以基本上我们想要将来自10,000个服务总线队列的消息转发到一个中央队列中。 从SF服务处理这10,000个AMQP列表的最佳方法是什么? 有没有办法可以重用AMQP连接,会话或链接,以便我们缓存/共享资源? 我们如何在SF集群中的5个节点上动态分散连接维护的负载? 我们正在为实现评估这些Nuget包: Microsoft.Azure.ServiceBus AMQPNetLite Microsoft.Azure.Devices.Client 我们正在使用Microsoft.Azure.Devices.Client lib进行一些测试,请参阅下面的简化代码示例: using System; using System.Fabric; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Devices.Client; using Microsoft.ServiceFabric.Services.Runtime; namespace ID.Monitoring.MonServer.ServiceFabric.ServiceBus { /// /// An instance of this class is created for each service […]

Azure rest api put blob

我试图用Azure rest api放一个blob。 我成功地提出了“GET”请求,但我遇到了“PUT”请求的问题。 当我尝试发出“PUT”请求时,我得到404错误(我在stackoverflow中看过相同的post,但它没有帮助我)。我不确定我使用的MessageSignature是否正确(我已经尝试过MessageSignaturePut但没有工作)。 有什么建议? public void UploadBlobWithRestAPI(string uri, DateTime now) { string blobName = “test.txt”; string method = “PUT”; string sampleContent = “This is sample text.”; int contentLength = Encoding.UTF8.GetByteCount(sampleContent); string queryString = (new Uri(uri)).Query; string blobContainerUri = uri.Substring(0, uri.Length – queryString.Length); string requestUri = string.Format(CultureInfo.InvariantCulture, “{0}/{1}{2}”, blobContainerUri, blobName, queryString); HttpWebRequest request = […]

从Azure函数中的local.settings.json中读取自定义设置

我试图从local.settings.json文件中检索自定义设置。 示例我正在尝试读取以下local.settings.json文件中的表列表 { “IsEncrypted”: false, “Values”: { “AzureWebJobsStorage”: “UseDevelopmentStorage=true”, “AzureWebJobsDashboard”: “UseDevelopmentStorage=true”, “TableList”: “TestTableName1,TestTableName2” } } 使用以下代码阅读它 string tableslist = ConfigurationManager.AppSettings[“TableList”]; 并且它有效,但我在一些地方读过,这只适用于本地调试,在生产环境中部署之后可能无效。 有人能指出我如何以正确的方式做到这一点? 或者问题仅适用于连接字符串相关的设置?

Azure WebSites或Azure云服务上的MVC4 API :’System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption’

当我尝试将我的Web API项目部署到Azure上的Cloud WebSites和Cloud Hosted Services时,我收到此错误: “{“ExceptionType”:”System.TypeLoadException”,”Message”:”Could not load type ‘System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption’ from assembly ‘System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.”,”StackTrace”:”\r\nServer stack trace: \r\n at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)\r\n at System.Reflection.RuntimeAssembly.GetExportedTypes()\r\n at System.Web.Http.Dispatcher.DefaultHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)\r\n at System.Web.Http.WebHost.WebHostHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)\r\n at System.Web.Http.Dispatcher.HttpControllerTypeCache.InitializeCache()\r\n at System.Lazy`1.CreateValue()\r\n\r\nException rethrown at [0]: \r\n at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)\r\n at System.Reflection.RuntimeAssembly.GetExportedTypes()\r\n at System.Web.Http.Dispatcher.DefaultHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)\r\n at System.Web.Http.WebHost.WebHostHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)\r\n at System.Web.Http.Dispatcher.HttpControllerTypeCache.InitializeCache()\r\n […]