Skip to content

Add lstk setup azure for registering custom cloud#251

Draft
carole-lavillonniere wants to merge 2 commits into
mainfrom
flc-656-register-azure-custom-cloud-in-lstk
Draft

Add lstk setup azure for registering custom cloud#251
carole-lavillonniere wants to merge 2 commits into
mainfrom
flc-656-register-azure-custom-cloud-in-lstk

Conversation

@carole-lavillonniere
Copy link
Copy Markdown
Collaborator

@carole-lavillonniere carole-lavillonniere commented May 19, 2026

Motivation

Bring the azlocal start-interception flow into lstk so users can register and activate the LocalStack custom cloud in the Azure CLI without a separate Python tool.

Changes

  • New lstk setup azure subcommand that registers (or updates) the LocalStack cloud in az, activates it, disables instance discovery, and logs in with dummy service-principal credentials.
  • internal/azurecli thin wrapper around the az binary with OTel spans.
  • internal/azureconfig owns the cloud-setup flow: health probe of the emulator, cloud-config JSON (mirrors azlocal's trailing-slash convention), and the four az invocations. Emits progress events between steps so the TUI shows what's happening.
  • internal/ui/run_azureconfig.go resolves host:port from the Azure container in config.toml, builds the https://azure.<host>:<port> endpoint, and runs the setup under the TUI.
  • Fails early with clear messages when there's no Azure container in config, the emulator isn't reachable, az isn't on PATH, or the user isn't in an interactive terminal.

Tests

  • Unit tests for BuildEndpoint, cloud-config JSON shape (trailing slashes on management/microsoftGraphResourceId/resourceManager, bare on the AD/log endpoints), and IsRunning against an httptest server.
  • Integration tests for the non-interactive error and the missing-Azure-container error.
  • Manual: happy path against localstack/localstack-azure-alphasetup azure then az group list hits LocalStack:
az cloud show --query "{name:name,mgmt:endpoints.resourceManager}"
{
  "mgmt": "https://azure.localhost.localstack.cloud:4566/",
  "name": "LocalStack"
}

Todo

  • Wire Azure into knownImages / emulatorHealthPaths / ContainerPort so lstk start can launch the Azure emulator (separate ticket).
  • lstk azure proxy passthrough (separate ticket).
  • Undo flow (stop-interception equivalent) (separate ticket).

Towards FLC-656

@carole-lavillonniere carole-lavillonniere changed the title Add lstk setup azure for registering LocalStack custom cloud Add lstk setup azure for registering custom cloud May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant