Azure Traffic Manager可以与API Management一起使用吗? [英] Can Azure Traffic Manager be used with API Management?

查看:72
本文介绍了Azure Traffic Manager可以与API Management一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将端点添加到Traffic Manager时,只能选择网站和云服务.我可以将API管理服务与Traffic Manager结合使用吗?

When I add an endpoint to Traffic Manager only websites and cloud services are available to choose. Can I combine API Management services with Traffic Manager?

推荐答案

是的,可以将外部终结点添加到Azure交通管理器配置文件中,而不仅仅是Azure网站和Azure云服务.您将需要使用Azure PowerShell模块来设置自定义终结点.

Yes, external endpoints can be added to an Azure Traffic Manager profile, beyond Azure Websites and Azure Cloud Services. You will need to use the Azure PowerShell module to set the custom endpoints.

  1. 安装Azure PowerShell模块: https://github.com/azure/azure-powershell/releases
  2. 运行以下脚本(用您自己的帐户名替换 $ Username 变量)

https://azure.microsoft.com/zh-CN/documentation/articles/traffic-manager-overview/

### Authenticate to Azure from PowerShell
$Username = 'posh@trevorsullivan.net';
$AzureCredential = Get-Credential -Credential $Username;
Add-AzureAccount -Credential $AzureCredential;

### Select the appropriate Azure subscription, if you have multiple
Select-AzureSubscription -SubscriptionName 'Visual Studio Ultimate with MSDN';

### Retrieve the Traffic Manager profile (if already created)
$TrafficManagerProfile = Get-AzureTrafficManagerProfile -Name trevor;

### Add custom endpoints to the Traffic Manager Profile
Add-AzureTrafficManagerEndpoint -TrafficManagerProfile $TrafficManagerProfile -DomainName www.microsoft.com -Type Any -Status Enabled;
Add-AzureTrafficManagerEndpoint -TrafficManagerProfile $TrafficManagerProfile -DomainName trevorsullivan.net -Type Any -Status Enabled;

### Commit the changes to your Azure Traffic Manager Profile
Set-AzureTrafficManagerProfile -TrafficManagerProfile $TrafficManagerProfile;

它与上面的代码不太匹配,但是下面是我的流量管理器配置文件"Trevor"及其两个端点的屏幕截图.

It doesn't quite match the code above, but here's a screenshot of what my Traffic Manger profile named "Trevor" looks like, along with its two endpoints.

这篇关于Azure Traffic Manager可以与API Management一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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