Stop-AzSqlElasticJob

Stops a job given it's job execution id

Syntax

Stop-AzSqlElasticJob
    [-ResourceGroupName] <String>
    [-ServerName] <String>
    [-AgentName] <String>
    [-JobName] <String>
    -JobExecutionId <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Stop-AzSqlElasticJob
    [-ParentObject] <AzureSqlElasticJobExecutionModel>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Stop-AzSqlElasticJob
    [-ParentResourceId] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Stop-AzSqlElasticJob cmdlet stops a job's with a running execution. Returns the current status of the job execution

Examples

Example 1 - Stops a job with a running job execution

PS C:\> $je = Get-AzSqlElasticJobExecution -ResourceGroupName rg -ServerName elasticjobserver -AgentName agent -JobName job1 -JobExecutionId dab0ebe8-fd52-42e9-bacf-e5f27577039b
$je | Stop-AzSqlElasticJob
JobName JobExecutionId                       Lifecycle                    StartTime            EndTime
------- --------------                       ---------                    ---------            -------
job1    dab0ebe8-fd52-42e9-bacf-e5f27577039b WaitingForChildJobExecutions 6/1/2018 10:13:56 PM

Stops a running job execution and returns it's current status

Parameters

-AgentName

The agent name

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobExecutionId

The job execution id.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobName

The job name

Type:String
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ParentObject

The Agent Control Database Object

Type:Microsoft.Azure.Commands.Sql.ElasticJobs.Model.AzureSqlElasticJobExecutionModel
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ParentResourceId

The job execution resource id

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ResourceGroupName

The resource group name

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ServerName

The server name

Type:String
Position:1
Default value:None
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:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.Sql.ElasticJobs.Model.AzureSqlElasticJobExecutionModel

Outputs

Microsoft.Azure.Commands.Sql.ElasticJobs.Model.AzureSqlElasticJobExecutionModel