import { execFile, execFileSync, spawn } from "node:child_process"; import {
normalizeOptionalString,
normalizeStringifiedOptionalString,
} from "openclaw/plugin-sdk/text-runtime"; import type { AzAccessToken, AzAccount } from "./shared.js"; import { COGNITIVE_SERVICES_RESOURCE } from "./shared.js";
function summarizeAzErrorMessage(raw: string): string { const trimmed = raw.trim(); if (!trimmed) { return"";
} const normalized = trimmed.replace(/\s+/g, " "); if (/not recognized|enoent|spawn .* az/i.test(normalized)) { return"Azure CLI (az) is not installed or not on PATH.";
} if (/az login/i.test(normalized) || /please run 'az login'/i.test(normalized)) { return"Azure CLI is not logged in. Run `az login --use-device-code`.";
} if (
/subscription/i.test(normalized) &&
/could not be found|does not exist|no subscriptions/i.test(normalized)
) { return"Azure CLI could not find an accessible subscription. Check the selected subscription or tenant access.";
} if (
/tenant/i.test(normalized) &&
/not found|invalid|doesn't exist|does not exist/i.test(normalized)
) { return"Azure CLI could not use that tenant. Verify the tenant ID or tenant domain and try `az login --tenant <tenant>`.";
} if (/aadsts\d+/i.test(normalized)) { return"Azure login failed for the selected tenant. Re-run `az login --use-device-code` and confirm the tenant is correct.";
} return normalized.slice(0, 300);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.