Select to view content in your preferred language

Survey123 Power Automate connector for ArcGIS Enterprise - can't sign in/invalid connection

855
8
05-25-2024 05:09 AM
ShelbyZelonisRoberson
Frequent Contributor

Hi. I've built a custom connector to my Enterprise Survey123 in Power Automate following these instructions: https://support.esri.com/en-us/knowledge-base/create-an-arcgis-survey123-connector-for-microsoft-pow....

I get all the way to the last step to test my connection where I run into issues. I'm able to request permission to my Portal and click "Allow" to sign-in with my Portal user account. However, the connection never actually gets established and I get an error in Power Automate that says "can't sign in". I'm never able to see my list of surveys because I can't establish a connection. Screenshots attached. 

Does my Enterprise Portal user account need certain permissions to be able to login via Power Automate? Or is it a MS 365 account issue? I'm confused! 

Thanks! 

0 Kudos
8 Replies
abureaux
MVP Frequent Contributor

If you press F12 on your keyboard, go to the Network tab, what does the error say? Specifically, do you see a "CORS" error?

EDIT: you will need to press F12, do this process, and look at what pops up. You cant do this afterwards since it only records "live".

0 Kudos
MargoHuang
Occasional Contributor

Hey @ShelbyZelonisRoberson , have you resolved this issue? I am running into the exact same problem.

Hi @abureaux , I tried looking at Network tab. Not very familiar with how to read the messages, but I dont see a "CORS" error. Below are 2 errors I got.

MargoHuang_0-1721669180787.pngMargoHuang_1-1721669199386.png

Do you have any ideas on what might be causing this? Any help is appreciated. Thank you!

Margo

0 Kudos
abureaux
MVP Frequent Contributor

Before you begin:

  1. Is your Portal public-facing? That is a requirement for the connection to work. If you navigate to your Portal over 7443 from any computer (don't do this from the server since that should always work), it should should load normally.

    https://<Machine_Name>.<domain>.com:7443/arcgis/home 

    E.g., https://prd-srv01.myorgname.com:7443/arcgis/home/ 

Esri's instructions are a little outdated now. Here is a simplified set of instructions.

1) I skip over a bunch of optional things.

2) I am using Portal 11.3. These instructions should be applicable for at least 11.3 and 11.4. There may be some slight differences if you use 11.0 - 11.2. If you are still pre-11.0, Esri's instructions may be better aligned with what you see in Portal.

Procedure

Part 1. Create App in Portal

  1. Content > My Content > New Item
    abureaux_3-1721671737308.png
  2.  Application > Other application > Next
    abureaux_5-1721671806114.png
  3. Enter a Title (Optionally: Configure the Folder, Tags, and Summary) > Save
  4. Settings > scroll down to URL and paste in https://make.powerautomate.com/ > scroll down to Redirect URLs > click + Add > paste in https://global.consent.azure-apim.net/redirect > click Save
    abureaux_17-1721674447794.png

Part 2. Power Automate

1. Load Power Automate and log in

2. Look for "Custom connectors" on the left. If you see it, skip to Step #5, below. Otherwise, move on to Step #3, below
abureaux_8-1721672591291.png

3. More > Discover all
abureaux_6-1721672280628.png

4. Scroll down and look for "Custom connectors" under the Data group > click Pin
abureaux_10-1721672873563.png

5. Custom connectors > + New custom connection > Import an OpenAPI from URL
abureaux_0-1721671470068.png

6. Set Connector name to whatever you want > Enter a valid URL (see details below) into Paste in the URL for the Open API field

https://survey123.arcgis.com/api/template/swagger?portalUrl=<ENTERPRISE_URL>

<ENTERPRISE_URL> is the URL to your ArcGIS Enterprise deployment, including the web adaptor, for example, https://myserver.mycompany.com/arcgis

abureaux_11-1721672999658.png

8. Click Import > wait for app to load (<1 second in my test) > click Continue once its available

9. Click 2. Security
abureaux_13-1721673232492.png

10. Copy over Client ID and Client secret from your Portal Application (created in Part 1), and copy Token URL into Refresh URL
abureaux_14-1721673565808.png
It should go without saying, but don't use the values in my screen caps. That is my app created for this test, and it will already be deleted by the time anyone reads this.

11. Click Create connector
abureaux_15-1721673772276.png

12. Click 6. Test > + New connection > Log in
abureaux_18-1721674669477.png

13. Select GetOwnedSurveysList > click Test operation

abureaux_19-1721675203744.png

14. Scroll to bottom of page once it finishes loading (<5 seconds in my test) > look for Validation succeeded

abureaux_20-1721675280725.png

15. If you get this far, you are probably fine. You can follow the regular guide for the other tests if you really want, but it is a little out dated and missing content, so don't expect a 1:1

MargoHuang
Occasional Contributor

Hi! I really appreciate the detailed documentation! Unfortunately we are still on 10.9, but I am sure other people will find it useful.

And I failed at 'Before you begin' part, our portal is on our internal network. I should have read the note carefully.. But now I know why. Thank you for your help! 

0 Kudos
abureaux
MVP Frequent Contributor

All good, so long as you got your answer!

0 Kudos
AshlandGIS
Emerging Contributor

I keep getting a Invalid "redirect_uri" when I try to connect. 

BeckyC-O
Occasional Contributor

I really appreciate the super detailed tutorial @abureaux, but I also get the error message:

Invalid redirect_uri

Error: 400
 
Any thoughts on where this went wrong? We are at Enterprise 11.3.
0 Kudos
BeckyC-O
Occasional Contributor

@AshlandGISI found the answer to our error msg.

Go to Step 6 here in this tutorial article - Create an ArcGIS Survey123 connector for Microsoft Power Automate for use with ArcGIS Enterprise.

BeckyCO_0-1729095384182.png

After following this step I get the "Request for Permission" page to load then I test the new connection.

0 Kudos