Azure 流量管理器可以与 API 管理一起使用吗?

2024-05-12

当我将端点添加到流量管理器时,只有网站和云服务可供选择。我可以将 API 管理服务与流量管理器结合使用吗?


是的,除了 Azure 网站和 Azure 云服务之外,还可以将外部终结点添加到 Azure 流量管理器配置文件中。您将需要使用 Azure PowerShell 模块来设置自定义终结点。

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

https://azure.microsoft.com/en-us/documentation/articles/traffic-manager-overview/ https://azure.microsoft.com/en-us/documentation/articles/traffic-manager-overview/

### Authenticate to Azure from PowerShell
$Username = '[email protected] /cdn-cgi/l/email-protection';
$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”的流量管理器配置文件及其两个端点的屏幕截图。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Azure 流量管理器可以与 API 管理一起使用吗? 的相关文章

随机推荐