Create Microsoft.Extensions.Configuration package to load azd environment variables #5998
ronaldbosma
started this conversation in
Ideas
Replies: 3 comments 2 replies
-
|
@captainsafia @davidfowl see this |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I was thinking that the only azd specific part is locating the correct .env file. The configuration source and provider could work for all .env files. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
@vhvb1989 I've posted a comment on the issue David provided. Should we close this discussion? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've created several azd templates with Bicep and I'm in the process of adding a GitHub Actions workflow with .NET integration tests to each of them.
The integration tests need environment specific values like the name of a deployed API Management instance. I can use 'normal' environment variables in my pipeline, but locally I want to have the option to use the azd environment variables located in
.azure/<defaultEnvironment>/.env.I've created an extension on the
IConfigurationBuilderclass to load the azd environment variables from the default environment's.envfile. The implementation is inspired by Microsoft.Extensions.Configuration.Json.Example usage:
The source can be found here: https://github.com/ronaldbosma/azure-integration-services-quickstart/tree/custom-azd-configuration-source/tests/AISQuick.IntegrationTests/Configuration/Azd
It would be nice if this could be improved upon and turned into an official
Microsoft.Extensions.Configuration.*NuGet package.Beta Was this translation helpful? Give feedback.
All reactions