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

Add workflow for azd deployment on GitHub Actions and ADO #1083

Merged
merged 20 commits into from
Feb 15, 2024

Conversation

vhvb1989
Copy link
Contributor

@vhvb1989 vhvb1989 commented Dec 21, 2023

gh-definition and changes to support it

Continuation of: #488

This change requires: Azure/azure-dev#3155 to fully support azd pipeline config

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@vhvb1989 vhvb1989 self-assigned this Dec 21, 2023
@vhvb1989 vhvb1989 changed the title gh definition and enhances gh/ado definition and enhances. Dec 21, 2023
@pamelafox pamelafox changed the title gh/ado definition and enhances. Add workflow for azd deployment on GitHub Actions and ADO Feb 7, 2024
@pamelafox
Copy link
Collaborator

@vhvb1989 How does the pipeline know the value of openAiResourceGroupLocation that was stored in the environment? (That's not in an env variable)

@vhvb1989
Copy link
Contributor Author

@vhvb1989 How does the pipeline know the value of openAiResourceGroupLocation that was stored in the environment? (That's not in an env variable)

that's azd's magic :D
So, during azd pipeline config azd will prompt for a value for openAiResourceGroupLocation and azd will ask if you want to persist the value. When you click yes, the value is saved within the environment configuration (a json file next to the azure .env file).
Then, azd serializes the json file, environment configuration, and set it as a secret for your pipeline (using the name AZD_INITIAL_ENVIRONMENT_CONFIG). When azd runs provision, it uses the value from that secret to re-construct the json file as the initial environment configuration.
That means that the value you set during the prompt will be accessible from CI/CD, just like it is on your local machine.

Notes:

  • If you want to change the selection, you need to either create a new environment, or manually edit the environment configuration. Azd doesn't have any gesture to manage the per-environment configuration. After editing the value, you can run azd pipeline config again to refresh the secret for CI/CD
  • You must select yes when the prompt ask you about persisting the selection, otherwise, the selection will not be reflected on CI/CD. I'll create a PR soon to mitigate this little detail :)

@vhvb1989
Copy link
Contributor Author

azd 1.6.0 is released, so this PR is ready to go :)

@pamelafox pamelafox merged commit 688e1c4 into Azure-Samples:main Feb 15, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants