简体   繁体   English

如何使用 terraform 资源提供程序创建 azure 机器学习资源?

[英]How to create azure machine learning resource using terraform resource providers?

我想使用 terraform 脚本创建 azure 机器学习工作区。是否有任何 terraform 提供程序可以实现这一点。

While Charles gave some valid work around of this, I am working on creating those ML related resources for terraform-provider-azurerm.虽然 Charles 对此做了一些有效的工作,但我正在为 terraform-provider-azurerm 创建那些与机器学习相关的资源。 Please check this PR out: https://github.com/terraform-providers/terraform-provider-azurerm/pull/5696请查看此 PR: https : //github.com/terraform-providers/terraform-provider-azurerm/pull/5696

Once this PR gets approved, merged and released, you will be able to create ML workspaces natively using terraform.一旦此 PR 获得批准、合并和发布,您将能够使用 terraform 本机创建 ML 工作区。 Other ml related resources are also on schedule.其他与机器学习相关的资源也在如期进行。

In the meantime Microsoft has added a Terraform resource for ML Workspace in the Azure Provider.与此同时,微软在 Azure Provider 中为 ML Workspace 添加了 Terraform 资源。 This should make any custom scripting obsolete.这应该会使任何自定义脚本过时。

https://www.terraform.io/docs/providers/azurerm/r/machine_learning_workspace.html https://www.terraform.io/docs/providers/azurerm/r/machine_learning_workspace.html

resource "azurerm_machine_learning_workspace" "example" {
  name                    = "example-workspace"
  location                = azurerm_resource_group.example.location
  resource_group_name     = azurerm_resource_group.example.name
  application_insights_id = azurerm_application_insights.example.id
  key_vault_id            = azurerm_key_vault.example.id
  storage_account_id      = azurerm_storage_account.example.id

  identity {
    type = "SystemAssigned"
  }
}

As I know, Terraform does not provide the API in Azure providers to create Azure Machine Learning.据我所知,Terraform 没有在 Azure 提供商中提供 API 来创建 Azure 机器学习。

So in my experience, you can only achieve your purpose with the help of the Azure Template and Azure Tool such as Azure CLI in Terraform script.因此,根据我的经验,您只能借助Azure 模板和 Azure 工具(例如 Terraform 脚本中的Azure CLI)来实现您的目的。

If you use the Azure Template, then you can use the model azurerm_template_deployment to execute your template to create ML.如果使用 Azure 模板,则可以使用模型azurerm_template_deployment执行模板以创建 ML。

If you want to use the Azure CLI, then you can use the model null_resource to execute your CLI command locally.如果要使用 Azure CLI,则可以使用模型null_resource在本地执行 CLI 命令。 You can follow the steps here .您可以按照此处的步骤操作。 And also here is the example for Terraform:这里也是 Terraform 的示例:

resource "null_resource" "cluster" {

  provisioner "local-exec" {
    # here is your CLI command to create the ML
    command = ""
  }
}

check this - https://www.terraform.io/docs/providers/azurerm/r/cognitive_account.html检查这个 - https://www.terraform.io/docs/providers/azurerm/r/cognitive_account.html

but i think there is no direct module there you can check in official terraform docs - https://www.terraform.io/docs/providers/azurerm/但我认为那里没有直接模块,您可以查看官方 terraform 文档 - https://www.terraform.io/docs/providers/azurerm/

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

相关问题 如何使用Azure流利的资源管理注册资源提供者? - How to register resource providers using Azure fluent resource management? 在具有terraform的订阅下创建一个Azure资源组 - create an azure resource group under a subscription with terraform 如何使用服务托管身份在 Azure 中使用 Terraform 供应资源 - How to Use Service Managed identity to provision resource in Azure using Terraform 使用 terraform 创建 Azure 资源组 - Azure resource group creation using terraform 使用 terraform 在预建资源组中部署 azure 资源 - Deploy azure resource in prebuilt resource group using terraform 如何使用 azure 资源管理器模板在 linux 的虚拟机规模集上创建自定义脚本扩展? - How to create custom script extension on virtual machine scale set of linux using azure resource manager template? 如何使用 terraform 在 azure 中管理现有资源组 - How to manage existing resource group in azure with terraform 如何将我的自定义Python代码放入Azure机器学习中以使用ZIP资源? - How do get my custom Python code into Azure Machine Learning for use a a ZIP resource? 如何使用 python 在 azure 中获取虚拟机的资源 ID - How to fetch the resource ID of an virtual machine in azure using python 如何使用 Azure 中的 terraform 创建 UIPathRobot 虚拟机? - How to create a UIPathRobot Virtual Machine using terraform in Azure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM