When calling to the default url with {application}/{profile(s)}/{label}, and you have multiple profiles, you receive a propertySources array item for each profile, so all properties are returned. This is sort of json except that arrays are not returned as json arrays, but are more like indexed keys of an object ("key[0].property": "value"). Json parsers have no idea how to bind this to an array, by the way. If this worked I wouldn't even look at the alternates and would not care about the following bug.

When you call the alternate urls with the .properties, .yml, or even the undocumented .json extension, you get the properties for the each section in the first profile you specify if they are in both. On a positive note, the .json call does return arrays in proper json format.

I'm only giving the .json call as the example here, but the same thing happens with .properties and .yml.

This call is using two profiles, dev_stan and dev: http://localhost:9098/myapi/v1/config/develop/myapp-dev_stan,dev.json

and returns this:

{
  "AzureAD": {
    "ApplicationIdUri": "api://mywebapp-stan.azurewebsites.net/ssssssss-db44-4aa3-80fe-ssssssssssss",
    "ClientId": "rrrrrrrr-db44-4aa3-80fe-rrrrrrrrrrrr",
    "TenantId": "qqqqqqqq-31c7-472d-850a-qqqqqqqqqqqq",
    "ValidIssuers": "https://login.microsoftonline.com/50bc5744-31c7-472d-850a-e4fce737eba7/v2.0,https://sts.windows.net/50bc5744-31c7-472d-850a-e4fce737eba7/"
  },
  "Tenants": [
  {
    "TenantId": "xxxxxxxx-fa1b-4494-a94d-xxxxxxxxxxxx",
    "AllowLabelling": false,
    "AzureB2BGuestsGroup": "yyyyyyyy-600f-48a4-a4af-yyyyyyyyyyyyy",
    "AzureB2BMembersGroup": "zzzzzzzz-1144-4bfa-9d4f-zzzzzzzzzzzz",
    "IsMailForwardingEnabled": true
  },
  {
    "TenantId": "wwwwwwww-f265-4304-b90e-89da9f76de12",
    "AllowLabelling": false,
    "AzureB2BGuestsGroup": "vvvvvvvv-6600-4fd0-97cf-vvvvvvvvvvvv",
    "AzureB2BMembersGroup": "uuuuuuuu-1c88-442e-9adf-uuuuuuuuuuuu",
    "IsMailForwardingEnabled": true
  }
]

But this call (note the profiles are reversed): http://localhost:9098/myapi/v1/config/develop/myapp-dev,dev_stan.json

Returns this. Tenants is correct because both profiles have an "AzureAd" section, but only one has a "Tenants" section:

{
  "AzureAd": {
    "ApiVersion": "v1.0",
    "AuthUrl": "/oauth2/v2.0/token",
    "BaseUrl": "https://graph.microsoft.com/",
    "GraphScope": "https://graph.microsoft.com/.default",
    "Instance": "https://login.microsoftonline.com/",
    "TeamsUrl": "https://teams.microsoft.com/?tenantId={0}\\"
  },
  "Tenants": [
  {
    "TenantId": "xxxxxxxx-fa1b-4494-a94d-xxxxxxxxxxxx",
    "AllowLabelling": false,
    "AzureB2BGuestsGroup": "yyyyyyyy-600f-48a4-a4af-yyyyyyyyyyyyy",
    "AzureB2BMembersGroup": "zzzzzzzz-1144-4bfa-9d4f-zzzzzzzzzzzz",
    "ServiceAccountPwd": "PhxNextGen45!",
    "IsMailForwardingEnabled": true
  },
  {
    "TenantId": "wwwwwwww-f265-4304-b90e-89da9f76de12",
    "AllowLabelling": false,
    "AzureB2BGuestsGroup": "vvvvvvvv-6600-4fd0-97cf-vvvvvvvvvvvv",
    "AzureB2BMembersGroup": "uuuuuuuu-1c88-442e-9adf-uuuuuuuuuuuu",
    "ServiceAccountPwd": "PhxNextGen45!",
    "IsMailForwardingEnabled": true
  }
]

What I expect is to see this, an aggregation of the two profiles, with maybe the order in the aggregated section to be dependent on the order of the profiles in the api call:

{
  "AzureAd": {
    "ApiVersion": "v1.0",
    "AuthUrl": "/oauth2/v2.0/token",
    "BaseUrl": "https://graph.microsoft.com/",
    "GraphScope": "https://graph.microsoft.com/.default",
    "Instance": "https://login.microsoftonline.com/",
    "TeamsUrl": "https://teams.microsoft.com/?tenantId={0}\\"
    "ApplicationIdUri": "api://mywebapp-stan.azurewebsites.net/ssssssss-db44-4aa3-80fe-ssssssssssss",
    "ClientId": "rrrrrrrr-db44-4aa3-80fe-rrrrrrrrrrrr",
    "TenantId": "qqqqqqqq-31c7-472d-850a-qqqqqqqqqqqq",
    "ValidIssuers": "https://login.microsoftonline.com/50bc5744-31c7-472d-850a-e4fce737eba7/v2.0,https://sts.windows.net/50bc5744-31c7-472d-850a-e4fce737eba7/"
  },
  "Tenants": [
  {
    "TenantId": "xxxxxxxx-fa1b-4494-a94d-xxxxxxxxxxxx",
    "AllowLabelling": false,
    "AzureB2BGuestsGroup": "yyyyyyyy-600f-48a4-a4af-yyyyyyyyyyyyy",
    "AzureB2BMembersGroup": "zzzzzzzz-1144-4bfa-9d4f-zzzzzzzzzzzz",
    "ServiceAccountPwd": "PhxNextGen45!",
    "IsMailForwardingEnabled": true
  },
  {
    "TenantId": "wwwwwwww-f265-4304-b90e-89da9f76de12",
    "AllowLabelling": false,
    "AzureB2BGuestsGroup": "vvvvvvvv-6600-4fd0-97cf-vvvvvvvvvvvv",
    "AzureB2BMembersGroup": "uuuuuuuu-1c88-442e-9adf-uuuuuuuuuuuu",
    "ServiceAccountPwd": "PhxNextGen45!",
    "IsMailForwardingEnabled": true
  }
]

Comment From: ryanjbaxter

It would help if you could provide the properties/yaml files in the environment repository.

Also I am confused about the where the extra properties in the AzureAd object in your expected result are coming from.

Comment From: spring-cloud-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.