Open KjetilSmith opened 4 years ago
Not sure if I understood your question right, but you can configure multiple environments in the a--settings.json file. The details are in the documentation
One example might be if you do have a provider you want to test out in test before you deploy to production you can easy make changes to your base file:
{Settings:BankIdDomain} {Settings:BankIdDisplayName} {Settings:BankIdDisplayName} Login with your account ... - {Settings:BankIdMetaData}
- {Settings:BankIdProviderName}
- {Settings:BankIdClientId}
..... ... ... ...
Further down in the document:
...
When you build the environment for 'Test' you keep the elements, but remove it in all other environments (..). Just a nice feature to add and it's different to 'appsettings.json';-)
I either still don't understand what exactly you're trying to do or ...why can't you just specify your TargetClaimsExchangeId in the settings?
In addition, IMO, removing or adding elements from the file based on the environment makes it very prone to mistakes
One use case I'd have for this is that in a Development/Testin environment I want the JourneyInsights to send debug information to an Application Insights instance for a particular journey, but in production I do not want this element at all. I've worked around this by giving the debug user journey a different name and never pushing it to production.
Another use case for me would be around the UX customisation. I can specify different template URLs easily enough, but what if for client A I want a simple HTML template, no JS, but for client B I want to enable JS on the template. To do this at the moment I just have to use the JS-enabled templates all the time which seems to not be best practice.
So I would like these changes to be configurable in some way. Such as "if the custom template URL exists and JS is required, change the DataUri to the appropriate value"
<ContentDefinition Id="api.error">
- <LoadUri>~/tenant/templates/AzureBlue/exception.cshtml</LoadUri>
+ <LoadUri>CUSTOM_TEMPLATE_URL</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
- <DataUri>urn:com:microsoft:aad:b2c:elements:globalexception:1.1.0</DataUri>
+ <DataUri>urn:com:microsoft:aad:b2c:elements:contract:globalexception:1.2.0</DataUri>
<Metadata>
<Item Key="DisplayName">Error page</Item>
</Metadata>
</ContentDefinition>
EDIT: I'm actually thinking that this is perhaps outside the scope of this project as we're now talking about creating (or making use of) a templating engine like ERB, handlebars or the like.
Just as:
So you can easy have some differences in eg. dev, test and production environment. Just have to check some of the code before.....