-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Type of Connector
Custom Connector
Name of Connector
(not relevant)
Describe the bug
Title
Custom connector OAuth2 client secret via environment variable is not retained on managed solution import
Description
When using a custom connector in a Power Platform solution with OAuth2 (authorization code flow), and configuring the Client Secret property via a secret-typed environment variable, the following behaviour occurs:
- In Dev environment, the custom connector’s Client Secret is set to
@environmentVariables("MySecretEnvVar"). - The secret-typed environment variable is part of the same solution.
- The solution is exported as managed.
- When imported into a target environment (e.g. Prod), the custom connector’s Client Secret does not retain the reference to the environment variable (i.e. the field is blank or static, with no link to the env var).
- Only after manually editing the custom connector in Prod (setting the Client Secret again to
@environmentVariables("MySecretEnvVar")) and saving does the connector correctly pick up the secret via the environment variable.
This requires a manual fix step in the target environment, which undermines automation/ALM/CI-CD practices and can lead to misconfiguration or drift.
Is this a security bug?
Yes, this is a security bug
What is the severity of this bug?
Severity 1 - Connector is broken or there's a very serious issue
To Reproduce
Steps to Reproduce
- In Dev environment, create a solution.
- Add a secret‐typed environment variable named (for example)
MySecretEnvVar. - Create or edit a custom connector (in the same solution) that uses OAuth2 Auth Code flow.
- In the custom connector’s Security tab, set the Client Secret value to:
@environmentVariables("MySecretEnvVar"))and then save. - Export the solution as managed.
- Import into the target environment (e.g. Prod). and fill in the env variables with the prod. values (import is correctly done)
- Inspect the custom connector → you’ll see the Client Secret is not referencing the environment variable (blank or static).
- Manually open the connector in Prod, enter
@environmentVariables("MySecretEnvVar")in Client Secret, save → connector then works.
Expected behavior
I would expect that this is done automatically! Having to point the client secret to the env variable again when importing the solution is not optimal
Environment summary
- Unmanaged solution created and tested in a dev type environment (Europe region)
- Managed solution imported to a managed environment type (Europe region)
Additional context
n/a
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working