Skip to content
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
14 changes: 12 additions & 2 deletions src/Synapse/Synapse/Az.Synapse.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,16 @@ CmdletsToExport = 'Get-AzSynapseSparkJob', 'Stop-AzSynapseSparkJob',
'Export-AzSynapseKqlScript',
'Get-AzSynapseActiveDirectoryOnlyAuthentication',
'Enable-AzSynapseActiveDirectoryOnlyAuthentication',
'Disable-AzSynapseActiveDirectoryOnlyAuthentication'
'Disable-AzSynapseActiveDirectoryOnlyAuthentication',
'Set-AzSynapseLinkConnectionLinkTable','Get-AzSynapseLinkConnectionLinkTable',
'Get-AzSynapseLinkConnectionLinkTableStatus',
'Update-AzSynapseLinkConnectionLandingZoneCredential',
'Get-AzSynapseLinkConnection',
'Set-AzSynapseLinkConnection',
'Start-AzSynapseLinkConnection',
'Stop-AzSynapseLinkConnection',
'Remove-AzSynapseLinkConnection',
'Get-AzSynapseLinkConnectionDetailedStatus'

# Variables to export from this module
# VariablesToExport = @()
Expand All @@ -251,7 +260,8 @@ AliasesToExport = 'New-AzSynapsePipeline', 'New-AzSynapseLinkedService',
'Set-AzSynapseManagedPrivateEndpoint', 'New-AzSynapseSqlScript',
'Import-AzSynapseSqlScript', 'Set-AzSynapseSparkConfiguration',
'Import-AzSynapseSparkConfiguration', 'Set-AzSynapseKqlScript',
'Import-AzSynapseKqlScript'
'Import-AzSynapseKqlScript',
'New-AzSynapseLinkConnection'

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand Down
11 changes: 11 additions & 0 deletions src/Synapse/Synapse/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
-->

## Upcoming Release
* Added support for Synapse Link for Azure Sql Database
- Added `Get-AzSynapseLinkConnection` cmdlet
- Added `Get-AzSynapseLinkConnectionDetailedStatus` cmdlet
- Added `Set-AzSynapseLinkConnection` cmdlet
- Added `Remove-AzSynapseLinkConnection` cmdlet
- Added `Start-AzSynapseLinkConnection` cmdlet
- Added `Stop-AzSynapseLinkConnection` cmdlet
- Added `Set-AzSynapseLinkConnectionLinkTable` cmdlet
- Added `Get-AzSynapseLinkConnectionLinkTable` cmdlet
- Added `Get-AzSynapseLinkConnectionLinkTableStatus` cmdlet
- Added `Update-AzSynapseLinkConnectionLandingZoneCredential` cmdlet
* Set UploadedTimestamp when adding package to spark pool by `Update-AzSynapseSparkPool`

## Version 1.3.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.Synapse.Common;
using Microsoft.Azure.Commands.Synapse.Models;
using System.Management.Automation;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.WindowsAzure.Commands.Utilities.Common;

namespace Microsoft.Azure.Commands.Synapse
{
[Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnectionDetailedStatus, DefaultParameterSetName = GetByName)]
[OutputType(typeof(PSLinkConnectionDetailedStatus))]
public class GetAzureSynapseLinkConnectionDetailedStatus : SynapseArtifactsCmdletBase
{
private const string GetByName = "GetByName";
private const string GetByObject = "GetByObject";

[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName,
Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)]
[ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public override string WorkspaceName { get; set; }

[Parameter(ValueFromPipeline = true, ParameterSetName = GetByObject,
Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)]
[ValidateNotNull]
public PSSynapseWorkspace WorkspaceObject { get; set; }

[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)]
[ValidateNotNullOrEmpty]
[Alias("LinkConnectionName")]
public string Name { get; set; }

public override void ExecuteCmdlet()
{
if (this.IsParameterBound(c => c.WorkspaceObject))
{
this.WorkspaceName = this.WorkspaceObject.Name;
}
WriteObject(new PSLinkConnectionDetailedStatus(SynapseAnalyticsClient.GetLinkConnectionDetailedStatus(this.Name), this.WorkspaceName));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Commands.Synapse.Common;
using Microsoft.Azure.Commands.Synapse.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Synapse
{
[Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnectionLinkTable,
DefaultParameterSetName = GetByName)]
[OutputType(typeof(PSLinkTableResource))]
public class GetAzureSynapseLinkConnectionLinkTable : SynapseArtifactsCmdletBase
{
private const string GetByName = "GetByName";
private const string GetByObject = "GetByObject";
private const string GetByInputObject = "GetByInputObject";

[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName,
Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)]
[ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public override string WorkspaceName { get; set; }

[Parameter(ValueFromPipeline = true, ParameterSetName = GetByObject,
Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)]
[ValidateNotNull]
public PSSynapseWorkspace WorkspaceObject { get; set; }

[Parameter(ValueFromPipeline = true, ParameterSetName = GetByInputObject,
Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)]
[ValidateNotNull]
public PSLinkConnectionResource InputObject { get; set; }

[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName,
Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)]
[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByObject,
Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)]
[ValidateNotNullOrEmpty]
public string LinkConnectionName { get; set; }

public override void ExecuteCmdlet()
{
if (this.IsParameterBound(c => c.WorkspaceObject))
{
this.WorkspaceName = this.WorkspaceObject.Name;
}

if (this.IsParameterBound(c => c.InputObject))
{
this.WorkspaceName = this.InputObject.WorkspaceName;
this.LinkConnectionName = this.InputObject.Name;
}

var linkTables = SynapseAnalyticsClient.ListLinkTables(this.LinkConnectionName)
.Select(element => new PSLinkTableResource(element, this.WorkspaceName, this.LinkConnectionName));
WriteObject(linkTables, true);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Azure.Analytics.Synapse.Artifacts.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Commands.Synapse.Common;
using Microsoft.Azure.Commands.Synapse.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Synapse
{
[Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnectionLinkTableStatus,
DefaultParameterSetName = GetByName)]
[OutputType(typeof(PSLinkConnectionQueryTableStatus))]
public class GetAzureSynapseLinkConnectionLinkTableStatus : SynapseArtifactsCmdletBase
{
private const string GetByName = "GetByName";
private const string GetByObject = "GetByObject";
private const string GetByInputObject = "GetByInputObject";

[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName,
Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)]
[ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public override string WorkspaceName { get; set; }

[Parameter(ValueFromPipeline = true, ParameterSetName = GetByObject,
Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)]
[ValidateNotNull]
public PSSynapseWorkspace WorkspaceObject { get; set; }

[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName,
Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)]
[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByObject,
Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)]
public string LinkConnectionName { get; set; }

[Parameter(ValueFromPipelineByPropertyName = false, Mandatory = true, HelpMessage = HelpMessages.MaxSegmentCount)]
[ValidateNotNullOrEmpty]
public int MaxSegmentCount { get; set; }

[Parameter(ValueFromPipeline = true, ParameterSetName = GetByInputObject,
Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)]
[ValidateNotNull]
public PSLinkConnectionResource InputObject { get; set; }

[Parameter(ValueFromPipelineByPropertyName = false, Mandatory = false, HelpMessage = HelpMessages.LinkTableContinuationToken)]
[ValidateNotNullOrEmpty]
public object ContinuationToken { get; set; }

public override void ExecuteCmdlet()
{
if (this.IsParameterBound(c => c.WorkspaceObject))
{
this.WorkspaceName = this.WorkspaceObject.Name;
}

if (this.IsParameterBound(c => c.InputObject))
{
this.WorkspaceName = this.InputObject.WorkspaceName;
this.LinkConnectionName = this.InputObject.Name;
}

var queryTableStatusRequest = new QueryTableStatusRequest
{
MaxSegmentCount = this.MaxSegmentCount
};

if (this.IsParameterBound(c => c.ContinuationToken))
{
queryTableStatusRequest.ContinuationToken = this.ContinuationToken;
}

var linkTablesStatus = new PSLinkConnectionQueryTableStatus(SynapseAnalyticsClient.QueryTableStatus(this.LinkConnectionName, queryTableStatusRequest));

WriteObject(linkTablesStatus, true);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Commands.Synapse.Common;
using Microsoft.Azure.Commands.Synapse.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Synapse
{
[Cmdlet(VerbsCommon.Get,ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnection, DefaultParameterSetName = GetByName)]
[OutputType(typeof(PSLinkConnectionResource))]
public class GetAzureSynaspeLinkConnection: SynapseArtifactsCmdletBase
{
private const string GetByName = "GetByName";
private const string GetByObject = "GetByObject";

[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName,
Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)]
[ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public override string WorkspaceName { get; set; }

[Parameter(ValueFromPipeline = true, ParameterSetName = GetByObject,
Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)]
[ValidateNotNull]
public PSSynapseWorkspace WorkspaceObject { get; set; }

[Parameter(ValueFromPipelineByPropertyName = false, Mandatory = false, HelpMessage = HelpMessages.LinkConnectionName)]
[ValidateNotNullOrEmpty]
[Alias("LinkConnectionName")]
public string Name { get; set; }

public override void ExecuteCmdlet()
{
if (this.IsParameterBound(c => c.WorkspaceObject))
{
this.WorkspaceName = this.WorkspaceObject.Name;
}

if(this.IsParameterBound(c => c.Name))
{
WriteObject(new PSLinkConnectionResource(SynapseAnalyticsClient.GetLinkConnection(this.Name), this.WorkspaceName));
}
else
{
var linkConnections = SynapseAnalyticsClient.GetLinkConnectionByWorkspace()
.Select(element => new PSLinkConnectionResource(element,this.WorkspaceName));
WriteObject(linkConnections, true);
}
}

}
}
Loading