Azure / Azure/azure-powershell

[Bug]: Update-AzKeyVaultManagedHsm unable to update certain properties

Open
#28,396 2 comments 0 reactions 0 assignees View on GitHub
act-identity-squad Azure PS Team bug KeyVault potential-pruning Tracking
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

It appears any property outside of the `properties` key in the update payload for the `Update-AzKeyVaultManagedHsm` cannot be updated successfully. Properties that exist within `properties` (where other validations allow) can be updated successfully.

An example of a property that cannot be updated via this cmdlet is `tags`.

Example cmdlet:
`Update-AzKeyVaultManagedHsm -Name $hsmName -ResourceGroupName $rgName -Tag @{ key = "value" }`

Example payload of update causing issue:

```
{
"properties": {
"tenantId": "xxxx-xxxx",
"initialAdminObjectIds": [
"xxxx-xxxx"
],
"softDeleteRetentionInDays": 90,
"networkAcls": {}
},
"location": "Central India",
"sku": {
"name": "Standard_B1",
"family": "B"
}
}
```

### Issue script & Debug output

```PowerShell
-- ARM throws 500 upon attempting to update above example

{
"error": {
"code": "InternalError",
"message": "The server encountered an internal error. Please retry the request."
}
}
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.5.2
PSEdition Core
GitCommitId 7.5.2
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 5.2.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script 6.3.1 Az.KeyVault {Add-AzKeyVaultCertificate, Add-AzKeyVaultCertificateContact, Add-AzKeyVaultKey, Add-…
```

### Error output

```PowerShell

```

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.