Update-AzSynapseWorkspace
更新 Synapse Analytics 工作區。
語法
SetByNameParameterSet (預設值)
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
Update-AzSynapseWorkspace Cmdlet 會更新 Azure Synapse Analytics 工作區。
範例
範例 1
Update-AzSynapseWorkspace -Name ContosoWorkspace -Tag @{'key'='value'}
此命令會更新指定 Azure Synapse Analytics 工作區的標籤。
範例 2
$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace
$ws | Update-AzSynapseWorkspace -Tag @{'key'='value1'}
此命令會透過管線更新指定 Azure Synapse Analytics 工作區的標籤。
範例 3
Update-AzSynapseWorkspace -ResourceId /subscriptions/21686af7-58ec-4f4d-9c68-f431f4db4edd/resourceGroups/ContosoResourceGroup/providers/Microsoft.Synapse/workspaces/ContosoWorkspace -Tag @{'key'='value2'}
此命令會透過具有資源識別碼的管線,更新指定 Azure Synapse Analytics 工作區的標籤。
範例 4
$config = New-AzSynapseGitRepositoryConfig -RepositoryType GitHub -AccountName ContosoAccount -RepositoryName ContosoRepo -CollaborationBranch main
Update-AzSynapseWorkspace -Name ContosoWorkspace -GitRepository $config
此命令會更新指定 Azure Synapse Analytics 工作區所連線的工作區的 Git 存放庫。
範例 5
Update-AzSynapseWorkspace -Name ContosoWorkspace -EnablePublicNetworkAccess $True
此命令會更新指定的 Azure Synapse Analytics 工作區,以啟用公用網路存取。
範例 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
此命令會更新工作區,以在$uamilist中新增使用者指派的受控識別。
範例 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]
此命令會從工作區移除使用者指派的受控識別 $uamilist[0]。
範例 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
此命令會使用使用者指派的受控識別$uamilist更新工作區,以涵蓋目前的身分識別。
範例 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
此命令示範如何輪替 Synapse 工作區的加密金鑰,而且它會使用系統指派的受控識別來存取 Azure 金鑰保存庫。
範例 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
此命令會將工作區加密受控識別更新為 [使用者指派],並指定使用者指派的身分識別碼,以存取儲存在金鑰保存庫中的客戶管理金鑰。 更新後,我們可以呼叫 Get-AzSynapseWorkspace 取得工作區的Encryption屬性。
參數
-AsJob
在背景執行 Cmdlet
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-EnablePublicNetworkAccess
啟用或停用對工作區的公用網路存取。 可能的值包括:「已啟用」、「已停用」
參數屬性
類型: Boolean
預設值: None
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-EncryptionKeyName
工作區加密金鑰名稱。
參數屬性
類型: String
預設值: None
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-GitRepository
Git 存放庫設定。 將工作區連線到存放庫,以進行原始檔控制和共同作業,以在工作區管線上工作
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
workspace input 物件,通常會透過管線傳遞。
SetByInputObjectParameterSet
Position: Named
必要: True
來自管線的值: True
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-ManagedVirtualNetwork
受控虛擬網路設定。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-Name
Synapse 工作區的名稱。
參數屬性
類型: String
預設值: None
支援萬用字元: False
不要顯示: False
別名: 工作空間名稱
參數集
SetByNameParameterSet
Position: Named
必要: True
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-ResourceGroupName
資源組名。
參數屬性
類型: String
預設值: None
支援萬用字元: False
不要顯示: False
參數集
SetByNameParameterSet
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-ResourceId
Synapse 工作區的資源識別碼。
參數屬性
類型: String
預設值: None
支援萬用字元: False
不要顯示: False
參數集
SetByResourceIdParameterSet
Position: Named
必要: True
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-SqlAdministratorLoginPassword
工作區的新 SQL 系統管理員密碼。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-Tag
與資源相關聯的標籤的字串字典。
參數屬性
類型: Hashtable
預設值: None
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-UserAssignedIdentityAction
當您新增/移除/設定工作區的使用者指派受控識別時,必須指定動作。
支援的動作包括:新增移除集新增是指新增工作區的使用者指派受控識別,移除是指從工作區移除使用者指派的受控識別,當您想要同時新增和移除使用者指派的受控識別時,可以使用設定。
參數屬性
類型: Microsoft.Azure.Commands.Synapse.Models.SynapseConstants+UserAssignedManagedIdentityActionType
預設值: None
接受的值: Add, Remove, Set
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-UserAssignedIdentityId
工作區的使用者指派受控識別識別碼。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-UserAssignedIdentityInEncryption
Workspace Encryption 中使用的使用者指派身分識別資源識別碼
參數屬性
類型: String
預設值: None
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-UseSystemAssignedIdentityInEncryption
指定是否要在 Workspace Encryption 中使用系統指派的身分識別
參數屬性
類型: Object
預設值: None
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。
指令未執行。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
CommonParameters
此 cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters 。
輸出