Update-AzSynapseWorkspace
Updates a Synapse Analytics workspace.
Syntax
SetByNameParameterSet (Default)
Update-AzSynapseWorkspace
-Name <String>
[-ResourceGroupName <String>]
[-Tag <Hashtable>]
[-SqlAdministratorLoginPassword <SecureString>]
[-ManagedVirtualNetwork <PSManagedVirtualNetworkSettings>]
[-EncryptionKeyName <String>]
[-UserAssignedIdentityInEncryption <String>]
[-UseSystemAssignedIdentityInEncryption <Object>]
[-GitRepository <PSWorkspaceRepositoryConfiguration>]
[-UserAssignedIdentityAction <UserAssignedManagedIdentityActionType>]
[-UserAssignedIdentityId <System.Collections.Generic.List`1[System.String]>]
[-EnablePublicNetworkAccess <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzSynapseWorkspace
-InputObject <PSSynapseWorkspace>
[-Tag <Hashtable>]
[-SqlAdministratorLoginPassword <SecureString>]
[-ManagedVirtualNetwork <PSManagedVirtualNetworkSettings>]
[-EncryptionKeyName <String>]
[-UserAssignedIdentityInEncryption <String>]
[-UseSystemAssignedIdentityInEncryption <Object>]
[-GitRepository <PSWorkspaceRepositoryConfiguration>]
[-UserAssignedIdentityAction <UserAssignedManagedIdentityActionType>]
[-UserAssignedIdentityId <System.Collections.Generic.List`1[System.String]>]
[-EnablePublicNetworkAccess <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetByResourceIdParameterSet
Update-AzSynapseWorkspace
-ResourceId <String>
[-Tag <Hashtable>]
[-SqlAdministratorLoginPassword <SecureString>]
[-ManagedVirtualNetwork <PSManagedVirtualNetworkSettings>]
[-EncryptionKeyName <String>]
[-UserAssignedIdentityInEncryption <String>]
[-UseSystemAssignedIdentityInEncryption <Object>]
[-GitRepository <PSWorkspaceRepositoryConfiguration>]
[-UserAssignedIdentityAction <UserAssignedManagedIdentityActionType>]
[-UserAssignedIdentityId <System.Collections.Generic.List`1[System.String]>]
[-EnablePublicNetworkAccess <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Update-AzSynapseWorkspace cmdlet updates an Azure Synapse Analytics workspace.
Examples
Example 1
Update-AzSynapseWorkspace -Name ContosoWorkspace -Tag @{'key'='value'}
This command updates tags for the specified Azure Synapse Analytics workspace.
Example 2
$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace
$ws | Update-AzSynapseWorkspace -Tag @{'key'='value1'}
This commands updates tags for the specified Azure Synapse Analytics workspace through pipeline.
Example 3
Update-AzSynapseWorkspace -ResourceId /subscriptions/21686af7-58ec-4f4d-9c68-f431f4db4edd/resourceGroups/ContosoResourceGroup/providers/Microsoft.Synapse/workspaces/ContosoWorkspace -Tag @{'key'='value2'}
This commands updates tags for the specified Azure Synapse Analytics workspace through pipeline with resource ID.
Example 4
$config = New-AzSynapseGitRepositoryConfig -RepositoryType GitHub -AccountName ContosoAccount -RepositoryName ContosoRepo -CollaborationBranch main
Update-AzSynapseWorkspace -Name ContosoWorkspace -GitRepository $config
This commands updates Git repository which workspace is connected to for the specified Azure Synapse Analytics workspace.
Example 5
Update-AzSynapseWorkspace -Name ContosoWorkspace -EnablePublicNetworkAccess $True
This commands updates the specified Azure Synapse Analytics workspace to enable public network access.
Example 6
$uamis = Get-AzUserAssignedIdentity -ResourceGroupName ContosoResourceGroup
$uamilist = New-Object System.Collections.Generic.List[string]
foreach($uami in $uamis){
$uamilist.Add($uami.Id)
}
Update-AzSynapseWorkspace -Name ContosoWorkspace -UserAssignedIdentityAction Add -UserAssignedIdentityId $uamilist
This commands updates workspace to add user assigned managed identities in $uamilist.
Example 7
$uamis = Get-AzUserAssignedIdentity -ResourceGroupName ContosoResourceGroup
$uamilist = New-Object System.Collections.Generic.List[string]
foreach($uami in $uamis){
$uamilist.Add($uami.Id)
}
Update-AzSynapseWorkspace -Name ContosoWorkspace -UserAssignedIdentityAction Remove -UserAssignedIdentityId $uamilist[0]
This commands removes user assigned managed identities $uamilist[0] from workspace.
Example 8
$uamis = Get-AzUserAssignedIdentity -ResourceGroupName ContosoResourceGroup
$uamilist = New-Object System.Collections.Generic.List[string]
foreach($uami in $uamis){
$uamilist.Add($uami.Id)
}
Update-AzSynapseWorkspace -Name ContosoWorkspace -UserAssignedIdentityAction Set -UserAssignedIdentityId $uamilist
This commands updates workspace with user assigned managed identities $uamilist that will cover current identities.
Example 9
##Add a temp key to the workspace
New-AzSynapseWorkspaceKey -ResourceGroupName ContosoResourceGroup -WorkspaceName ContosoWorkspace -Name TempKey -EncryptionKeyIdentifier https://contosoKeyVault.vault.azure.net/keys/TempKey
##Update the workspace and set the temp key as the TDE protector
Update-AzSynapseWorkspace -WorkspaceName ContosoWorkspace -EncryptionKeyName TempKey -UseSystemAssignedIdentityInEncryption $true
##Note, we need to create a new key version for the original encryption key of the Azure key vault before moving to next steps.
##Update the workspace and set the encryption key back after we created a new key version.
Update-AzSynapseWorkspace -WorkspaceName ContosoWorkspace -EncryptionKeyName default -UseSystemAssignedIdentityInEncryption $true
##Remove the temp key
Remove-AzSynapseWorkspaceKey -WorkspaceName ContosoWorkspace -Name TempKey
This commands demonstrate how to rotate the encryption key of a Synapse workspace, and it is using System Assigned Managed Identity to access the Azure Key Vault.
Example 10
$uamis = Get-AzUserAssignedIdentity -ResourceGroupName ContosoResourceGroup
$identityId = $uamis[0].Id
$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace
$ws | Update-AzSynapseWorkspace -UseSystemAssignedIdentityInEncryption $false -UserAssignedIdentityInEncryption $identityId
$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace
$ws.Encryption.CustomerManagedKeyDetails.Key
Name KeyVaultUrl
---- -----------
default https://contosoKeyValut.vault.azure.net/keys/testkey
$ws = Get-AzSynapseWorkspace -name ContosoWorkspace
$ws.Encryption.CustomerManagedKeyDetails.KekIdentity
UserAssignedIdentity UseSystemAssignedIdentity
-------------------- -------------------------
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/ContosoResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uaminame False
This commands updates workspace Encryption Managed Identity as User Assigned and specify an user assigned identity Id to access your customer-managed key stored in key vault. After updating, we can call Get-AzSynapseWorkspace
to get Encryption properties of workspace.
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
-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
-EnablePublicNetworkAccess
Enable or Disable public network access to workspace. Possible values include: 'Enabled', 'Disabled'
Parameter properties
Type: Boolean
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
-EncryptionKeyName
The workspace encryption key name.
Parameter properties
Type: String
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
-GitRepository
Git Repository Settings. Connect workspace to the repository for source control and collaboration for work on your workspace pipelines
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
workspace input object, usually passed through the pipeline.
SetByInputObjectParameterSet
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-ManagedVirtualNetwork
Managed Virtual Network Settings.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
Name of Synapse workspace.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: WorkspaceName
Parameter sets
SetByNameParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Resource group name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByNameParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceId
Resource identifier of Synapse workspace.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByResourceIdParameterSet
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SqlAdministratorLoginPassword
The new SQL administrator password for the workspace.
Parameter properties
Type: SecureString
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
-Tag
A string,string dictionary of tags associated with the resource.
Parameter properties
Type: Hashtable
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
-UserAssignedIdentityAction
Action must be specified when you add/remove/set user assigned managed identities for workspace.
The supported actions are:
Add
Remove
Set
Add means to add user assigned managed identities for workspace, Remove means to remove user assigned managed identities from workspace, Set can be used when you want to add and remove user assigned managed identities at the same time.
Parameter properties
Type: Microsoft.Azure.Commands.Synapse.Models.SynapseConstants+UserAssignedManagedIdentityActionType
Default value: None
Accepted values: Add, Remove, Set
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
-UserAssignedIdentityId
User assigned managed identity Id for workspace.
Parameter properties
Type: List<T> [ String ]
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
-UserAssignedIdentityInEncryption
User assigned identity resource Id used in Workspace Encryption
Parameter properties
Type: String
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
-UseSystemAssignedIdentityInEncryption
specifying whether to use system assigned identity in Workspace Encryption or not
Parameter properties
Type: Object
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
-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
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 .
Outputs