diff --git a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Components/Pages/Home.razor b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Components/Pages/Home.razor
index d1ab9ea3d..684c6fc76 100644
--- a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Components/Pages/Home.razor
+++ b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Components/Pages/Home.razor
@@ -3,6 +3,7 @@
@using Amazon.Lambda.TestTool.Models
@using Amazon.Lambda.TestTool.SampleRequests
@using Amazon.Lambda.TestTool.Services
+@using Amazon.Lambda.TestTool.Utilities
Lambda Function Tester
@@ -26,11 +27,14 @@
-
- For Lambda functions written as executable assemblies, i.e. custom runtimes functions and top level statement functions, this page can be used for testing the functions locally.
- Set the
AWS_LAMBDA_RUNTIME_API environment variable to
@HttpContextAccessor.HttpContext?.Request.Host while debugging executable assembly
- Lambda function. More information can be found in the
documentation.
-
+@if (!Utils.IsAspireHosted)
+{
+
+ For Lambda functions written as executable assemblies, i.e. custom runtimes functions and top level statement functions, this page can be used for testing the functions locally.
+ Set the
AWS_LAMBDA_RUNTIME_API environment variable to
@HttpContextAccessor.HttpContext?.Request.Host while debugging executable assembly
+ Lambda function. More information can be found in the
documentation.
+
+}
@if (DataStore == null)
{
diff --git a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Utilities/Utils.cs b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Utilities/Utils.cs
index 700588009..ead444dd3 100644
--- a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Utilities/Utils.cs
+++ b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Utilities/Utils.cs
@@ -1,4 +1,4 @@
-// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
using System.Reflection;
@@ -42,6 +42,14 @@ public static string DetermineToolVersion()
return version ?? unknownVersion;
}
+ ///
+ /// If true it means the test tool was launched via an Aspire AppHost.
+ ///
+ internal static bool IsAspireHosted
+ {
+ get { return string.Equals(Environment.GetEnvironmentVariable("ASPIRE_HOSTED"), "true", StringComparison.OrdinalIgnoreCase); }
+ }
+
///
/// Attempt to pretty print the input string. If pretty print fails return back the input string in its original form.
///