<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python script unable to find target server in Publishing and Managing Services Questions</title>
    <link>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1396391#M1150</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/216475"&gt;@RVx_GaslineGiS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Were you able to resolve this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2024 02:38:07 GMT</pubDate>
    <dc:creator>Tejwant</dc:creator>
    <dc:date>2024-03-15T02:38:07Z</dc:date>
    <item>
      <title>Python script unable to find target server</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1305341#M988</link>
      <description>&lt;P&gt;I'm trying to overwrite a published service on a federated server. I've been following the ESRI sample script here: &lt;A href="https://github.com/jnshill/ArcPyPublishing/blob/8af7523a692498e4c22a142dfc940e3c355efaba/PublishLayersAsMIL_FA_Timezone.py#L95" target="_blank"&gt;https://github.com/jnshill/ArcPyPublishing/blob/8af7523a692498e4c22a142dfc940e3c355efaba/PublishLayersAsMIL_FA_Timezone.py#L95&lt;/A&gt; without much success.&lt;/P&gt;&lt;P&gt;Despite assigning the federatedServerURL, I get a "Missing target server" error. I've confirmed that the token I pull from the Portal works by singing into the REST API. I verified the federated server URL by logging into the Portal Administrator Directory -&amp;gt; Federation -&amp;gt; Servers and snagging the URL field from there.&lt;/P&gt;&lt;P&gt;However, even with all of that....still missing target server. In the python code, I can call the .federatedServerURL and it will yield a result that matches with what is in my administrator directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any ideas on what else to check?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;   outdir = r'D:\\location'
   ## Folder the Map Service will Go too
   in_folder="Folder1"
   service = "servicename"
   sddraft_filename = service + ".sddraft"
   sddraft_output_filename = os.path.join(outdir, sddraft_filename)

   # Reference map to publish
   aprx = arcpy.mp.ArcGISProject(r"C:\\Project.aprx")
   # Get first map
   m = aprx.listMaps("MapName")[0]
   # List enterprise URl and credentials here
   portalURL = r"https://portalServer/webAdaptor"
   fed_server = r"https://ServerURL/webAdaptor"
   cred_detail = []
   #sign into credentials
   portal_pw = keyring.get_password("stuff", "user")
   portal_user = "user"
   #Sign into Portal
   arcpy.SignInToPortal(portalURL, portal_user, portal_pw)
   
   # Create MapImageSharingDraft and set service properties
   sharing_draft = m.getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", service)
   sharing_draft.federatedServerURL = fed_server
   sharing_draft.portalFolder = 'Folder1'
   sharing_draft.description = "Description"
   sharing_draft.credits = "Name"
   sharing_draft.tags = "Tags"
   sharing_draft.copyDataToServer = False
   sharing_draft.overwriteExistingService = True
   sharing_draft.exportToSDDraft(sddraft_output_filename)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 03 Jul 2023 14:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1305341#M988</guid>
      <dc:creator>RVx_GaslineGiS</dc:creator>
      <dc:date>2023-07-03T14:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python script unable to find target server</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1345883#M1046</link>
      <description>&lt;P&gt;That url advice in the documentation is maybe right for some, but for us we had to use the &lt;A href="https://domain/arcgis" target="_blank"&gt;https://domain/arcgis&lt;/A&gt; url.&amp;nbsp; using /webadapter as suggested fails.&lt;/P&gt;&lt;P&gt;However, my script gets up to the stage service and the bombs with 999999.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 14:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1345883#M1046</guid>
      <dc:creator>StaticK</dc:creator>
      <dc:date>2023-11-04T14:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python script unable to find target server</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1396391#M1150</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/216475"&gt;@RVx_GaslineGiS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Were you able to resolve this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 02:38:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1396391#M1150</guid>
      <dc:creator>Tejwant</dc:creator>
      <dc:date>2024-03-15T02:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python script unable to find target server</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1636567#M1424</link>
      <description>&lt;P&gt;I was getting the error "Missing target server" and found out the cause was this property:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# correct
sharing_draft.federatedServerUrl&lt;/LI-CODE&gt;&lt;P&gt;In the code snippet from&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/216475"&gt;@RVx_GaslineGiS&lt;/a&gt;&amp;nbsp;the '...Url' part is written as '...URL', in uppercase instead of capitalized:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# wrong
sharing_draft.federatedServerURL&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Using ArcGIS Pro 3.3.4&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2025 20:27:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1636567#M1424</guid>
      <dc:creator>ThiagoNascimento</dc:creator>
      <dc:date>2025-07-25T20:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Python script unable to find target server</title>
      <link>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1636754#M1426</link>
      <description>&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 01:51:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/publishing-and-managing-services-questions/python-script-unable-to-find-target-server/m-p/1636754#M1426</guid>
      <dc:creator>Tejwant</dc:creator>
      <dc:date>2025-07-28T01:51:00Z</dc:date>
    </item>
  </channel>
</rss>

