Update SRE Agent scripts to stable ARM APIs - #312
Update SRE Agent scripts to stable ARM APIs#312Deepthi Chelupati (dm-chelupati) wants to merge 3 commits into
Conversation
cbfd595 to
289af82
Compare
| AGENT_NAME=$(az resource list --resource-group "$RESOURCE_GROUP" --resource-type "Microsoft.App/agents" --query "[0].name" -o tsv) | ||
| AGENT_RESOURCE_ID="/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.App/agents/${AGENT_NAME}" | ||
| API_VERSION="2025-05-01-preview" | ||
| API_VERSION="2026-01-01" |
There was a problem hiding this comment.
Could API_VERSION move into a shared file that every script sources?
Add one file next to the scripts:
# versions.sh
API_VERSION="2026-01-01"Then in apply-extras.sh and anywhere else that needs it, replace the local assignment with:
. "$(dirname "$0")/versions.sh"ARM_BASE and the rest of the script stay as they are: $API_VERSION resolves the same way.
Two notes on the syntax. Use the dot form rather than source so it works under #!/bin/sh. And keep the $(dirname "$0") — a bare . ./versions.sh resolves against whatever directory the caller happens to be in, not the script's own.
After that a version bump is one edit instead of one per script, and the scripts can't drift onto different API versions without anyone noticing.
| Set-StrictMode -Off | ||
|
|
||
| $ApiVersion = "2025-05-01-preview" | ||
| $ApiVersion = "2026-01-01" |
There was a problem hiding this comment.
Could $ApiVersion move into a shared file that every script dot-sources?
Add one file next to the scripts:
# versions.ps1
$ApiVersion = "2026-01-01"Then in each script, replace the local assignment with:
. "$PSScriptRoot\versions.ps1"The rest of the script stays as it is: $ApiVersion resolves the same way.
The leading dot is the whole trick: it runs the file in the current scope. Without it, & "$PSScriptRoot\versions.ps1" runs in a child scope and the variable disappears when that scope exits. $PSScriptRoot keeps it working no matter what directory the caller is in.
After that a version bump is one edit instead of one per script, and the scripts can't drift onto different API versions without anyone noticing.
Summary
Microsoft.App/agentsand typed connector operations to stable API version2026-01-01listConnectorsWithSecretsfor complete connector export metadata while retaining data-plane content downloads2025-05-01-previewonly for the ARM subagent child-resource routeValidation
No Azure resources or agent configurations were modified during validation.