New-AzureSqlJob
Creates a job definition to be used for subsequent job runs.
Syntax
New-AzureSqlJob
-JobName <String>
-CredentialName <String>
-ContentName <String>
-TargetId <Guid>
[-ExecutionPolicyName <String>]
[[-AzureSqlJobConnection] <AzureSqlJobConnection>]
[<CommonParameters>]
New-AzureSqlJob
-JobName <String>
-CredentialName <String>
-ContentName <String>
-TargetId <Guid>
[-ExecutionPolicyName <String>]
-ResultSetDestinationServerName <String>
-ResultSetDestinationDatabaseName <String>
-ResultSetDestinationCredentialName <String>
-ResultSetDestinationSchemaName <String>
-ResultSetDestinationTableName <String>
[-LiteralServerName]
[[-AzureSqlJobConnection] <AzureSqlJobConnection>]
[<CommonParameters>]
Description
The New-AzureSqlJob cmdlet creates a job definition to be used for subsequent job runs.
Job execution can be requested through the Start-AzureSqlJobExecution cmdlet or through creation of a trigger in combination with a schedule using the New-AzureSqlJobTrigger cmdlet.
Examples
Example 1: Create a job using the specified content
PS C:\>ew-AzureSqlJob -JobName "MyJob" -CredentialName "MyCredential" -ContentName "MyScript" -TargetId (Get-AzureSqlDatabaseJobTarget -CustomCollectionName "MyCustomCollection").TargetId
JobName : MyJob
ContentName : MyScript
ContentVersionNumber :
TargetDescription : {"CustomCollectionName":"myCustomCollection"}
TargetId : b525727e-6ed0-44cc-94da-63c543e383d7
CredentialName : MyCredential
ExecutionPolicyName : Default execution policy
ResultSetDestination :
This command creates a job using the specified content to execute across the specified custom collection using the specified credentials.
Example 2: Create a job using the specified content
PS C:\>New-AzureSqlJob -JobName "MyResultsJob" -CredentialName "MyCredential" -ContentName MyScript -ResultSetDestinationServerName "MyResultsServerName.database.windows.net" -ResultSetDestinationDatabaseName "MyResultsDatabaseName" -ResultSetDestinationCredentialName "MyResultsCredential" -ResultSetDestinationSchemaName "DBO" -ResultSetDestinationTableName "MyResultsTable" -TargetId (Get-AzureSqlDatabaseJobTarget -CustomCollectionName "MyCustomCollection").TargetId
JobName : MyResultsJob
ContentName : MyScript
ContentVersionNumber :
TargetDescription : {"CustomCollectionName":"myCustomCollection"}
TargetId : b525727e-6ed0-44cc-94da-63c543e383d7
CredentialName : MyCredential
ExecutionPolicyName : Default execution policy
ResultSetDestination : Microsoft.Azure.SqlDatabase.Jobs.Client.ResultSetDestination
This command creates a job using the specified content to run across the specified custom collection using the specified credentials, where the result set from each database is stored into the specified result set destination table.
Example 3: Create a job using the specified content to execute across the specified elastic scale shard map collection
PS C:\>New-AzureSqlJob -JobName "MyResultsJobAcrossShardMap" -CredentialName "MyCredential" -ContentName "MyScript" -ResultSetDestinationServerName "MyResultsServerName.database.windows.net" -ResultSetDestinationDatabaseName "MyResultsDatabaseName" -ResultSetDestinationCredentialName myResultsCredential -ResultSetDestinationSchemaName "DBO" -ResultSetDestinationTableName "MyResultsTable" -TargetId (Get-AzureSqlDatabaseJobTarget -ShardMapManagerServerName "MyShardMapManagerServer.database.windows.net" -ShardMapManagerDatabaseName "MyShardMapManagerDatabase" -ShardMapName "MyShardMap").TargetId
JobName : MyResultsJobAcrossShardMap
ContentName : MyScript
ContentVersionNumber :
TargetDescription : {"ShardMapName":"MyShardMap","ShardMapManagerServerName":"MyShardMapManagerServer.database.windows.net","ShardMapManagerDatabaseName":
"MyShardMapManagerDatabase"}
TargetId : 1afd9326-1277-4344-832f-8170d0375ff7
CredentialName : MyCredential
ExecutionPolicyName : Default execution policy
ResultSetDestination : Microsoft.Azure.SqlDatabase.Jobs.Client.ResultSetDestination
This command creates a job using the specified content to execute across the specified elastic scale shard map collection using the specified credentials, where the result set from each database is stored into the specified result set destination table.
Parameters
-AzureSqlJobConnection
Specifies the connection state object for the job. You can get the connection state object through the New-AzureSqlJobConnection cmdlet. If you do not specify this parameter, the connection state is used from a prior call to the Use-AzureSqlJobConnection cmdlet.
Type: | AzureSqlJobConnection |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ContentName
Specifies the name of the content to run or be applied during the job.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CredentialName
Specifies the name of the credentials to use when connecting to target databases.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExecutionPolicyName
Specifies the name of the execution policy to use during job execution. If you do not specify this parameter, the default job execution policy is used.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobName
Specifies the name to use for the new job.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LiteralServerName
{{Fill LiteralServerName Description}}
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResultSetDestinationCredentialName
Specifies the name of the credential to use for the database connection used for insertion of the first result set obtained during job execution.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResultSetDestinationDatabaseName
Specifies the database name to use for insertion of the first result set obtained during job execution.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResultSetDestinationSchemaName
Specifies the database schema name to use for insertion of the first result set obtained during job execution.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResultSetDestinationServerName
Specifies the database schema name to use for insertion of the first result set obtained during job execution.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResultSetDestinationTableName
Specifies the database table name to use for insertion of the first result set obtained during job execution. If the table does not exist during job execution, the system automatically creates it using a schema matching the result set.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TargetId
Specifies the target ID to use for execution or application of the content during job execution.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Related Links
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für