{"record":{"id":"fae1b1433bca3c96","repo":"microsoft/aspire","slug":"the-rad-cli-was-not-found-please-install-it-from","errorCode":null,"errorMessage":"The 'rad' CLI was not found. Please install it from {RadInstallUrl} and ensure it is available on your PATH.","messagePattern":"The 'rad' CLI was not found\\. Please install it from (.+?) and ensure it is available on your PATH\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Radius/Publishing/RadCredentialRegisterStep.cs","lineNumber":96,"sourceCode":"        var entries = BuildEntries(annotation).ToList();\n        if (entries.Count == 0)\n        {\n            return;\n        }\n\n        // Radius cloud-provider credentials are stored per-installation (global), not\n        // per-environment — registering one overwrites any previously registered\n        // credential for the same provider across ALL environments. Fail fast when the\n        // model configures conflicting credentials so the clobber surfaces as a clear\n        // error instead of a silent last-writer-wins surprise at deploy time.\n        // See https://docs.radapp.io/reference/cli/rad_credential_register/\n        ValidateNoConflictingInstallationCredentials(context.Model);\n\n        var radAvailable = await RadiusDeploymentPipelineStep.DetectRadCliAsync(cancellationToken).ConfigureAwait(false);\n        if (!radAvailable)\n        {\n            logger.LogError(\"The 'rad' CLI was not found on PATH. Install it from {InstallUrl}\", RadiusDeploymentPipelineStep.RadInstallUrl);\n            throw RadiusDeploymentPipelineStep.CreateRadCliNotFoundException();\n        }\n\n        foreach (var entry in entries)\n        {\n            var args = await entry.ResolveArgumentsAsync(cancellationToken).ConfigureAwait(false);\n            await RunRadAsync(args, entry.SecretArgFlagSet, logger, cancellationToken).ConfigureAwait(false);\n        }\n    }\n\n    // The 'rad credential register' grammar uses TWO positional tokens — provider\n    // then auth-mode — and has NO '--name' flag (credentials are per-provider,\n    // per-installation). For example:\n    //   rad credential register azure sp  --client-id <id> --client-secret <secret> --tenant-id <tenant>\n    //   rad credential register azure wi  --client-id <id> --tenant-id <tenant>\n    //   rad credential register aws access-key --access-key-id <id> --secret-access-key <secret>\n    //   rad credential register aws irsa  --iam-role <roleArn>\n    // See https://docs.radapp.io/reference/cli/rad_credential_register/ and its subcommands.\n    internal static IEnumerable<CredentialEntry> BuildEntries(","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Radius/Publishing/RadCredentialRegisterStep.cs#L78-L114","documentation":"RadiusCredentialRegisterStep (RadCredentialRegisterStep) registers credentials needed for Radius deployment by invoking the 'rad' CLI. Before doing so it runs DetectRadCliAsync; if rad is not on PATH it logs and throws this exception directing the user to install rad from the documented URL. Without the rad binary, credential registration and any subsequent Radius deployment cannot proceed.","triggerScenarios":"Executing the Radius credential-register pipeline step (ExecuteAsync) on a machine where the 'rad' executable is not installed or not on the PATH environment variable used by the publish/deploy process.","commonSituations":"Fresh CI agent or dev container without Radius tooling installed; rad installed in a user path not visible to the CI process; typo'd or missing PATH configuration; using a container image without rad; forgetting to run the Radius install script (curl -fsSL https://radius.dev/install.sh | bash) before deploying.","solutions":["Install the rad CLI per https://radapp.io (e.g., curl -fsSL https://get.radapp.dev/install.sh | bash) and verify with 'rad version'","Ensure the rad binary's directory is on PATH for the process running the Aspire publish/deploy (export PATH=\"$PATH:/usr/local/bin\" or equivalent in CI)","Pin/install rad as a CI setup step before running aspire publish/deploy","Use a container or runner image that already includes the rad CLI"],"exampleFix":"// before: CI job deploys without rad installed\nsteps:\n  - run: aspire publish -o artifacts\n\n// after: install rad first and expose it on PATH\nsteps:\n  - run: curl -fsSL https://get.radapp.dev/install.sh | bash\n  - run: rad version\n  - run: aspire publish -o artifacts","handlingStrategy":"validation","validationCode":"# Fail fast before deploying if rad is missing\ncommand -v rad >/dev/null 2>&1 || { echo \"rad CLI not found; install from https://radapp.io\"; exit 1; }\nrad version","typeGuard":null,"tryCatchPattern":"try\n{\n    await step.ExecuteAsync(context, ct);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"'rad' CLI was not found\"))\n{\n    // Surface a setup failure, not a deploy failure: install rad and retry.\n    logger.LogError(\"Install the rad CLI (https://radapp.io) and ensure it is on PATH, then retry.\");\n    throw;\n}","preventionTips":["Install rad as an explicit CI setup step and verify with 'rad version'","Bake rad into runner/container images used for deploys","Check PATH propagation when invoking deploys from IDEs or wrappers"],"tags":["radius","cli","path","azure","deployment"],"backgroundTag":"command-not-found","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}