Skip to content

[Synapse] - fix workspace package null check issue #15847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Synapse/Synapse/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed the issue when `Update-AzSynapseSparkPool` is used with workspace package

## Version 0.15.0
* Added support for Synapse Managed Private Endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public override void ExecuteCmdlet()
{
if (this.PackageAction == SynapseConstants.PackageActionType.Add)
{
if (existingSparkPool == null)
if (existingSparkPool.CustomLibraries == null)
{
existingSparkPool.CustomLibraries = new List<LibraryInfo>();
}
Expand Down Expand Up @@ -251,6 +251,11 @@ public override void ExecuteCmdlet()

private LibraryRequirements CreateLibraryRequirements()
{
if (string.IsNullOrEmpty(LibraryRequirementsFilePath))
{
return null;
}

var powerShellDestinationPath = SessionState.Path.GetUnresolvedProviderPathFromPSPath(LibraryRequirementsFilePath);

return new LibraryRequirements
Expand Down
12 changes: 10 additions & 2 deletions src/Synapse/Synapse/help/Update-AzSynapseSparkPool.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,23 @@ PS C:\> $packages = Get-AzSynapseWorkspacePackage -WorkspaceName ContosoWorkspac
PS C:\> Update-AzSynapseSparkPool -WorkspaceName ContosoWorkspace -Name ContosoSparkPool -PackageAction Add -Package $packages
```

The first command retrieves workspace packages. The second command links these workspaces packages to an Apache Spark pool in Azure Synapse Analytics.
The first command retrieves workspace packages. The second command links these workspace packages to an Apache Spark pool in Azure Synapse Analytics.

### Example 10
```powershell
PS C:\> $package = Get-AzSynapseWorkspacePackage -WorkspaceName ContosoWorkspace -Name ContosoPackage
PS C:\> Update-AzSynapseSparkPool -WorkspaceName ContosoWorkspace -Name ContosoSparkPool -PackageAction Remove -Package $package
```

The first command retrieves workspace packages named ContosoPackage. The second command removes the workspaces package from an Apache Spark pool in Azure Synapse Analytics.
The first command retrieves workspace packages named ContosoPackage. The second command removes the workspace package from an Apache Spark pool in Azure Synapse Analytics.

### Example 11
```powershell
PS C:\> $pool = Get-AzSynapseSparkPool -ResourceGroupName ContosoResourceGroup -WorkspaceName ContosoWorkspace -Name ContosoSparkPool
PS C:\> $pool | Update-AzSynapseSparkPool -PackageAction Remove -Package $pool.WorkspacePackages
```

The first command retrieves an Apache Spark pool in Azure Synapse Analytics. The second command removes all workspace packages that are linked to that Apache Spark pool.

## PARAMETERS

Expand Down