Add basic handling of Environment Variables
I've noticed that there are no built-in methods which would allow to fetch or store Environment Variables via XrmToolkit.
How I would imagine the perfect support here:
Autogenerate a file similar to "MessageNames.cs" or "TableNames.cs" called "VariableNames.cs" or "EnvVariableNames.cs" (other name ideas are welcome) which would store schema names of all available environment variables in the same fashion as the other mentioned files do already + have the ability to regenerate the file.
Create IOrganizationService extension methods which would fetch the variable's value based on its name. I imagine the method to first try and return the "Current Value" (environment-based) and if that is null or whitespace, return the "Default Value" as fallback. Variations of this method like a TryGet() with a boolean return and an out variable are welcome too. You can also do three variations of this: One method to return the 'Current Value' only, another to return the 'Default Value' only, third one combining the first two as described above.
Optional: since Environment Variables can have different types, overloads of a 'GetVariableValue<T>(schemaName)' could be introduced with built-in casting to the desired types. I imagine the types would have to be nullable.
Optional: Include handling of Environment Variables of type 'Secret' stored in Azure KeyVault or even directly allow XrmToolkit to fetch key secrets from Azure KeyVault or Azure Configurations. I'm not sure how much the C# API allows here.
Optional: Include as much of the above functionalities in TypeScript definition files as possible.