web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Custom Connector in so...
Power Apps
Answered

Custom Connector in solutions

(1) ShareShare
ReportReport
Posted on by 11

Hi community!

 

Question around Customer Connectors and importing solutions to different environments. I have a GraphAPI Custom Connector part of my solution. Whenever I make any update to the PowerApp, export the solution and import to my production environment. The OAuth data is lost on import so the app stops working. I constantly need to come in and re-enter the client id, client secret and resource URL following the import.

 

Is there anyway around this or anything I'm missing?

 

Thanks!

Categories:
I have the same question (0)
  • Verified answer
    PowerPuffKK Profile Picture
    316 on at

    Hi @Den ,

     

    The best way to solve this is by using environment variables.

     

    Add three environment variables to your solution - one for client ID, one for client secret and one for resource URL.

     

    When you then import the solution to your target environment, you'll need to enter those once on import, they are then stored in a Dataverse table. Every subsequent import of an updated solution package will automatically use those variables.

     

    If this answer helps you, please mark it as a solution to help future forum visitors.

     

    Thank you

    Kristine 😊

  • Den Profile Picture
    11 on at

    Hi Kristine,

     

    Thank you for your response. I actually didn't realise I could use environmental variables in custom connectors. I have changed my solution to include this now which solves my issue.

     

    If anyone else wants some more info on this: Use environment variables in solution custom connectors (preview) | Microsoft Docs

     

    Many Thanks,

    Den

  • sohilbhalla Profile Picture
    72 on at

    Hello @PowerPuffKK , I am also facing the same issue. I am using environment variables for my client id and secret which in turn connects to Azure Key Vault. But when I import the solution in the environment it seems the client secret is getting cleared inside the custom connector. I am using client secret as @environmentVariables("clpr_ClientSecret") inside my connector.

     

    Then I have to edit the connector manually in the solution in the target environment and put the client secret again as @environmentVariables("clpr_ClientSecret"), which solves the problem, but it turns my solution from managed to unmanaged solution( which is a bigger problem).

     

    Not sure what can be done here? this does not seem to be desired behavior

     

     

  • sohilbhalla Profile Picture
    72 on at

    In my export of the solution the connector connection parameters file is missing client secret. This has been changed recently may be with new powerapps client version as in my previous solutions i can see client secret as well-

     

    {
        "token": {
            "type": "oauthSetting",
            "oAuthSettings": {
                "identityProvider": "oauth2",
                "clientId": "@environmentVariables(\"clpr_ClientID\")",
                "scopes": [],
                "redirectMode": "GlobalPerConnector",
                "properties": {
                    "IsFirstParty": "False",
                    "IsOnbehalfofLoginSupported": false
                },
                "customParameters": {
                    "AuthorizationUrl": {
                        "value": "https://login.microsoftonline.com/<tenantid>/oauth2/authorize"
                    },
                    "TokenUrl": {
                        "value": "https://login.microsoftonline.com/<tenantid>/oauth2/token"
                    },
                    "RefreshUrl": {
                        "value": "https://login.microsoftonline.com/<tenantid>/oauth2/token"
                    }
                }
            }
        }
    }
     
    These are differences
     
    sohilbhalla_1-1710481191247.png

    Left is old, right is new


     

  • austinm34 Profile Picture
    10 on at

    I am having the same issue. We use environment variables for the client ID and secret, and as soon as I export the custom connector solution it clears the client secret variable. I even put it in, resave, and immediately export and it still does the same thing. This is a huge issue because we have sent out new releases to customers without realizing this issue.

  • SimonSays Profile Picture
    168 on at

    This is the one blocker preventing a fully automated CICD pipeline. Would love to know if anybody has found a workaround?

  • SimonSays Profile Picture
    168 on at

    I've devised a workaround that relies on using Azure DevOps for the CICD pipeline. If you don't already have a DevOps pipeline I suggest reading this article first.

     

    I added a folder called Connectors to my Repo and copied the connectionparameters.json file for the custom connector I'd created. Inside this json I add the missing clientSecret e.g

     "oAuthSettings": {
     "identityProvider": "aad",
     "clientId": "@environmentVariables(\"APIClientID\")",
     "clientSecret": "@environmentVariables(\"APIClientSecret\")",

     then within my pipeline I add a CopyFiles@2 task like this:

    - task: CopyFiles@2
     displayName: 'Copy Connector Settings Files to: $(Build.SourcesDirectory)/$(SolutionName)/Connectors'
     inputs:
     SourceFolder: Connectors
     Contents: '**'
     TargetFolder: '$(Build.SourcesDirectory)/$(SolutionName)/Connectors'
     OverWrite: true

    So essentially I'm overwriting the CustomConnectorName_connectionparameters.json file with a file stored in the source control. I only have one custom connector but could apply this for any custom connectors. Hope this helps somebody. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard