[英]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.