Select to view content in your preferred language

Custom print service with embedded credentials for token secured services from ArcGIS Pro to a standalone ArcGIS Server site

1633
5
06-10-2022 02:30 AM
AndyMarchant
Emerging Contributor

 

We have a standalone ArcGIS Server site. Recently we have upgraded from 10.5.1 to to 10.9.1 and migrated services from ArcMap to ArcGIS Pro.

We have a custom print service which works with our token secured services and for simplicity we initially published from ArcMap as we have done previously using embedded credentials: https://enterprise.arcgis.com/en/server/latest/publish-services/windows/printing-maps-that-contain-s... This works fine.

We would now like to migrate this custom print service to one published from ArcGIS Pro, so we will be able to update the site in the future to versions that don't support ArcMap publishing. I've followed the sample here: https://support.esri.com/en/technical-article/000026010  which appeared to work in ArcGIS Pro, but when I publish to ArcGIS Server and execute the tool, for any secure services I get the error: 

Unable to complete operation.
Error executing tool. Export Web Map Task : Failed to create layer from service at https://xxxxx/arcgis/rest/services/xxxxx/MapServer. Failed to execute (Export Web Map). Failed to execute (Export Web Map Task).

The documentation for arcpy.ImportCredentials states this is for nontoken-based secured services: https://pro.arcgis.com/en/pro-app/2.8/arcpy/functions/importcredentials.htm  is this the reason for the error? - does anyone know of an alternative for token-based secured services or is something else going on?

I said above that the custom print appeared to work in ArcGIS Pro - it does create a PNG with the secured services, but I now think it's not getting it's permissions for doing this from the .ags file via the python script.  If I set up a connection to the ArcGIS Server site in ArcGIS Pro it works but if I remove this, close the project, reopen it and rerun the script it asks for credentials for the secure service, so can't be accessing what it needs from the connection file accessed via arcpy.ImportCredentials.

I'm stumped - any suggestions gratefully received!

5 Replies
dd_dev
by
Emerging Contributor

Did you ever resolve this issue? I'm having the exact same problem. 

0 Kudos
AndyMarchant2
New Contributor

No, I've been meaning to contact ESRI support as we need to solve this to move away from ArcMap - will post if it get resolved

0 Kudos
dd_dev
by
Emerging Contributor

Strangely enough, they just released a patch yesterday (like 3-4 hrs after I asked this question) that resolved the issue for us!! 

 

AndyMarchant2
New Contributor

spooky - installed the patch and it's working for us too

StefanStamenković
Occasional Contributor

Hello to all,

I'm having the same issue on AG Server 10.9.1, and couldn't resolve it with installing mentioned patch.

Did anyone managed to overcome it after implementing all common suggestions (including parameters with .ags file, installing patch, using compatible Pro/Server)?

Thanks!

0 Kudos