Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use PowerPlatformSetConnectionVariables to get information from Multiple Service Connections #1057

Open
mattp65 opened this issue Oct 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mattp65
Copy link

mattp65 commented Oct 11, 2024

Using the following tasks:

    - task: PowerPlatformSetConnectionVariables@2
      name: devConnInfo
      inputs:
        authenticationType: 'PowerPlatformSPN'
        PowerPlatformSPN: ${{parameters.devServiceConnection}}
      displayName: 'Get Dev Connection information'
    - task: PowerPlatformSetConnectionVariables@2
      name: buildConnInfo
      inputs:
        authenticationType: 'PowerPlatformSPN'
        PowerPlatformSPN: ${{parameters.buildServiceConnection}}
      displayName: 'Get Build Connection information'

End result is both sets of connection values reference later point to the first SPN. In reviewing the step output, it seems to be taking current value of $(BuildTools.EnvironmentUrl) and uses that instead of the the SPN.

In playing with the "settings" editor, it appears that this is defaulting a parm value of "Environment: '$(BuildTools.EnvironmentUrl)'" even though that isn't being provided.

Explicitly setting:

    - task: PowerPlatformSetConnectionVariables@2
      name: buildConnInfo
      inputs:
        authenticationType: 'PowerPlatformSPN'
        Environment: ''
        PowerPlatformSPN: ${{parameters.buildServiceConnection}}
      displayName: 'Get Build Connection information'

on the second does not seem to override the default.

However, placing a 'bad' value in there like this:

    - task: PowerPlatformSetConnectionVariables@2
      name: buildConnInfo
      inputs:
        authenticationType: 'PowerPlatformSPN'
        Environment: '$(bad.EnvironmentUrl)'
        PowerPlatformSPN: ${{parameters.buildServiceConnection}}
      displayName: 'Get Build Connection information'

seems to work.

The doc around using this to return info on the SPN is not correct either as it does not include direction on using the task name to qualify the returned values.

@mattp65 mattp65 added the bug Something isn't working label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant