C# WebAPI - 获取 Azure 应用服务数据中心
C# WebAPI - get Azure App Service datacenter
我们已经为我们的应用程序服务保留了内部指标,这将有助于了解请求是从哪个位置(EastUS、westus、westeurope 等)提供的。
如何从我们的 WebAPI 代码中获取它?
是否已在 System.Environment.MachineName 中编码?或者我需要将 SDK 添加到我的项目中吗?
谢谢
它在 REGION_NAME
环境变量中。
通过 Kudu DebugConsole -
D:\home>set REGION_NAME
REGION_NAME=West Europe
在 Node 中是 process.env.REGION_NAME
,所以我猜 .NET 是 Environment.GetEnvironmentVariable("REGION_NAME")
。
我们已经为我们的应用程序服务保留了内部指标,这将有助于了解请求是从哪个位置(EastUS、westus、westeurope 等)提供的。
如何从我们的 WebAPI 代码中获取它?
是否已在 System.Environment.MachineName 中编码?或者我需要将 SDK 添加到我的项目中吗?
谢谢
它在 REGION_NAME
环境变量中。
通过 Kudu DebugConsole -
D:\home>set REGION_NAME
REGION_NAME=West Europe
在 Node 中是 process.env.REGION_NAME
,所以我猜 .NET 是 Environment.GetEnvironmentVariable("REGION_NAME")
。