Skip to content

feat(azure): describeResources via az resource show (partial #42) - #49

Merged
lex00 merged 1 commit into
mainfrom
feat/azure-describe-resources-issue-42
May 10, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/azure-describe-resources-issue-42

Conversation

@lex00

@lex00 lex00 commented May 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Continues progress on #42. Brings the Azure lexicon into the snapshot-supported set (now 5 of 11 lexicons covered: AWS, Temporal, K8s, GCP, Azure).

For each declared Azure entity, shells out to:

az resource show --resource-group <env> --name <name> \
                 --resource-type <type> -o json

The <env> argument is treated as the Azure resource group name (consistent with how the AWS lexicon uses <env> as the CloudFormation stack name).

Status mapping

properties.provisioningState is the standard ARM field for resource state. Mapped directly to status. PRESENT is the fallback when the field is absent.

Top-level types only

Nested ARM types like Microsoft.Storage/storageAccounts/blobServices are warn-skipped — az resource show doesn't accept compound type names directly. Adding a per-nested-type query path is a future improvement.

Tests

6 unit cases with mocked exec:

  • Happy path: rg + name + type passed correctly, response mapped
  • Missing provisioningState → PRESENT
  • az failure (resource not found) → entity left out
  • Nested-type entities → warn-skipped, no az call
  • Non-Azure entity types → skipped
  • Missing name prop → silently skipped

Coverage table

Lexicon Status
aws, temporal, k8s, gcp ✅
azure ✅ new — this PR
flyway, slurm ❌ TODO
github, gitlab ❌ may be N/A
helm, docker ⚠️ different model

Verification

  • just build clean
  • npx vitest run lexicons/azure/ → 6/6 new + existing pass

Brings Azure into the snapshot-supported set. For each declared Azure
entity, runs:

  az resource show --resource-group <env> --name <name> \
                   --resource-type <type> -o json

mapping the response to ResourceMetadata keyed by chant entity name
(uses props.name from #39's entity-prop pass-through). The environment
is treated as the Azure resource group name.

Status comes from `properties.provisioningState` (the standard ARM
field for resource state). `PRESENT` is the fallback when the field
is absent.

Top-level ARM types only — nested types like
`Microsoft.Storage/storageAccounts/blobServices` are warn-skipped
since `az resource show` doesn't accept compound type names. Future
work could add a per-nested-type query path.

Resource-not-found is silent — state diff --live then reports as
missing (declared, not in cloud).

6 unit tests with mocked exec cover the happy path, missing
provisioningState, az failure, nested-type warn-skip, non-Azure
entity types, and missing name.
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.

1 participant