From d3565c7a9849e03b018800019b374d0d3bc87fe8 Mon Sep 17 00:00:00 2001 From: Wei Lim Date: Mon, 28 Oct 2024 10:57:38 -0700 Subject: [PATCH] error for alpha --- cli/azd/pkg/project/importer.go | 9 ++++++++- cli/azd/resources/alpha_features.yaml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cli/azd/pkg/project/importer.go b/cli/azd/pkg/project/importer.go index 0fe125aa2f0..551a6143afc 100644 --- a/cli/azd/pkg/project/importer.go +++ b/cli/azd/pkg/project/importer.go @@ -163,10 +163,17 @@ func (im *ImportManager) ProjectInfrastructure(ctx context.Context, projectConfi } } - if im.dotNetImporter.alphaFeatureManager.IsEnabled(alpha.FeatureId(alpha.Compose)) && len(projectConfig.Resources) > 0 { + composeEnabled := im.dotNetImporter.alphaFeatureManager.IsEnabled(alpha.FeatureId(alpha.Compose)) + if composeEnabled && len(projectConfig.Resources) > 0 { return tempInfra(ctx, projectConfig) } + if !composeEnabled && len(projectConfig.Resources) > 0 { + return nil, fmt.Errorf( + "compose is currently under alpha support and must be explicitly enabled."+ + " Run `%s` to enable this feature", alpha.GetEnableCommand(alpha.Compose)) + } + return &Infra{}, nil } diff --git a/cli/azd/resources/alpha_features.yaml b/cli/azd/resources/alpha_features.yaml index 1e1b021f360..d7d4f0390f0 100644 --- a/cli/azd/resources/alpha_features.yaml +++ b/cli/azd/resources/alpha_features.yaml @@ -13,4 +13,4 @@ - id: deployment.stacks description: "Enables Azure deployment stacks for ARM/Bicep based deployments." - id: compose - description: "Enables azd composability. Run `azd add` to add new resources to your project." + description: "Enable simplified app-centric modeling. Run `azd add` to add Azure components to your project."