简体   繁体   English

如何使用 Terraform 在 Azure 中创建 API App?

[英]how to create API App in Azure using Terraform?

I am trying to create an API App in Azure App Service using Terraform but could not get anything to do so.我正在尝试使用 Terraform 在 Azure 应用程序服务中创建一个 API 应用程序,但无法这样做。 Even I could not find anything in AZ CLI to create an API app.即使我在 AZ CLI 中找不到任何东西来创建 API 应用程序。

Is there any work-around to do the same using terraform?是否有任何解决方法可以使用 terraform 来做同样的事情?

Unfortunately it is not possible to create Azure API App from Terraform at the moment.不幸的是,目前无法从 Terraform 应用程序创建 Azure API 应用程序。

https://github.com/terraform-providers/terraform-provider-azurerm/issues/443 https://github.com/terraform-providers/terraform-provider-azurerm/issues/443

There is workaround hot to create Azure API App with AZ CLI使用 AZ CLI 创建 Azure API 应用程序存在热解决方法

az resource create -g yugangw2 -n yugangw2-api12 --resource-type Microsoft.web/sites  --is-full-object -p "{\"kind\":\"api\", \"location\":\"West US\", \"properties\":{  \"serverFarmId\":\"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272xxxxxx/resourcegroups/yugangw2/providers/Microsoft.Web/serverfarms/yugangw2-plan\"}}"

https://github.com/Azure/azure-cli/issues/2866#issuecomment-317544291 https://github.com/Azure/azure-cli/issues/2866#issuecomment-317544291

According to this blog post there is no real difference between App Service and API Service (different icons).根据这篇文,App Service 和 API Service 之间没有真正的区别(不同的图标)。

So you should be able to use azurerm_app_service所以你应该可以使用azurerm_app_service

It is possible to provision API APP using "kind" attribute in the template.可以使用模板中的“kind”属性提供 API APP。 set the kind attribute to "API".将 kind 属性设置为“API”。 https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_web_app kind - The Kind value for this Windows Web App. https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_web_app kind - 此 Windows Web App 的 Kind 值。

Example: "kind": "linux,container,API"例子: "kind": "linux,container,API"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 api/azure-cli/powershell/terraform 创建 Azure Marketplace SaaS 应用程序? - How can I create an Azure Marketplace SaaS App using api/azure-cli/powershell/terraform? 如何使用Terraform在Azure API管理中导入Azure Function应用? - How to import Azure Function App in Azure API Management using Terraform? 如何使用 terraform 创建 Azure WebJob? - How to create an Azure WebJob using terraform? 如何使用 Terraform 为 Azure 资源创建警报 - How to create alerts for Azure resources using Terraform 如何使用 Terraform 创建 Azure 警报 - How to create Azure Alerts using Terraform 如何使用 Terraform 创建 Python 运行时为 3.6 的 Azure Web 应用程序 - How do you create a Azure Web app with a python runtime of 3.6 using Terraform 使用 Terraform 的 Azure API 管理器 - Azure API manager using terraform 如何使用.YAML文件和Python代码创建Azure API应用程序? - How to create an Azure API App using the .YAML file and Python code? 如何使用 terraform 资源提供程序创建 azure 机器学习资源? - How to create azure machine learning resource using terraform resource providers? 如何使用 Azure 中的 terraform 创建 UIPathRobot 虚拟机? - How to create a UIPathRobot Virtual Machine using terraform in Azure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM