Azure / Azure/azure-powershell

Implement tests for Remove-AzSqlManagedInstanceKeyVaultKey when bug in Management service is fixed

Open
#7,333 1 comment 0 reactions 1 assignee Claimed by @nivimsft View on GitHub
act-codegen-extensibility-squad Service Attention SQL Test Debt
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

Currently there is a bug in Management Service that causes the Remove-AzSqlManagedInstanceKeyVaultKey cmdlet to fail. Due to this reason it is not possible to write a unit test for this cmdlet. Once the bug is fixed we should add a test for this cmdlet

### Script/Steps for Reproduction

```powershell
$mangedInstanceRg = "MlAndzic_RG"
$managedInstanceName = "midemoinstancebc"
$keyVaultName = "mitest-doNotDelete"
$keyName = "mitest-key"
$keyId = "https://mitest-donotdelete.vault.azure.net/keys/mitest-key/e97043455e14493ca05c3642549aedba"
$keyVersion = "e97043455e14493ca05c3642549aedba"
$tdeKeyName = $keyVaultName + "_" + $keyName + "_" + $keyVersion
$managedInstance = Get-AzureRmSqlManagedInstance -Name $managedInstanceName -ResourceGroupName $mangedInstanceRg

Remove-AzureRmSqlManagedInstanceKeyVaultKey -ManagedInstance $managedInstance -KeyId $keyId
```

### Module Version

```powershell
Get-Module -ListAvailable
```

### Environment Data

```powershell
$PSVersionTable
```

### Debug Output

```
Remove-AzureRmSqlManagedInstanceKeyVaultKey : Long running operation failed with status 'Canceled'. Additional
Info:'An unexpected error occured while processing the request. Tracking ID: 'b7523747-bcbe-4894-a7f3-bccc3d7ee6a1''
At line:1 char:1
+ Remove-AzureRmSqlManagedInstanceKeyVaultKey -ManagedInstance $managed ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Remove-AzureRmS...anceKeyVaultKey], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.TransparentDataEncryption.Cmdlet.RemoveAzureRmSqlManagedIns
tanceKeyVaultKey
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.