Skip to content

Update SRE Agent scripts to stable ARM APIs - #312

Open
Deepthi Chelupati (dm-chelupati) wants to merge 3 commits into
mainfrom
update/stable-sre-agent-api
Open

Update SRE Agent scripts to stable ARM APIs#312
Deepthi Chelupati (dm-chelupati) wants to merge 3 commits into
mainfrom
update/stable-sre-agent-api

Conversation

@dm-chelupati

@dm-chelupati Deepthi Chelupati (dm-chelupati) commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • update supported Microsoft.App/agents and typed connector operations to stable API version 2026-01-01
  • move GitHub connector creation, verification, and export enumeration to the stable control plane
  • use listConnectorsWithSecrets for complete connector export metadata while retaining data-plane content downloads
  • remove obsolete opaque ARM child-resource PUT helpers
  • retain 2025-05-01-preview only for the ARM subagent child-resource route
  • retain data-plane calls where no equivalent stable control-plane operation exists
  • validate PyYAML before export begins

Validation

  • shell, PowerShell, Node, Python, and JSON syntax checks
  • live read-only Bash and PowerShell exports
  • generated JSON and YAML parsing
  • Bash and PowerShell connector output parity

No Azure resources or agent configurations were modified during validation.

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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

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.

2 participants