Skip to content

Fix azurite-table banner reporting configured port instead of bound port - #2643

Open
Robert McLaws (robertmclaws) wants to merge 1 commit into
Azure:mainfrom
robertmclaws:fix/table-main-port-reporting
Open

Fix azurite-table banner reporting configured port instead of bound port#2643
Robert McLaws (robertmclaws) wants to merge 1 commit into
Azure:mainfrom
robertmclaws:fix/table-main-port-reporting

Conversation

@robertmclaws

Copy link
Copy Markdown

Summary

  • The standalone azurite-table entry point printed its "successfully started" banner using config.port evaluated before server.start(), so callers passing --tablePort 0 saw port: 0 instead of the actual OS-assigned port.
  • azurite-blob and azurite-queue already inline server.getHttpServerAddress() after await server.start(); this PR brings table to parity.
  • Wording is also normalized from "successfully started on" to "successfully listens on" to match the sibling providers.

Fixes #2642. Related: #145 (the original OS-assigned port feature this bug defeated for table-only callers), #2347 (table-only Storage Explorer connectivity — the divergent banner wording is the most visible symptom of the same code-path inconsistency).

Diff

// src/table/main.ts (before)
const beforeStartMessage = `Azurite Table service is starting on ${config.host}:${config.port}`;
const afterStartMessage = `Azurite Table service successfully started on ${config.host}:${config.port}`;
...
console.log(beforeStartMessage);
await server.start();
console.log(afterStartMessage);  // evaluated before start — port still 0
// src/table/main.ts (after — mirrors blob/main.ts and queue/main.ts)
console.log(`Azurite Table service is starting on ${config.host}:${config.port}`);
await server.start();
console.log(`Azurite Table service successfully listens on ${server.getHttpServerAddress()}`);

Test plan

  • npm run lint passes
  • npm run build (tsc) passes
  • Manual smoke test with --tablePort 0:
    Azurite Table service is starting on 127.0.0.1:0
    Azurite Table service successfully listens on http://127.0.0.1:57443
    
  • Manual smoke test with --tablePort 12345 (explicit port still works):
    Azurite Table service is starting on 127.0.0.1:12345
    Azurite Table service successfully listens on http://127.0.0.1:12345
    
  • No tests reference the old "successfully started on" wording (grep -rn "successfully started" tests/ is empty for this string).

The standalone azurite-table entry point printed its "successfully
started" banner using the configured port from `config.port`. When a
caller passes `--tablePort 0` to request an OS-assigned port, this
caused the banner to report port 0 instead of the actual bound port,
breaking any tooling that parses the banner to discover where the
service is listening (e.g. Storage Explorer, test harnesses that need
to construct a connection string).

The blob and queue entry points already use
`server.getHttpServerAddress()` for this message; align table to match.
The wording is also normalized from "successfully started on" to
"successfully listens on" for consistency with blob and queue.
@jainakanksha-msft

Copy link
Copy Markdown
Member

Robert McLaws (@robertmclaws) , could you please refresh your PR with main, and address the review comments if any to move this PR forward.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes the azurite-table standalone startup banner so it reports the actual bound address after server.start() (important when --tablePort 0 is used for OS-assigned ports), and aligns the banner wording with the blob/queue entry points.

Changes:

  • Update src/table/main.ts to print the post-start banner using server.getHttpServerAddress() after await server.start().
  • Normalize the table banner wording from “successfully started on” to “successfully listens on” to match other services.
  • Document the fix under the “Upcoming Release” section in ChangeLog.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/table/main.ts Prints the post-start banner using the bound address via server.getHttpServerAddress() after start.
ChangeLog.md Adds an Upcoming Release note describing the corrected table startup banner behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

azurite-table reports configured port (0) in startup banner instead of OS-bound port

3 participants