Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] azd pipeline config errors when trying to set empty strings #3371

Closed
1 task done
pamelafox opened this issue Feb 15, 2024 · 6 comments · Fixed by #3382
Closed
1 task done

[Issue] azd pipeline config errors when trying to set empty strings #3371

pamelafox opened this issue Feb 15, 2024 · 6 comments · Fixed by #3382
Assignees
Milestone

Comments

@pamelafox
Copy link
Member

Output from azd version
1.6.0

Describe the bug

I just merged Azure-Samples/azure-search-openai-demo#1083 and tried it out. In my .env file, I had a few variables set to empty strings.

When I ran azd pipeline config, it error'd on each var with an empty string:

ERROR: failed setting OPENAI_ORGANIZATION secret: failed running gh variable set: exit code: 1, stdout: , stderr: 1 error occurred:
	* failed to set variable "OPENAI_ORGANIZATION": HTTP 422: Invalid request. (https://api.github.com/repos/pamelafox/azure-search-openai-demo/actions/variables)

Invalid input: object is missing required key: value.
@pamelafox
Copy link
Member Author

@vhvb1989

@vhvb1989
Copy link
Member

@pamelafox is there a difference between not having the env var and having it with empty string?
Does it impact the bicep inptus?

Thinking if we want to ignore empty values or set them as variables with empty strings

@vhvb1989 vhvb1989 self-assigned this Feb 15, 2024
@pamelafox
Copy link
Member Author

I think there might be, as I've now got an error in the provision stage I need to look into. Will update soon.

@pamelafox
Copy link
Member Author

The provision error was due to me having previously set up a pipeline where one of the empty values had a non-empty value. I'm now attempting the pipeline again after deleting that value.

So I think azd should ideally set them as empty strings, to make sure a setup with a new environment overrides previously set non-empty strings.

(But if that is trickier, ignoring them should work for a single pipeline config)

@rajeshkamal5050 rajeshkamal5050 added this to the Germanium milestone Feb 15, 2024
@pamelafox
Copy link
Member Author

Successful azd up once I removed the previously set environment variable:
https://github.com/pamelafox/azure-search-openai-demo/actions/runs/7918060139/job/21622001579

I would hope/presume it would also be successful if the un-needed environment variables were empty strings.

@vhvb1989
Copy link
Member

So I think azd should ideally set them as empty strings, to make sure a setup with a new environment overrides previously set non-empty strings.

I see. makes total sense.
I think azd should deleteIfExist all the secrets/variables with empty string or not found in .env.
It would also reproduce if you run azd env unset foo and foo is not removed from the pipeline :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants