{"record":{"id":"5622aa953aeed2d4","repo":"microsoft/aspire","slug":"the-rad-cli-was-not-found-please-install-it-from-5622aa","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/RadiusDeploymentPipelineStep.cs","lineNumber":518,"sourceCode":"            Action = ExecuteAsync\n        };\n        step.DependsOn($\"publish-radius-{_environment.Name}\");\n        step.RequiredBy(WellKnownPipelineSteps.Deploy);\n        step.DependsOn(WellKnownPipelineSteps.DeployPrereq);\n        return step;\n    }\n\n    internal async Task ExecuteAsync(PipelineStepContext context)\n    {\n        var cancellationToken = context.CancellationToken;\n        var logger = context.Logger;\n\n        // Detect rad CLI availability\n        var radAvailable = await DetectRadCliAsync(cancellationToken).ConfigureAwait(false);\n        if (!radAvailable)\n        {\n            logger.LogError(\"The 'rad' CLI was not found on PATH. Install it from {InstallUrl}\", RadInstallUrl);\n            throw CreateRadCliNotFoundException();\n        }\n\n        logger.LogInformation(\"rad CLI detected on PATH for environment '{EnvironmentName}'\", _environment.Name);\n\n        // Resolve the output directory where Bicep was generated\n        var outputDir = PublishingContextUtils.GetEnvironmentOutputPath(context, _environment);\n        var bicepPath = Path.Combine(outputDir, \"app.bicep\");\n\n        if (!File.Exists(bicepPath))\n        {\n            logger.LogError(\"Bicep file not found at {BicepPath}. Ensure the publish step completed successfully.\", bicepPath);\n            throw new InvalidOperationException(\n                $\"Bicep file not found at '{bicepPath}'. Ensure the publish step completed successfully before deploying.\");\n        }\n\n        logger.LogInformation(\"Starting rad deploy with Bicep file '{BicepPath}'\", bicepPath);\n\n        // Declared outside the try so the finally can always clean up the temp secrets file, even","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Radius/Publishing/RadiusDeploymentPipelineStep.cs#L500-L536","documentation":"RadiusDeploymentPipelineStep.ExecuteAsync detects the rad CLI before generating and running Bicep deployments for the environment. If DetectRadCliAsync reports rad is absent, it logs the same message and throws CreateRadCliNotFoundException, halting the deployment. The rad CLI is required to translate and apply the generated Bicep against the Radius control plane.","triggerScenarios":"Executing the Radius deployment pipeline step (aspire publish/deploy targeting a Radius environment) where the 'rad' executable is not found on the PATH of the deploying process.","commonSituations":"New CI runner without rad; rad installed locally but PATH not propagated into the publish process; deploying from an IDE terminal with a different PATH than the shell; containerized builds lacking the Radius CLI; forgetting installation after switching machines.","solutions":["Install the rad CLI (https://radapp.io) and confirm with 'rad --version' in the same shell/agent that runs the deploy","Add rad's install location to PATH for the deploy process (export PATH=... or CI environment PATH update)","Add an explicit rad-install step to your pipeline before aspire publish/deploy","Use a base image or dev container that preinstalls rad"],"exampleFix":"// before\n- run: aspire publish -o artifacts  // fails: rad not on PATH\n\n// after\n- run: |\n    curl -fsSL https://get.radapp.dev/install.sh | bash\n    echo \"$HOME/.rad/bin\" >> \"$GITHUB_PATH\"\n- run: aspire publish -o artifacts","handlingStrategy":"validation","validationCode":"# Guard the deploy pipeline\nif ! command -v rad >/dev/null 2>&1; then\n  echo \"rad CLI missing; install from https://radapp.io\"; exit 1\nfi\nrad version","typeGuard":null,"tryCatchPattern":"try\n{\n    await pipelineStep.ExecuteAsync(context, ct);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"'rad' CLI was not found\"))\n{\n    // Setup issue: install rad on PATH and re-run; deployment made no changes.\n    throw;\n}","preventionTips":["Install rad before aspire publish/deploy in every environment (local, CI, containers)","Echo PATH in deploy logs to diagnose agent-environment PATH drift","Use images with rad preinstalled for repeatable deploys"],"tags":["radius","cli","path","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-21T09:17:21.228Z"}