创建SQL Server的Azure Fluent API错误-缺少x-ms-request-id标头 [英] Azure Fluent API Error creating SQL Server - Missing x-ms-request-id header

查看:132
本文介绍了创建SQL Server的Azure Fluent API错误-缺少x-ms-request-id标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Azure Fluent API( https://github.com/Azure/azure-sdk-for-net/tree/Fluent ),但我总是会收到Microsoft.Rest.Azure.CloudException。其他所有内容(创建存储帐户,App Services,资源组)都可以正常工作-只是SQL部分不起作用。

I'm trying to create a new SQL Server with the Azure Fluent API (https://github.com/Azure/azure-sdk-for-net/tree/Fluent) but I always get a Microsoft.Rest.Azure.CloudException. Everything else (Creating Storage Account, App Services, Resource Groups) works fine - it's just the SQL part which does not work.

ISqlServer sqlServer = await Azure.SqlServers
                    .Define(serverName)
                    .WithRegion(regionName)
                    .WithExistingResourceGroup(rgName)
                    .WithAdministratorLogin(administratorLogin)
                    .WithAdministratorPassword(administratorPassword)
                    .WithNewElasticPool(elasticPoolName, elasticPoolEdition)
                    .CreateAsync();

但是在尝试创建服务器时,我遇到了一个例外:

But when trying to create the server I got an exception:

{Microsoft.Rest.Azure.CloudException: Invalid value for header 'x-ms-request-id'. The header must contain a single valid GUID.
   at Microsoft.Azure.Management.Sql.Fluent.ServersOperations.<CreateOrUpdateWithHttpMessagesAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.Sql.Fluent.ServersOperationsExtensions.<CreateOrUpdateAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.Sql.Fluent.SqlServerImpl.<CreateResourceAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.Creatable`4.<Microsoft-Azure-Management-ResourceManager-Fluent-Core-ResourceActions-IResourceCreator<IResourceT>-CreateResourceAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.CreatorTaskItem`1.<ExecuteAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.TaskGroupBase`1.<ExecuteNodeTaskAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at XircuitAPI.Controllers.AzureSqlServerController.<Create>d__9.MoveNext() in C:\Users\ThimoBuchheister\Documents\Code\Xircuit\xircuit\XircuitAPI\Controllers\AzureSqlServerController.cs:line 235}


推荐答案

好的,在使用小提琴跟踪我的http请求后,我已经解决了我的问题,我发现Application Insights向我对AAD应用程序的请求添加了标头。因此,我总共删除了Application Insights,并即时恢复了在线状态。希望对您有帮助。看这个。如果您想继续使用Application Insight,请查看
禁用应用洞察力

Okay i have solved my problem, after using fiddle to trace my http request i discovered that, Application Insights added headers to my request to the AAD app. So i total removed Application Insights and im back online. Hope it helps you. Look at this. if you want to continue using Application Insight check this out disable application insight

这篇关于创建SQL Server的Azure Fluent API错误-缺少x-ms-request-id标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆