Skip to content

Allow skip version check to be set with env var#2628

Open
HerrDerb wants to merge 3 commits intoAzure:mainfrom
HerrDerb:version-check-env-var
Open

Allow skip version check to be set with env var#2628
HerrDerb wants to merge 3 commits intoAzure:mainfrom
HerrDerb:version-check-env-var

Conversation

@HerrDerb
Copy link

@HerrDerb HerrDerb commented Feb 9, 2026

Allow to set skipApiVersionCheck flag with env var AZURITE_SKIP_API_VERSION_CHECK=true

This allows to deactivate the skipApiVersionCheck in an easy way when running in a container such as a testcontainer.

Resolves #2626

@HerrDerb HerrDerb force-pushed the version-check-env-var branch from d5802f6 to 215176b Compare March 5, 2026 10:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for enabling Azurite’s --skipApiVersionCheck behavior via an environment variable, primarily to simplify container/testcontainer usage.

Changes:

  • Add AZURITE_SKIP_API_VERSION_CHECK=true support to enable skipApiVersionCheck in the combined azurite entrypoint environment parsing.
  • Add a new unit test file covering default behavior, env-var behavior, and CLI-flag behavior.
  • Document the new env var support in the changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/common/Environment.ts Extends skipApiVersionCheck() to return true when AZURITE_SKIP_API_VERSION_CHECK is set to "true".
tests/common/environment.test.ts Adds tests for env var and CLI flag behavior around skipApiVersionCheck().
ChangeLog.md Notes the new env var support under “Upcoming Release”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HerrDerb HerrDerb requested a review from davsclaus March 18, 2026 08:19
@HerrDerb HerrDerb changed the title Allo skip version check to be set with env var Allow skip version check to be set with env var Mar 18, 2026
Copilot AI review requested due to automatic review settings March 18, 2026 10:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for configuring skipApiVersionCheck via the AZURITE_SKIP_API_VERSION_CHECK=true environment variable, making it easier to disable API version enforcement in containerized/testcontainer scenarios (per issue #2626).

Changes:

  • Introduces a shared shouldSkipApiVersionCheck() helper that checks both CLI flags and AZURITE_SKIP_API_VERSION_CHECK.
  • Updates Blob/Queue/Table and the common Environment to use the shared helper.
  • Adds new unit tests for the env-var behavior and updates the changelog.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/blob/blobEnvironment.test.ts Adds coverage for env-var-driven skipApiVersionCheck() behavior in BlobEnvironment.
tests/queue/queueEnvironment.test.ts Adds coverage for env-var-driven skipApiVersionCheck() behavior in QueueEnvironment.
tests/table/tableEnvironment.test.ts Adds coverage for env-var-driven skipApiVersionCheck() behavior in TableEnvironment.
tests/common/environment.test.ts Adds tests for the common Environment behavior (but currently not run by CI scripts).
src/blob/BlobEnvironment.ts Delegates skipApiVersionCheck() logic to the shared helper.
src/queue/QueueEnvironment.ts Delegates skipApiVersionCheck() logic to the shared helper.
src/table/TableEnvironment.ts Delegates skipApiVersionCheck() logic to the shared helper; includes minor formatting changes.
src/common/Environment.ts Delegates skipApiVersionCheck() logic to the shared helper for the azurite CLI.
src/common/utils/utils.ts Adds shouldSkipApiVersionCheck() helper reading CLI flags + env var.
ChangeLog.md Documents the new env var support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +5 to +16
describe("Environment", () => {
const originalArgv = process.argv;

beforeEach(() => {
process.argv = ["node", "azurite"];
delete process.env.AZURITE_SKIP_API_VERSION_CHECK;
});

afterEach(() => {
process.argv = originalArgv;
delete process.env.AZURITE_SKIP_API_VERSION_CHECK;
});
Comment on lines +173 to +183
/**
* Shared helper to determine whether API version checks should be skipped.
* This checks both CLI flags and the AZURITE_SKIP_API_VERSION_CHECK env var.
*/
export function shouldSkipApiVersionCheck(flags: any): boolean {
if (flags && flags.skipApiVersionCheck !== undefined) {
return true;
}
if (process.env.AZURITE_SKIP_API_VERSION_CHECK === "true") {
return true;
}
- Performance improvements for internal metadata access using in-memory metadata store
- Fix building failure on Node 22 platform.
- Fix * IfMatch for non-existent resource not throwing 412 Precondition Failed
- Allow setting `--skipApiVersionCheck` via the `AZURITE_SKIP_API_VERSION_CHECK=true` environment variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set --skipApiVersionCheck with an env variable AZURITE_SKIP_API_VERSION_CHECK

3 participants