-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated support for synapse role assignment and Added support for rol…
…e scope (#14172) * fixing compliationerror * getroleassignment * refine parametersetname * add scope to newroleassignment * add list scope command * refine new-azuresynapseroleassignment * add Itemtype and Item * refine newAzureSynapseRoleAssignment * remove unnecessary feeds * refine deleteroleassignmentid * refine resourceid name * improve remove and getroleassignments * itemtype and item improvement * Fix a few issues * Correct exception types * add principle type * add principaltype * caseinsent * update changelog * add doc for get-azsyanpserolescope * remove powershlles * update help doc * add objectid back * update Az.Synapse.md * update auto generated mdfiles * update changelog * update changelog2 * update changelog3 * update changelog4 * update changelog5 * update changelog6 * update changelog7 * Update src/Synapse/Synapse/ChangeLog.md Co-authored-by: Beisi Zhou <[email protected]> Co-authored-by: Dongwei Wang <[email protected]> Co-authored-by: Beisi Zhou <[email protected]>
- Loading branch information
1 parent
301e81f
commit 1793624
Showing
20 changed files
with
737 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/Synapse/Synapse/Commands/DataPlaneCommands/AccessControl/GetAzureSynapseRoleScope.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Microsoft.Azure.Commands.Common.Exceptions; | ||
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; | ||
using Microsoft.Azure.Commands.Synapse.Common; | ||
using Microsoft.Azure.Commands.Synapse.Models; | ||
using Microsoft.Azure.Commands.Synapse.Properties; | ||
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; | ||
using Microsoft.WindowsAzure.Commands.Utilities.Common; | ||
using System; | ||
using System.Linq; | ||
using System.Management.Automation; | ||
|
||
namespace Microsoft.Azure.Commands.Synapse | ||
{ | ||
[Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.RoleScope, | ||
DefaultParameterSetName = GetByWorkspaceNameParameterSet)] | ||
[OutputType(typeof(PSSynapseRole))] | ||
public class GetAzureSynapseRoleScope : SynapseRoleCmdletBase | ||
{ | ||
private const string GetByWorkspaceNameParameterSet = "GetByWorkspaceNameParameterSet"; | ||
private const string GetByWorkspaceObjectParameterSet = "GetByWorkspaceObjectParameterSet"; | ||
|
||
[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByWorkspaceNameParameterSet, | ||
Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] | ||
[ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] | ||
[ValidateNotNullOrEmpty] | ||
public override string WorkspaceName { get; set; } | ||
|
||
[Parameter(ValueFromPipeline = true, ParameterSetName = GetByWorkspaceObjectParameterSet, | ||
Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] | ||
[ValidateNotNull] | ||
public PSSynapseWorkspace WorkspaceObject { get; set; } | ||
|
||
[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByWorkspaceNameParameterSet, | ||
Mandatory = false, HelpMessage = HelpMessages.WorkspaceResourceId)] | ||
[Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByWorkspaceObjectParameterSet, | ||
Mandatory = false, HelpMessage = HelpMessages.WorkspaceResourceId)] | ||
[ValidateNotNullOrEmpty] | ||
public string ResourceId { get; set; } | ||
|
||
public override void ExecuteCmdlet() | ||
{ | ||
if (this.IsParameterBound(c => c.ResourceId)) | ||
{ | ||
var resourceIdentifier = new ResourceIdentifier(this.ResourceId); | ||
this.WorkspaceName = resourceIdentifier.ResourceName; | ||
} | ||
|
||
if (this.IsParameterBound(c => c.WorkspaceObject)) | ||
{ | ||
this.WorkspaceName = this.WorkspaceObject.Name; | ||
} | ||
|
||
var roleScopes = SynapseAnalyticsClient.ListRoleScopes(); | ||
WriteObject(roleScopes, true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.