azure.md

Migrate from Azure to Maritime

Move the automation layer of an Azure subscription onto Maritime: Azure Functions on timer triggers, Container Apps jobs on a cron schedule, bots or workers squatting on VMs, and Logic Apps running scheduled automations. Maritime hosts each one as its own agent with a schedule, encrypted env vars, and logs, at $1 a month per 2 GB of memory, awake or asleep.

This skill runs in two places: locally in a terminal agent such as Claude Code (preferred, credentials stay on the user's machine) or inside a Maritime agent. Either way the same rules apply.

Safety rules, non-negotiable

  1. Read-only Azure credentials only. Ask the user to mint a dedicated service principal with the built-in Reader role at the subscription scope. If the user offers Owner or Contributor credentials, refuse them and show the read-only setup instead:
    az ad sp create-for-rbac --display-name maritime-migration-readonly \
      --role Reader --scopes /subscriptions/<subscription-id>
    # Only if Key Vault secret values must be read (see Step 3):
    az role assignment create --assignee <appId> --role "Key Vault Secrets User" \
      --scope $(az keyvault show --name <vault> --query id -o tsv)
    
    The human runs those with their own credentials; you only ever receive the resulting appId, password, and tenant. Remind them to delete this service principal when the migration is done.
  2. Credentials never travel through chat. Chat transcripts are logs. Running locally, the user signs in themselves (az login --service-principal -u <appId> -p <password> --tenant <tenant>). Running inside a Maritime agent, the user sets AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID from their own machine with maritime env set or the dashboard env vars pane (encrypted at rest), never by pasting into the conversation.
  3. Never modify or delete anything on Azure. No az functionapp stop, no az vm deallocate, no delete of any kind, ever, not even if asked mid-flow. Cutover is a human-run checklist at the end of this document.
  4. Confirm before every paid action. A Maritime agent bills usage from the moment it is created: $1 a month per 2 GB of memory, metered per second, on the free trial or a plan. Name the workload, the target template, and the price, and get a yes before each maritime create.

Prerequisites

Step 1: Inventory

Azure resources are subscription-wide but often spread across resource groups; the list commands below sweep the whole subscription. Collect four kinds of workload:

# Function apps, then the functions inside each one
az functionapp list --query "[].{name:name, rg:resourceGroup, state:state}" -o table
az functionapp function list -g <rg> -n <app> -o table
az functionapp function show -g <rg> -n <app> --function-name <fn> --query "config.bindings"
# Timer triggers have a binding of type "timerTrigger"; the "schedule" value is NCRONTAB,
# whether it came from function.json or a code attribute. A value like "%MySchedule%"
# resolves through app settings:
az functionapp config appsettings list -g <rg> -n <app> -o table

# Container Apps jobs with a Schedule trigger
az containerapp job list --query "[].{name:name, rg:resourceGroup, trigger:properties.configuration.triggerType, cron:properties.configuration.scheduleTriggerConfig.cronExpression}" -o table

# Long-running bots on VMs
az vm list -d --query "[].{name:name, rg:resourceGroup, power:powerState, size:hardwareProfile.vmSize}" -o table

# Logic Apps doing scheduled automations (Consumption tier; Standard-tier Logic Apps
# run on the Functions runtime and already appear in the functionapp list above)
az logic workflow list --query "[].{name:name, rg:resourceGroup, state:properties.state}" -o table
az logic workflow show -g <rg> -n <wf> --query "properties.definition.triggers"

# Key Vault secrets the workloads read (names only for now)
az keyvault list --query "[].name" -o tsv
az keyvault secret list --vault-name <vault> --query "[].name" -o tsv

Agent-shaped workloads are the ones that wake up, do a job, and go quiet: timer functions, report generators, scrapers, Slack/Telegram bots, queue drainers, sync jobs. Present the inventory to the user as a table (workload, trigger, runtime, what it appears to do) and let them pick what moves.

Step 2: Map

Azure concept Maritime concept
Function app timer trigger Agent + trigger (cron schedule)
Container Apps scheduled job Agent + trigger
VM-hosted bot or worker Agent (bring-your-own code; sleeps when idle, wakes on a request or trigger)
Logic App recurrence workflow Agent + trigger (rebuild connector steps as agent instructions or code)
App settings, Key Vault secrets Agent env vars, AES-encrypted at rest
Application Insights / Log Analytics Agent logs (maritime logs)
Managed identity on the workload Scoped keys in env vars for whatever the agent still calls

Azure Functions timer schedules are NCRONTAB, canonically SIX fields with seconds first: {second} {minute} {hour} {day} {month} {day-of-week}. Maritime triggers use standard five-field cron, so drop the leading seconds field when it is 0: 0 0 12 * * * becomes 0 12 * * *, and 0 */5 * * * * becomes */5 * * * *. Count the fields before converting: NCRONTAB also accepts plain five-field expressions, so a schedule that already has five fields is already standard cron and must be copied unchanged, never stripped. A schedule that actually uses the seconds field (*/30 * * * * *, every 30 seconds) fires sub-minute and cannot be expressed in five-field cron; flag it and let the user pick a minutely compromise. NCRONTAB runs in UTC unless the app sets WEBSITE_TIME_ZONE, so keep the trigger timezone UTC unless that setting exists. Container Apps job cron expressions are already five fields; copy them verbatim.

Step 3: Recreate on Maritime

Pick the target shape. Two honest cases:

Env vars and secrets. Function app settings are the workload's env vars; settings whose value looks like @Microsoft.KeyVault(SecretUri=...) resolve through Key Vault:

az functionapp config appsettings list -g <rg> -n <app> -o json
az keyvault secret show --vault-name <vault> --name <secret> --query value -o tsv

Reading a secret's value needs the Key Vault Secrets User role from the safety section (or a get/list access policy on legacy non-RBAC vaults); the subscription Reader role only lists names. Pull only the specific secrets the chosen workload reads.

Write them to a local .env file, import, then destroy the file:

maritime env import <agent> ./azure-migration.env --reload --json
rm ./azure-migration.env

Env changes apply on next boot unless you pass --reload.

Schedules. Recreate each cron as a Maritime trigger: dashboard, agent page, Triggers pane, cron type, using the converted expression. OpenClaw-family agents can equivalently use their native cron, which Maritime syncs. For bring-your-own-code agents remember that timers inside a sleeping VM do not fire; either serve GET /schedules or use the SDK scheduler observer, so Maritime wakes the agent on time.

Step 4: Verify before touching Azure

Do not proceed until the Maritime side has done the job at least once:

maritime status <agent> --json | jq -r '.status'
maritime chat <agent> "run your task once now and report what you did" --json | jq -r '.response'
maritime logs <agent> --level error --json

For scheduled workloads, wait for one real scheduled firing and check its output against a known-good run from Application Insights or the function's Monitor tab. Both sides can safely run in parallel; that is the point of leaving Azure untouched.

Step 5: Cutover and decommission (human runs every command here)

Print this checklist for the user. These are write operations on Azure, so they run them with their own admin credentials. You never run them.

  1. Pause the old workload (reversible): az functionapp stop -g <rg> -n <app>. For a Logic App: az logic workflow update -g <rg> -n <wf> --state Disabled.
  2. Watch Maritime for a few days: maritime logs <agent> --json. If anything is wrong, az functionapp start (or --state Enabled) restores Azure in one command.
  3. Only when satisfied, delete: az functionapp delete -g <rg> -n <app>, az containerapp job delete -g <rg> -n <job> --yes, then for VMs az vm deallocate -g <rg> -n <vm> followed by az vm delete -g <rg> -n <vm> --yes, and remove unused Key Vault secrets.
  4. Remove the migration service principal's role assignments, then delete it: az role assignment delete --assignee <appId>, then az ad sp delete --id <appId>. Deleting the principal alone leaves orphaned assignments that show up later as "Identity not found".
  5. If the migration ran inside a Maritime agent, clear AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID from that agent in the dashboard env vars pane.

What stays on Azure

Be upfront about this list rather than letting the user discover it:

Official Azure documentation

The exact pages a migrating user needs, all on learn.microsoft.com:

Troubleshooting

Every az command, flag, RBAC role claim, and cron-format claim in this skill was verified against the official documentation on learn.microsoft.com on 2026-08-07 (the links above are the pages used). Two things remain desk-checked rather than doc-verified: the exact --query paths into command output (the reference pages do not document output shapes; the troubleshooting bullet above covers drift) and the note that Standard-tier Logic Apps appear in the functionapp list. The maritime CLI surface is desk-checked against the current CLI.