<?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: Geoprocessing task fails to access Living Atlas layer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/geoprocessing-task-fails-to-access-living-atlas/m-p/1547767#M73012</link>
    <description>&lt;P&gt;According to ESRI support:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Unfortunately, it does seem that accessing protected URLs directly via&amp;nbsp;arcpy&amp;nbsp;within a geoprocessing task is not feasible due to how the&amp;nbsp;arcpy&amp;nbsp;library handles security for such resources. Using REST APIs with a token-based authentication is a reliable alternative.&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2024 20:52:50 GMT</pubDate>
    <dc:creator>DonMorrison1</dc:creator>
    <dc:date>2024-10-10T20:52:50Z</dc:date>
    <item>
      <title>Geoprocessing task fails to access Living Atlas layer</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-task-fails-to-access-living-atlas/m-p/1541203#M72907</link>
      <description>&lt;P&gt;I've found that when I run a python toolbox tool as a geoprocessing task on our ArcGIS server (11.3.0), it fails when I try to access a public layer from the ESRI living atlas (&lt;SPAN&gt;&lt;A href="https://landscape10.arcgis.com/arcgis/rest/services/USA_NLCD_Land_Cover/ImageServer" target="_blank"&gt;https://landscape10.arcgis.com/arcgis/rest/services/USA_NLCD_Land_Cover/ImageServer&lt;/A&gt;&lt;/SPAN&gt;) with this message:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;I&gt;esriJobMessageTypeError&lt;/I&gt;: Traceback (most recent call last): File "&amp;lt;string&amp;gt;", line 58, in execute File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\__init__.py", line 1335, in Describe return gp.describe(value, data_type) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 384, in describe self._gp.Describe(*gp_fixargs(args, True))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: "&lt;A href="https://landscape10.arcgis.com/arcgis/rest/services/USA_NLCD_Land_Cover/ImageServer" target="_blank"&gt;https://landscape10.arcgis.com/arcgis/rest/services/USA_NLCD_Land_Cover/ImageServer&lt;/A&gt;" does not exist&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;It doesn't appear to be a connectivity problem.&amp;nbsp; I works when run from my client. Is there a server configuration option preventing this sort of connection?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    def execute(self, parameters, messages):
        import requests
        url = 'https://landscape10.arcgis.com/arcgis/rest/services/USA_NLCD_Land_Cover/ImageServer'
        arcpy.AddMessage("Status code: " + str(requests.head(url).status_code)) # Prints 302 (redirect)
        arcpy.Describe(url)
        return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2024 16:06:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-task-fails-to-access-living-atlas/m-p/1541203#M72907</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2024-09-22T16:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing task fails to access Living Atlas layer</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-task-fails-to-access-living-atlas/m-p/1543701#M72956</link>
      <description>&lt;P&gt;I made some progress on this in that I believe the problem is that that particular image service requires "subscriber" status which I think simply means the user has to be logged in so a token gets sent along with the request. When I log out of ArcGIS Pro and run the tool it fails that same way as when it is run on the server. I'm still at a loss as to how to do this login on the server where the geoprocessing task is running.&amp;nbsp; I did add a call to SignInToPortal call but that did not fix the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DonMorrison1_0-1727669788289.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116128i3B913BBD779704CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DonMorrison1_0-1727669788289.png" alt="DonMorrison1_0-1727669788289.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 04:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-task-fails-to-access-living-atlas/m-p/1543701#M72956</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2024-09-30T04:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing task fails to access Living Atlas layer</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-task-fails-to-access-living-atlas/m-p/1547767#M73012</link>
      <description>&lt;P&gt;According to ESRI support:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Unfortunately, it does seem that accessing protected URLs directly via&amp;nbsp;arcpy&amp;nbsp;within a geoprocessing task is not feasible due to how the&amp;nbsp;arcpy&amp;nbsp;library handles security for such resources. Using REST APIs with a token-based authentication is a reliable alternative.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 20:52:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-task-fails-to-access-living-atlas/m-p/1547767#M73012</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2024-10-10T20:52:50Z</dc:date>
    </item>
  </channel>
</rss>

