ITADN

armstorage: support Smart access tier (requires api-version 2025-08-01)

#26724Opentravcunn 创建于 2026-05-05
StorageMgmtcustomer-reportedneeds-team-attention
T
travcunncommented
### Summary The `armstorage` package's `AccessTier` enum has not been updated to include `"Smart"`, and the SDK's pinned API version predates the GA release of Smart-tier on Azure Storage. As a result, attempting to deploy a storage account with `properties.accessTier = "Smart"` through the SDK fails with `InvalidRequestPropertyValue`. ### Background [Smart tier](https://learn.microsoft.com/en-us/azure/storage/blobs/access-tiers-smart) reached general availability in April 2026 and requires REST API version `2025-08-01` or newer. It's set the same way as Hot or Cool — `properties.accessTier = "Smart"` on a Standard GPv2 account with zone-redundant replication. ### Current state `armstorage` v3.0.0 (latest as of writing) defines: ```go const ( AccessTierCold AccessTier = "Cold" AccessTierCool AccessTier = "Cool" AccessTierHot AccessTier = "Hot" AccessTierPremium AccessTier = "Premium" ) ``` No `AccessTierSmart`. Casting the string literal works on the type level (`armstorage.AccessTier("Smart")`) but fails at the wire because the SDK sends an older `api-version` query string that doesn't recognize the value. ### Reproduction ```go import "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v3" smart := armstorage.AccessTier("Smart") params := armstorage.AccountCreateParameters{ SKU: &armstorage.SKU{Name: to.Ptr(armstorage.SKUNameStandardZRS)}, Kind: to.Ptr(armstorage.KindStorageV2), Location: to.Ptr("westus2"), Properties: &armstorage.AccountPropertiesCreateParameters{ AccessTier: &smart, }, } // BeginCreate returns: // RESPONSE 400: 400 Bad Request // ERROR CODE: InvalidRequestPropertyValue // "The value 'Smart' is not allowed for property accessTier." ``` ### Request 1. Add `AccessTierSmart AccessTier = "Smart"` to the constants and `PossibleAccessTierValues()`. 2. Bump the underlying `api-version` query string to `2025-08-01` (or whichever version is current at release time) so the API accepts Smart. ### Refs - Smart tier docs: https://learn.microsoft.com/en-us/azure/storage/blobs/access-tiers-smart - GA announcement: https://azure.microsoft.com/en-us/blog/optimize-object-storage-costs-automatically-with-smart-tier-now-generally-available/
1 条评论