用功能应用部署API管理-Terraform

发布于 2025-02-10 21:40:05 字数 143 浏览 1 评论 0原文

我已经通过Terraform部署了Azure HTTP功能应用程序,我想通过API管理管理对HTTP功能的访问。我可以看到如何通过Terraform创建API管理,但是我看不到如何将功能应用程序嫁给API管理。通过控制台这很简单。我该如何通过Terraform做到这一点?

I have got an Azure HTTP Function App deployed via Terraform, I would like to manage access to the HTTP function via API management. I can see how to created API management via Terraform, however I cannot see how to marry my function app upto my API management. Via the console this is very simple. How can I do this via terraform?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兮颜 2025-02-17 21:40:05

以下是Terraform代码,将您的Azure函数添加为Azure API管理的后端:

resource "azurerm_api_management_backend" "example" {
name = "sample-backend"
resource_group_name = data.azurerm_resource_group.example.name
api_management_name = data.azurerm_api_management.example.name
protocol = "http"
url = "https://${azurerm_function_app.example.name}.azurewebsites.net/api/"
credentials {
header = {
"x-functions-key" = "${data.azurerm_function_app_host_keys.example.default_function_key}"
}
}
}

请参阅 Royarin博客文章有关将功能或Web API添加为Azure APIM中的API的更多信息。

Below is the terraform code to add your Azure function as a backend to Azure API Management:

resource "azurerm_api_management_backend" "example" {
name = "sample-backend"
resource_group_name = data.azurerm_resource_group.example.name
api_management_name = data.azurerm_api_management.example.name
protocol = "http"
url = "https://${azurerm_function_app.example.name}.azurewebsites.net/api/"
credentials {
header = {
"x-functions-key" = "${data.azurerm_function_app_host_keys.example.default_function_key}"
}
}
}

Refer to Royarin blog article for more information on adding the Functions or Web API as an API in Azure APIM as backend.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文