New-AzureSqlJobConnection
Creates a connection to an Elastic Database jobs database.
Syntax
New-AzureSqlJobConnection
[-CurrentAzureSubscription]
[-ResourceGroupName <String>]
-Credential <PSCredential>
[<CommonParameters>]
New-AzureSqlJobConnection
-ServerName <String>
-DatabaseName <String>
[-LiteralServerName]
-Credential <PSCredential>
[<CommonParameters>]
Description
The New-AzureSqlJobConnection cmdlet creates a connection to an Elastic Database jobs database.
Different elastic database jobs use the object that this cmdlet creates within the AzureSqlDatabaseJobConnection optional parameter. Alternatively, you can use the Use-AzureSqlJobConnection cmdlet to set the job connection within the Azure PowerShell session context and avoid having to pass the connection as a parameter to subsequent elastic database job cmdlet invocations.
Examples
Example 1: Get a connection to the Elastic Database Jobs database
PS C:\>New-AzureSqlJobConnection -CurrentAzureSubscription
ServerName DatabaseName UserName Password
---------- ------------ -------- --------
edj0acd6992d61445a7b3b4a.d... edj0acd6992d61445a7b3b4a PattiFul System.Security.SecureString
This command gets a connection to the Elastic Database Jobs database previously installed within the current Azure subscription within the ElasticDatabaseJobs resource group. This cmdlet prompts you for credentials.
Example 2: Get a connection to an Elastic Database Jobs database that exists on a server
PS C:\>New-AzureSqlJobConnection -ServerName "MyServer" -DatabaseName "MyDatabase"
ServerName DatabaseName UserName Password
---------- ------------ -------- --------
myServer myDatabase PattiFul System.Security.SecureString
This command gets a connection to an Elastic Database Jobs database named myDatabase that exists on server MyServer. This cmdlet prompts you for credentials.
Parameters
-Credential
Specifies the PSCredential containing the username and password for the elastic database job control database connections.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CurrentAzureSubscription
Indicates that the elastic database jobs control database is looked up within the current subscription by finding the Azure SQL Database within the ElasticDatabaseJobs resource group.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
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 |
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 |
-ResourceGroupName
Specifies the name of the Azure resource group that contains the Elastic Database Jobs control database. The cmdlet identifies the Elastic Database Jobs control database within the resource group.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |