AppSettings.json and the new PAAS Portal Secrets

Vote:
 

Hello All,

I'm using the options pattern in .NET 6+ for my current Optimizely CMS 12 build and I have some secrets I would like to move to the new App Setting secrets in the PAAS Portal.  As I understand it, these settings will be applied during the deployment of the environment.

The configuration I have for one of my client's CRM systems looks a little like this:

{
    "CrmIntegrationSettings": {
        "OrganizationUrl": "https://www.example.com",
        "ClientId": "removed",
        "ClientSecret": "removed",
        "TenantId": "removed"
    }
}

I've tried adding this as a secret in the PAAS Portal using the standard double underscore notation normally used as a configuration setting as well as using a period to separate CrmIntegrationSettings and OrganizationUrl, but the PAAS Portal throws a validation error saying that only Alphanumerics can be used.  Has anyone else tried this and managed to get this to work? Does this mean I would have to flatten these settings and lose the ability to bind a section of the json file to an object instead?

#301457
May 10, 2023 8:09
Vote:
 

Unfortunately this isn't currently possible.  While the Azure app requires double underscore and key vault requires double hypens, the deployment API doesn't appear to translate this when setting environment variables.  So the following structure has to be used instead:

{
    "CrmOrganizationUrl": "https://www.example.com",
    "CrmClientId": "removed",
    "CrmClientSecret": "removed",
    "CrmTenantId": "removed"
}
#301460
May 10, 2023 10:23
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.