From b8a87dd0cf294673f1c229c583817317d820bdee Mon Sep 17 00:00:00 2001 From: "Menghua Chen (WICRESOFT NORTH AMERICA LTD)" Date: Fri, 15 Nov 2024 17:50:15 +0800 Subject: [PATCH 1/3] fix-issue#44111 --- cli/azd/cmd/up.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/azd/cmd/up.go b/cli/azd/cmd/up.go index 43b3418ac35..674f53a1d22 100644 --- a/cli/azd/cmd/up.go +++ b/cli/azd/cmd/up.go @@ -130,6 +130,12 @@ func (u *upAction) Run(ctx context.Context) (*actions.ActionResult, error) { u.console.Message(ctx, output.WithGrayFormat("Note: Running custom 'up' workflow from azure.yaml")) } + envValue := u.flags.EnvFlag.EnvironmentName + for _, step := range upWorkflow.Steps { + stepArgs := append(step.AzdCommand.Args, "-e", envValue) + step.AzdCommand.Args = stepArgs + } + if err := u.workflowRunner.Run(ctx, upWorkflow); err != nil { return nil, err } From d0505ad821e225fbebc6bd0c31d312dea31c5dd6 Mon Sep 17 00:00:00 2001 From: "Menghua Chen (WICRESOFT NORTH AMERICA LTD)" Date: Fri, 15 Nov 2024 18:23:46 +0800 Subject: [PATCH 2/3] fix ci error --- cli/azd/cmd/up.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/azd/cmd/up.go b/cli/azd/cmd/up.go index 674f53a1d22..5a62c241783 100644 --- a/cli/azd/cmd/up.go +++ b/cli/azd/cmd/up.go @@ -135,7 +135,7 @@ func (u *upAction) Run(ctx context.Context) (*actions.ActionResult, error) { stepArgs := append(step.AzdCommand.Args, "-e", envValue) step.AzdCommand.Args = stepArgs } - + if err := u.workflowRunner.Run(ctx, upWorkflow); err != nil { return nil, err } From 8ecd923a75711b9dabf3f0b17e02ae809dfeae3a Mon Sep 17 00:00:00 2001 From: "Menghua Chen (WICRESOFT NORTH AMERICA LTD)" Date: Fri, 15 Nov 2024 19:03:28 +0800 Subject: [PATCH 3/3] fix ci error --- cli/azd/cmd/up.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/azd/cmd/up.go b/cli/azd/cmd/up.go index 5a62c241783..a25566a9891 100644 --- a/cli/azd/cmd/up.go +++ b/cli/azd/cmd/up.go @@ -132,8 +132,10 @@ func (u *upAction) Run(ctx context.Context) (*actions.ActionResult, error) { envValue := u.flags.EnvFlag.EnvironmentName for _, step := range upWorkflow.Steps { - stepArgs := append(step.AzdCommand.Args, "-e", envValue) - step.AzdCommand.Args = stepArgs + if envValue != "" { + stepArgs := append(step.AzdCommand.Args, "-e", envValue) + step.AzdCommand.Args = stepArgs + } } if err := u.workflowRunner.Run(ctx, upWorkflow); err != nil {