Fixed issue calling namespace_update related to PartitionCount updates - #3187
Merged
Conversation
LarryOsterman
requested review from
KarishmaGhiya,
RickWinter,
g2vinay,
msalaman,
sandeep-sen and
vukelich
July 30, 2026 23:39
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Event Hubs event hub create/update behavior so that updating a subset of properties doesn’t accidentally omit existing values (notably PartitionCount) in the PUT payload, which can trigger ARM validation errors.
Changes:
- Fetch existing Event Hub data (if present) before issuing
CreateOrUpdateAsync. - Preserve
PartitionCount,RetentionDescription, andStatuswhen the caller doesn’t provide new values.
LarryOsterman
force-pushed
the
larryo/fixed_namespace_update_tool
branch
from
July 31, 2026 18:02
34028fd to
d7d412d
Compare
…ing optional fields
CreateOrUpdateEventHubAsync dereferenced GetIfExistsAsync's NullableResponse<T>.Value directly via the null-conditional operator, which does not guard against the Value getter throwing InvalidOperationException when the entity does not exist (a 404 was returned). This caused EventHubs create/update operations for brand new event hubs and consumer groups to fail deterministically. Fixed by checking HasValue before accessing Value, matching the existing convention used elsewhere in this file for the same NullableResponse pattern. Also added a defensive eventual-consistency retry helper around ARM operation.Value/GET resolution for entities that were just created. Re-recorded all EventHubs live tests (109/109 passing in both Record and Playback mode) against the Azure SDK Test Resources - TME subscription and pushed recordings to Azure/azure-sdk-assets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
LarryOsterman
force-pushed
the
larryo/fixed_namespace_update_tool
branch
from
August 3, 2026 18:02
18dc4b6 to
9ad2821
Compare
RickWinter
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The namespace_update tool fails with "PartitionCount cannot be updated" error when the tool is called to update a partition. This is because ARM treats the namespace update as a merge/patch update rather than a put.
GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline