az resource tag failing to update General Purpose V2 SQL Managed Instance
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
## Describe the bug
Attempting to update the tags on a General Purpose V2 SQL Managed Instance fails using `az resource tag`. The managed instance itself is deployed and updated via bicep templates, but at the end of our deployment script we update some tags on it.
**Command**
`az resource tag -g MyGroup -n MyServer --tags MyTag=TagValue --resource-type "Microsoft.Sql/managedInstances"`
**Errors:**
```
(GPTargetEditionAndUnspecifiedGPV2NotAllowedInUpdateOFGPV2MI) Combination of General Purpose target edition (sku.name/sku.tier parameters) and unspecified value for the isGeneralPurposeV2 parameter is not allowed in the update operation of General Purpose V2 Managed Instance.
Code: GPTargetEditionAndUnspecifiedGPV2NotAllowedInUpdateOFGPV2MI
Message: Combination of General Purpose target edition (sku.name/sku.tier parameters) and unspecified value for the isGeneralPurposeV2 parameter is not allowed in the update operation of General Purpose V2 Managed Instance.
```
**Server Details**
Running `az sql mi show` on the managed instance shows the following details (snipped to just relevant details)
```
{
"isGeneralPurposeV2": true,
"sku": {
"capacity": 4,
"family": "Gen5",
"name": "GP_Gen5",
"size": null,
"tier": "GeneralPurpose"
},
"storageIops": 6144,
"storageSizeInGb": 2048,
"storageThroughputMbps": 145,
}
```
We can see that the error is complaining that there is an `unspecified value for the isGeneralPurposeV2 parameter`. I'm not sure what the command is doing internally and why updating tags is triggering this, but you can see that the isGeneralPurposeV2 is specified on the current server details.
## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Create a General Purpose V2 managed instance
- Run `az resource tag -g MyGroup -n MyServer --tags MyTag=TagValue --resource-type "Microsoft.Sql/managedInstances"`
## Expected Behavior
Tags are updated without an error being raised.
This works correctly on our non-V2 managed instances, or though I notice that updating the tags seems to trigger a scaling event instead of just adding some tags.
## Environment Summary
```
Windows-10-10.0.22631-SP0
Python 3.11.8
Installer: MSI
azure-cli 2.65.0
Extensions:
datafactory 1.0.0
datamigration 1.0.0b1
maintenance 1.6.0
scheduled-query 1.0.0b1
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
```
## Additional Context
## Related Issues
This seems similar to https://github.com/Azure/azure-cli/issues/29013
Contributor guide
Assessment
This issue has not been assessed yet.