[azure-ai-ml] Populate DeploymentTemplate.creation_context.last_modified_by from service modifiedBy - #48545
Open
Swarup Chanda (swarupecenits) wants to merge 2 commits into
Conversation
…rvice modifiedBy The deployment-template service now returns the modifying identity as a flattened modifiedBy field (top-level for get(), nested under properties for list()) alongside a present-but-null lastModifiedBy, but _from_rest_object never read it, so last_modified_by was always None. Extract modifiedBy (properties-first with obj fallback, preferring it over the null lastModifiedBy) via _extract_created_by and populate SystemData.last_modified_by, matching how created_by is read. Adds get()- and list()-shape regression tests. Bug 5475875.
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
DeploymentTemplate.creation_context.last_modified_by from service modifiedByDeploymentTemplate.creation_context.last_modified_by from service modifiedBy
Swarup Chanda (swarupecenits)
marked this pull request as ready for review
August 12, 2026 13:10
Swarup Chanda (swarupecenits)
requested a review
from Amit Chauhan (achauhan-scc)
as a code owner
August 12, 2026 13:10
Swarup Chanda (swarupecenits)
requested review from
Justin Firsching (JustinFirsching),
Klein Hu (NonStatic2014),
Arun (arunsu),
Jayesh Tanna (jayesh-tanna),
kingernupur,
Nikolay Rovinskiy (nick863),
Ayush Mishra (novaturient95),
Razvan Tanase (rtanase),
Riti Sharma (sharma-riti) and
Vivek Ramaswamy (vivram)
as code owners
August 12, 2026 13:10
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Swarup Chanda (swarupecenits)
August 12, 2026 13:11
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Populates deployment-template modifier metadata from flattened service responses.
Changes:
- Reads
modifiedByfor bothget()andlist()response shapes. - Adds regression tests for object and stringified-dictionary identities.
- Documents the fix in the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
deployment_template.py |
Maps modifiedBy to last_modified_by. |
test_deployment_template.py |
Tests both response shapes. |
CHANGELOG.md |
Records the bug fix. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
saanikaguptamicrosoft
approved these changes
Aug 13, 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.
Notes
last_modified_bymetadata parity; the service-side portion was tracked via #5475875):DeploymentTemplate.creation_context.last_modified_bywas alwaysNone, even after the service began returning the modifying identity — so it did not reach parity withModel/Environment(which populatelast_modified_by).Model/Environment(which return a nestedsystemDatablock), the deployment-template API returns flattenedcreatedTime/modifiedTime/createdBy/modifiedByfields top-level inget(), nested underpropertiesinlist()._from_rest_objectreadcreatedBybut never readmodifiedBy, soSystemData.last_modified_bywas never populated. (The service also sends alastModifiedBykey, but it isnull.)modifiedBy(properties-first with a top-level fallback), preferring it over the present-but-nulllastModifiedBy, and pass it intoSystemData(last_modified_by=...). Reuses the existing_extract_created_byhelper, so the dict (get()shape) and stringified-dict (list()shape) are handled identically tocreated_by.created_byhandling already present in_from_rest_object; bothget()(L390) andlist()(L308) go through the same method, so both paths are covered and there is no separate async path. By agreement with the service owner,last_modified_byis populated for newly-created templates only pre-existing templates (nomodifiedByrecorded) returnNoneby design, no backfill.Testing
test_deployment_template_from_rest_object_populates_last_modified_by_flattenedfeeds theget()shape (top-levelmodifiedByobject + nulllastModifiedBy) and assertslast_modified_by == "azure-huggingface".test_deployment_template_from_rest_object_populates_last_modified_by_nested_in_propertiesfeeds the reallist()shape (stringifiedmodifiedBynested underproperties, plus a nulllastModifiedBy) and assertslast_modified_by == "azure-huggingface-staging".azure-huggingfaceregistry (East US): a freshly-created template now returns a populatedlast_modified_byvia bothget()andlist()(previouslyNone), matchingModel/Environment;created_at/created_by/last_modified_atare unchanged.deployment_templateunit suite passes (113 tests);blackandisortclean.Verification (screenshots)
1. Unit tests —
test_deployment_template.py(29 passed, incl. the 2 newlast_modified_byregression tests)2. Live run against

azure-huggingface(East US) -get()/list()valuesExisting glm v5 shows the by-design
last_modified_by=None(no modifier recorded), while a freshly-created template returnslast_modified_byvia bothget()(azure-huggingface) andlist()(azure-huggingface-staging).3. Acceptance verdict — 9/9 checks passed (remaining

list() last_modified_atis service-side, #5475875)Description
Fixes internal bug #5402673.
DeploymentTemplate.creation_context.last_modified_byis no longer alwaysNone: it is now populated from the service'smodifiedByfield, completingcreation_contextmetadata parity withModel/Environment. The deployment-template API returns the modifying identity as a flattenedmodifiedByvalue (top-level inget(), nested underpropertiesinlist()) alongside a present-but-nulllastModifiedBy;_from_rest_objectnow readsmodifiedBy(preferring it over the nulllastModifiedBy) using the same_extract_created_byhelper ascreated_by, so both theget()andlist()shapes are handled. Per service-owner agreement,last_modified_byis populated for newly-created templates; pre-existing templates without a recorded modifier remainNone. The separatelist()last_modified_atdiscrepancy is service-side (#5475875, LIST path) and out of scope here.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines