多站点 Azure 网关

Multi site Azure gateway

如何为多站点创建单个 Azure 应用程序网关。这两个应用程序都在不同的资源组和 VNET 下。 test.example.com 和 test1.example.com 需要单个应用程序网关。

• 由于您在问题中包含了 'terraform' 标签,因此我假设您想要 创建一个应用程序网关以供您使用地形 IAC。因此,you can surely create an application gateway for multiple sites across different tenants/subscriptions and across different virtual networks if the app services hosted are reachable over the internet, have IP connectivity and are accessible。请参阅下面的 Microsoft 官方文档 link,了解有关应用程序网关虚拟网络实例外部通信的查询:-

https://docs.microsoft.com/en-us/azure/application-gateway/application-gateway-faq#can-application-gateway-communicate-with-instances-outside-of-its-virtual-network-or-outside-of-its-subscription

因此,要通过terraform创建您需要的应​​用程序网关,请按照以下步骤操作:-

a) 按照以下文档中给出的 Visual Studio 代码 安装 ‘Azure Terraform’ 扩展:-

https://docs.microsoft.com/en-us/azure/developer/terraform/configure-vs-code-extension-for-terraform?tabs=azure-cli

b) 按照上述文档 link 中的说明完成后,然后使用下面给出的代码编辑 'main.tf' 文件 link 并修改 'variables.tf' 文件,其中 required values of the parameters 与 Azure 中的应用程序网关部署相关:-

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/application_gateway

c) 完成上述操作后,使用代码 'terraform init' 初始化 terraform,然后使用命令 'terraform 创建执行计划计划-out main.tf计划'

d) 然后使用命令‘terraform apply main.tfplan’

应用上面计划中指定的terraform代码

这样一来,应用网关将使用terraform IAC进行部署。