We created an App Config. We set a few features in feature manager:
Name: beta
Label: null
Enabled: false
Name: beta
Label: Development
Enabled: true
Name: beta
Label: Test
Enabled: true
We need to store the connection string to connect to App Config. We got them from the Access Keys blade.
Here, we stored it in appsettings.json, which is NOT the best practice.
In real life production, you would either:
- Modify the
configuration
of your Azure App Service. Set theConnection String
with the keyAppConfig
. - Set the secret in Azure Key Vault.
In dev mode, you would
- Set it using
dotnet user-secrets
(This is the Secret Manager tool, which stores the secret in the user profile, instead of the source code.) - Set it in a local.appsettings.json.
Here, we set it in appsettings.json
, which is not a best practice. because it discloses the App Config key in a file shared using git.
We stored three environment in launchsettings.json
. Development, Test, Production. (Additional environements are possible by modifying launchsettings.json
)
To execute from the command line, use either of these lines.
dotnet run --launch-profile dev
dotnet run --launch-profile test
dotnet run --launch-profile prod