Azure / Azure/Azurite

Azurite doesn't check if the retention time is too long when set service properties

Open
#815 2 comments 0 reactions 1 assignee Claimed by @blueww View on GitHub
alignment NewArch stale
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

**Error Description:**
Azurite doesn't check if the retention time is too long when set service properties. If the retention days is greater than 365 days, Azurite doesn't return an error and Azure will return an error as following:
![Screenshot 2021-06-08 102254](https://user-images.githubusercontent.com/20970631/121112938-c8abd300-c843-11eb-8b54-7ca3629ea00a.png)

**To Reproduce:**
Please run the demo code as following:
```Typescript
import { delay } from "@azure/core-http";
import { BlobServiceClient, StorageSharedKeyCredential } from "@azure/storage-blob";
import { assert } from "chai";

async function main() {
const blobServiceClient = new BlobServiceClient("", new StorageSharedKeyCredential("", ""));
const serviceProperties = await blobServiceClient.getProperties();
serviceProperties.minuteMetrics = {
enabled: true,
includeAPIs: true,
retentionPolicy: {
days: 366,
enabled: true
}
}
await blobServiceClient.setProperties(serviceProperties);
await delay(5*1000);
const result = await blobServiceClient.getProperties();
}

main().catch((err) => {
assert.ok(err);
});
```

**Expected Behavior:**
Azurite will return an error the same as Azure when set service properties with the invalid retention time.

@jongio for notification.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.