Azure / Azure/azure-rest-api-specs

Storage blob inventory breaking change in 2021-04-01: no policy level `destination` in model & multiple required new properties

Open
#16,696 2 comments 0 reactions 0 assignees View on GitHub
Service Attention Storage
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

Since 2021-04-01, the storage blob inventory model moves the [previous policy level destination](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-02-01/storage.json#L4258) to the [rule level](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-04-01/storage.json#L4321). Thankfully, there is [documentaion](https://docs.microsoft.com/en-us/azure/storage/blobs/blob-inventory#upgrading-an-inventory-policy) declaring this change.

However, there is no migration path for users to use 2021-04-01 API to manage the instance created using old API. E.g. when users invoke a `GET` operation the API still returns the policy level destination. This has no problem if the user is directly manipulating the raw json. But it do has problem for SDK users, where the SDK model doesn't have that policy level destination any more (since the SDK is generated from the swagger).

Additionally, to create a new rule, the 2021-04-01 now asks for a bunch of new required properties - namely `format`, `objectType`, `schedule`, `schemaFields`. They are not returned in the GET response of 2021-04-01.

Two proposals to address this issue:

1. Move the policy level destination back to the model
2. Assign the policy level destination to each rule's destination

Also for those required properties, ensure they are only required for instances created via 2021-04-01 (or later). Alternatively, the service should set sane default value for the old isntances. So that users can go on using the 2021-04-01 to manage those old instances.

Contributor guide

Open the contributing guide

Research direction

Compare specification/storage/resource-manager/Microsoft.Storage/stable/2021-02-01/storage.json and stable/2021-04-01/storage.json around the linked inventory policy and rule models. Read the blob inventory upgrade documentation, then verify how GET responses and new-rule creation handle older instances. Done means the 2021-04-01 model and required properties support managing those instances without losing destination data or requiring absent fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi
Domain
api, cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.