Use-​Azure​Sql​Job​Connection

Sets the Azure PowerShell session context to use the provided connection to the Elastic Database Jobs control database.

Syntax

Use-AzureSqlJobConnection
   [-AzureSqlJobConnection] <AzureSqlJobConnection>
   [<CommonParameters>]
Use-AzureSqlJobConnection
   -Credential <PSCredential>
   [-CurrentAzureSubscription]
   [-ResourceGroupName <String>]
   [<CommonParameters>]
Use-AzureSqlJobConnection
   -Credential <PSCredential>
   -DatabaseName <String>
   -ServerName <String>
   [-LiteralServerName]
   [<CommonParameters>]
Use-AzureSqlJobConnection
   [-None]
   [<CommonParameters>]

Description

The Use-AzureSqlJobConnection cmdlet sets the Azure PowerShell session context to use the provided connection to the Elastic Database jobs control database.

Subsequent Elastic Database Jobs cmdlet invocations will make use of the connection information specified within the Use-AzureSqlJobConnection cmdlet invocation.

Examples

Example 1: Set the PowerShell session context to use the provided connection to the Elastic Database jobs control database previously installed

PS C:\>Use-AzureSqlJobConnection -CurrentAzureSubscription

This command sets the Azure PowerShell session context to use a connection to the Elastic Database Jobs database previously installed within the current Azure subscription within the ElasticDatabaseJobs resource group. Following the cmdlet invocation, credentials will be prompted.

Example 2: Set the PowerShell session context to use the provided connection to the Elastic Database jobs control database.

PS C:\>Use-AzureSqlJobConnection -ServerName "MyServer" -DatabaseName "MyDatabase"

This command sets the Azure PowerShell session context to use a connection to the Elastic Database jobs database named MyDatabase. You are then prompted for credentials after the cmdlet runs.

Required 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
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Credential

Specifies the PSCredential containing the username and password for the Elastic Database job control database connections.

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CurrentAzureSubscription

Indicates that the Elastic Database jobs control database will be looked up within the current subscription by finding the Azure SQL Database within the ElasticDatabaseJobs resource group.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DatabaseName

Specifies the database name of the Elastic Database jobs control database.

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

Indicates that any set connection info context within the session from previous calls to this cmdlet are removed.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ServerName

Specifies the database server name of the Elastic Database jobs control database.

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

Optional Parameters

-LiteralServerName

{{Fill LiteralServerName Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the Azure resource group that contains the Elastic Database jobs control database. The cmdlet will identify the Elastic Database jobs control database within the resource group.

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