arcpy missing target server

443
5
07-14-2019 10:11 PM
GNOMICAdmin
New Contributor III

when I use this sharing_draft = m.getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", service) I get an error missing target server. 

I'e signed in using my /portal url and my federated server is on a /server GIS site url. There is no-where to tell it the name of the target sever or url

thoughts? Trying to publish a Pro project file as a federated map image through code.

0 Kudos
5 Replies
AlistairFox
Occasional Contributor

i also have this same issue

0 Kudos
DavidIralu
Esri Contributor

Hi,

I faced the same question and found it in the docs.

Looking at the docs:

MapImageSharingDraft—Sharing module | Documentation   

...you'll need to add the 'federatedServerUrl' property to the 'MapImageSharingDraft' object.

(from the Code Sample on the same page...)

sharing_draft = m.getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", service)
sharing_draft.federatedServerUrl = "https://MyFederatedServer.esri.com/server"
LorenzMeyer1
New Contributor III

Hi,

Our portal (ArcGIS 10.7.1) and thus the federated server is secured with Web-Tier Authentication (Apache Tomcat and the Java WebAdapter) with LDAP (Basic-Auth).

In my case, calling the exportToSDDRAFT function after specifying the federatedServerUrl fails with the error:
Exception has occurred: ValueError
Target server is not a federated server or is inaccessible.

 

How can I hand over authentication params to the arcpy function to finally generate a *.sddraft or *.sd file?

sharing_draft = m.getWebLayerSharingDraft("FEDERATED_SERVER""MAP_IMAGE", service)
sharing_draft.federatedServerUrl = "https://MyFederatedServer.esri.com/server"
sharing_draft.summary = "My Summary"
sharing_draft.tags = "My Tags"
sharing_draft.description = "My Description"
sharing_draft.credits = "My Credits"
sharing_draft.useLimitations = "My Use Limitations"

# Create Service Definition Draft file
sharing_draft.exportToSDDraft(sddraft_output_filename)
0 Kudos
Abby_Gleason
New Contributor

I am having the same issue as LorenzMeyer1. In my case, the commands execute and I am able to complete publishing when I am using the python window in ArcPro. In a script however, the 'exportToSDDraft' command fails with the error:

'ValueError:Target server is not a federated server or is inaccessible'

Has anyone run across a solution? 

Thank you

0 Kudos
MinbinJiang
Esri Contributor

if I were you, I probably would test manual publishing with ArcGIS Pro with the same credentials and federate server first, trying to isolate the settings from portal site

0 Kudos