Bearbeiten

Freigeben über


New-AzSynapseWorkspacePackage

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

Syntax

New-AzSynapseWorkspacePackage
   -WorkspaceName <String>
   -Package <String>
   [-ConcurrentTaskCount <Int32>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
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 pacakge 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 pacakge can be either wheel or jar files. Then the second command addes the package to a given Apache Spark pool named ContotoSparkPool.

Parameters

-AsJob

Run cmdlet in the background

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

-ConcurrentTaskCount

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

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
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:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Package

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

Type:String
Aliases:FullName
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WorkspaceName

Name of Synapse workspace.

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

-WorkspaceObject

workspace input object, usually passed through the pipeline.

Type:PSSynapseWorkspace
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PSSynapseWorkspace

String

Outputs

PSSynapseWorkspacePackage