Edit

Share via


New-AzSynapseWorkspacePackage

Uploads a local workspace package file to an Azure Synapse workspace.

Syntax

CreateByNameParameterSet (Default)

New-AzSynapseWorkspacePackage
    -WorkspaceName <String>
    -Package <String>
    [-ConcurrentTaskCount <Int32>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

CreateByObjectParameterSet

New-AzSynapseWorkspacePackage
    -WorkspaceObject <PSSynapseWorkspace>
    -Package <String>
    [-ConcurrentTaskCount <Int32>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-AzSynapseWorkspacePackage uploads a local workspace package file to an Azure Synapse workspace.

Examples

Example 1: Upload a named workspace package

New-AzSynapseWorkspacePackage -WorkspaceName ContosoWorkspace -Package ".\ContosoPackage.whl"

This command uploads the workspace package whose location is ".\ContosoPackage.whl" to an Azure Synapse workspace named ContosoWorkspace. The workspace package can be either wheel or jar files.

Example 2: Upload all workspace packages under the current folder

Get-ChildItem -File | New-AzSynapseWorkspacePackage -WorkspaceName ContosoWorkspace

This command uses the core Windows PowerShell cmdlet Get-ChildItem to get all the workspace packages in the current folder and in subfolders, and then passes them to the current cmdlet by using the pipeline operator. The New-AzSynapseWorkspacePackage cmdlet uploads the workspace package files to the Azure Synapse workspace named ContosoWorkspace.

Example 3: Upload a named workspace package and add it to Apache Spark pool

$package = New-AzSynapseWorkspacePackage -WorkspaceName ContosoWorkspace -Package ".\ContosoPackage.whl"
Update-AzSynapseSparkPool -WorkspaceName ContosoWorkspace -Name ContosoSparkPool -PackageAction Add -Package $package

This first command uploads the workspace package whose location is ".\ContosoPackage.whl" to an Azure Synapse workspace named ContosoWorkspace. The workspace package can be either wheel or jar files. Then the second command addes the package to a given Apache Spark pool named ContosoSparkPool.

Parameters

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ConcurrentTaskCount

The total amount of concurrent async tasks. The default value is 10.

Parameter properties

Type:

Nullable<T>[Int32]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Package

Specifies a local file path for a file to upload as workspace package.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:FullName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WorkspaceName

Name of Synapse workspace.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateByNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WorkspaceObject

workspace input object, usually passed through the pipeline.

Parameter properties

Type:PSSynapseWorkspace
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateByObjectParameterSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSSynapseWorkspace

String

Outputs

PSSynapseWorkspacePackage