New-AzMLWorkspaceJob

Creates and executes a Job.

Syntax

New-AzMLWorkspaceJob
   -Name <String>
   -ResourceGroupName <String>
   -WorkspaceName <String>
   -Job <IJobBaseProperties>
   [-SubscriptionId <String>]
   [-DefaultProfile <PSObject>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

Creates and executes a Job.

Examples

Example 1: Creates and executes a Job

# The job type includes CommandJob, SweepJob, PipelineJob.
# You can use following command to create it then pass it as value to Job parameter of the New-AzMLWorkspaceJob cmdlet.
# New-AzMLWorkspaceCommandJobObject
# New-AzMLWorkspaceSweepJobObject
# New-AzMLWorkspacePipelineJobObject

New-AzMLWorkspaceEnvironmentVersion -ResourceGroupName ml-rg-test -WorkspaceName mlworkspace-test01 -Name commandjobenv -Version 1 -Image "library/python:latest"
$commandJob = New-AzMLWorkspaceCommandJobObject -Command "echo `"hello world`"" `
-ComputeId '/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ml-rg-test/providers/Microsoft.MachineLearningServices/workspaces/mlworkspace-test01/computes/aml02' `
-EnvironmentId '/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ml-rg-test/providers/Microsoft.MachineLearningServices/workspaces/mlworkspace-test01/environments/commandjobenv/versions/1'`
-DisplayName 'commandjob01' -ExperimentName 'commandjobexperiment'
New-AzMLWorkspaceJob -ResourceGroupName ml-rg-test -WorkspaceName mlworkspace-test01 -Name commandJob01 -Job $commandJob

Name                       SystemDataCreatedAt  SystemDataCreatedBy                 SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName
----                       -------------------  -------------------                 ----------------------- ------------------------ ------------------------ ---------------------------- -----------------
commandJob01               5/31/2022 7:58:38 AM Lucas Yao (Wicresoft North America) User                                                                                                   ml-rg-test

Creates and executes a Job

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Job

[Required] Additional attributes of the entity. To construct, see NOTES section for JOB properties and create a hash table.

Type:IJobBaseProperties
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name and identifier for the Job. This is case-sensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WorkspaceName

Name of Azure Machine Learning workspace.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IJobBase

Notes

ALIASES

COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

JOB <IJobBaseProperties>: [Required] Additional attributes of the entity.

  • JobType <JobType>: [Required] Specifies the type of job.
  • [Description <String>]: The asset description text.
  • [Property <IResourceBaseProperties>]: The asset property dictionary.
    • [(Any) <String>]: This indicates any property can be added to this object.
  • [Tag <IResourceBaseTags>]: Tag dictionary. Tags can be added, removed, and updated.
    • [(Any) <String>]: This indicates any property can be added to this object.
  • [ComputeId <String>]: ARM resource ID of the compute resource.
  • [DisplayName <String>]: Display name of job.
  • [ExperimentName <String>]: The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment.
  • [IdentityType <IdentityConfigurationType?>]: [Required] Specifies the type of identity framework.
  • [IsArchived <Boolean?>]: Is the asset archived?
  • [Service <IJobBaseServices>]: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject.
    • [(Any) <IJobService>]: This indicates any property can be added to this object.