Azure Machine Learning Workspace

This page shows how to write Terraform and Azure Resource Manager for Machine Learning Workspace and write them securely.

azurerm_machine_learning_workspace (Terraform)

The Workspace in Machine Learning can be configured in Terraform with the resource name azurerm_machine_learning_workspace. The following sections describe 8 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L38
resource "azurerm_machine_learning_workspace" "ml" {
  name                    = join("-", ["ml", var.namespace, var.environment])
  location                = azurerm_resource_group.ml.location
  resource_group_name     = azurerm_resource_group.ml.name
  application_insights_id = azurerm_application_insights.ml.id
  key_vault_id            = azurerm_key_vault.ml.id
AzureMachineLearning.tf#L37
resource "azurerm_machine_learning_workspace" "AML" {
  name                    = "cloudquickpocs-aml-workspace"
  location                = azurerm_resource_group.AML.location
  resource_group_name     = azurerm_resource_group.AML.name
  application_insights_id = azurerm_application_insights.AML.id
  key_vault_id            = azurerm_key_vault.AML.id
main.tf#L8
resource "azurerm_machine_learning_workspace" "mlw" {
  name                    = var.machine_learning_workspace_name
  location                = var.resource_group_location
  resource_group_name     = var.resource_group_name
  application_insights_id = azurerm_application_insights.appi.id
  key_vault_id            = var.key_vault_id
main.tf#L10
resource "azurerm_machine_learning_workspace" "mlworkspace" {
  name                    = var.name
  location                = data.azurerm_resource_group.ml_resource_group.location
  resource_group_name     = var.resource_group_name
  application_insights_id = var.application_insights_id
  key_vault_id            = var.key_vault_id
main.tf#L8
resource "azurerm_machine_learning_workspace" "mlw" {
  name                    = var.machine_learning_workspace_name
  location                = azurerm_resource_group.rg.location
  resource_group_name     = azurerm_resource_group.rg.name
  application_insights_id = azurerm_application_insights.appi.id
  key_vault_id            = azurerm_key_vault.kv.id
main.tf#L15
resource "azurerm_machine_learning_workspace" "this" {
  name                    = var.workspace_name
  location                = var.location
  resource_group_name     = var.resource_group_name
  application_insights_id = azurerm_application_insights.this.id
  key_vault_id            = var.key_vault_id
workspace.tf#L13
resource "azurerm_machine_learning_workspace" "ws" {
  name                    = azurecaf_name.ws.result
  location                = var.location
  resource_group_name     = var.resource_group_name
  application_insights_id = var.application_insights_id
  key_vault_id            = var.keyvault_id
workspace.tf#L15
resource "azurerm_machine_learning_workspace" "ws" {
  name                    = azurecaf_name.ws.result
  location                = var.location
  resource_group_name     = var.resource_group_name
  application_insights_id = var.application_insights_id
  key_vault_id            = var.keyvault_id

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Azure Machine Learning Workspace

Microsoft.MachineLearningServices/workspaces (Azure Resource Manager)

The workspaces in Microsoft.MachineLearningServices can be configured in Azure Resource Manager with the resource name Microsoft.MachineLearningServices/workspaces. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

  • apiVersion required - string
  • identity optional
      • type optional - string

        The identity type.

      • userAssignedIdentities optional - undefined

        dictionary containing all the user assigned identities, with resourceId of the UAI as key.

  • location optional - string

    Specifies the location of the resource.

  • name required - string

    Name of Azure Machine Learning workspace.

  • properties required
      • allowPublicAccessWhenBehindVnet optional - boolean

        The flag to indicate whether to allow public access when behind VNet.

      • applicationInsights optional - string

        ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created

      • containerRegistry optional - string

        ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created

      • description optional - string

        The description of this workspace.

      • discoveryUrl optional - string

        Url for the discovery service to identify regional endpoints for machine learning experimentation services

      • encryption optional
          • identity optional
              • userAssignedIdentity optional - string

                The ArmId of the user assigned identity that will be used to access the customer managed key vault

          • keyVaultProperties required
              • identityClientId optional - string

                For future use - The client id of the identity which will be used to access key vault.

              • keyIdentifier required - string

                Key vault uri to access the encryption key.

              • keyVaultArmId required - string

                The ArmId of the keyVault where the customer owned encryption key is present.

          • status required - string

            Indicates whether or not the encryption is enabled for the workspace.

      • friendlyName optional - string

        The friendly name for this workspace. This name in mutable

      • hbiWorkspace optional - boolean

        The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service

      • imageBuildCompute optional - string

        The compute name for image build

      • keyVault optional - string

        ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created

      • primaryUserAssignedIdentity optional - string

        The user assigned identity resource id that represents the workspace identity.

      • publicNetworkAccess optional - string

        Whether requests from Public Network are allowed.

      • serviceManagedResourcesSettings optional
          • cosmosDb optional
              • collectionsThroughput optional - integer

                The throughput of the collections in cosmosdb database

      • sharedPrivateLinkResources optional array
          • name optional - string

            Unique name of the private link.

          • properties optional
              • groupId optional - string

                The private link resource group id.

              • privateLinkResourceId optional - string

                The resource id that private link links to.

              • requestMessage optional - string

                Request message.

              • status optional - string

                Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.

      • storageAccount optional - string

        ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created

  • sku optional
      • name optional - string

        Name of the sku

      • tier optional - string

        Tier of the sku like Basic or Enterprise

  • systemData optional
      • createdAt optional - string

        The timestamp of resource creation (UTC).

      • createdBy optional - string

        The identity that created the resource.

      • createdByType optional - string

        The type of identity that created the resource.

      • lastModifiedAt optional - string

        The timestamp of resource last modification (UTC)

      • lastModifiedBy optional - string

        The identity that last modified the resource.

      • lastModifiedByType optional - string

        The type of identity that last modified the resource.

  • tags optional - string

    Contains resource tags defined as key/value pairs.

  • type required - string

Frequently asked questions

What is Azure Machine Learning Workspace?

Azure Machine Learning Workspace is a resource for Machine Learning of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Machine Learning Workspace?

For Terraform, the dmaxim/terrademo, seeewhy/PythonHacks and FabLabGent/InfrastructureFabLabGent source code examples are useful. See the Terraform Example section for further details.