<?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 MakeFeatureLayer_management() with feature service REST endpoint failing on ArcGIS Server in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1414471#M39299</link>
    <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;I am experiencing an issue where the&amp;nbsp;MakeFeatureLayer_management() function. When I run it on my local machine, it returns the feature layer, but when I run the same script on the server it fails. See below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;token = "_____"
url = fr"https://foo.bar.com/server/rest/services/TargetServiceName/FeatureServer/0?token={token}"
layer_name = "Target Service Name"
layer = MakeFeatureLayer_management(url, layer_name).getOutput(0)

ERROR: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset https://foo.bar.com/server/rest/services/TargetServiceName/FeatureServer/0?token=_____ does not exist or is not supported
Failed to execute (MakeFeatureLayer).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just trying convert the REST URLs into objects that can be used in arcpy geoprocessing tools and cursors. Does anyone know why this error is occurring or whether there is another way to connect to these endpoints?&lt;/P&gt;&lt;P&gt;Please note that this script is completely ad-hoc - it isn't part of a geoprocessing service or anything like that.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2024 22:51:58 GMT</pubDate>
    <dc:creator>ANH</dc:creator>
    <dc:date>2024-04-23T22:51:58Z</dc:date>
    <item>
      <title>MakeFeatureLayer_management() with feature service REST endpoint failing on ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1414471#M39299</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;I am experiencing an issue where the&amp;nbsp;MakeFeatureLayer_management() function. When I run it on my local machine, it returns the feature layer, but when I run the same script on the server it fails. See below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;token = "_____"
url = fr"https://foo.bar.com/server/rest/services/TargetServiceName/FeatureServer/0?token={token}"
layer_name = "Target Service Name"
layer = MakeFeatureLayer_management(url, layer_name).getOutput(0)

ERROR: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset https://foo.bar.com/server/rest/services/TargetServiceName/FeatureServer/0?token=_____ does not exist or is not supported
Failed to execute (MakeFeatureLayer).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just trying convert the REST URLs into objects that can be used in arcpy geoprocessing tools and cursors. Does anyone know why this error is occurring or whether there is another way to connect to these endpoints?&lt;/P&gt;&lt;P&gt;Please note that this script is completely ad-hoc - it isn't part of a geoprocessing service or anything like that.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 22:51:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1414471#M39299</guid>
      <dc:creator>ANH</dc:creator>
      <dc:date>2024-04-23T22:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: MakeFeatureLayer_management() with feature service REST endpoint failing on ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1522316#M40317</link>
      <description>&lt;P&gt;I am running into this same issue.&amp;nbsp; Did you ever solve this?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 15:56:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1522316#M40317</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2024-08-15T15:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: MakeFeatureLayer_management() with feature service REST endpoint failing on ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1522324#M40319</link>
      <description>&lt;P&gt;Well, I just found this:&lt;BR /&gt;&lt;A href="https://support.esri.com/en-us/bug/the-arcpymakefeaturelayermanagement-function-fails-with-bug-000144037" target="_blank"&gt;https://support.esri.com/en-us/bug/the-arcpymakefeaturelayermanagement-function-fails-with-bug-000144037&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How are we suppose to run gp tools on feature services? Summarize Within is not accepting just the feature service URL either as I am getting the same error there.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 16:04:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1522324#M40319</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2024-08-15T16:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: MakeFeatureLayer_management() with feature service REST endpoint failing on ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1545302#M40675</link>
      <description>&lt;P&gt;I'm not sure if this will apply to your situation, but I was able to access a service on our portal that is not shared publicly (Owner access only) by signing into the portal first with&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/signintoportal.htm" target="_blank"&gt;SignInToPortal—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I did not need to add a token query onto the end of the url.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print('Signing into Portal')
arcpy.SignInToPortal(portal_url=&amp;lt;your portal url&amp;gt;,
                     username=&amp;lt;owner username&amp;gt;,
                     password=&amp;lt;owner password&amp;gt;) 

print('Making feature layer')
arcpy.management.MakeFeatureLayer(in_features=&amp;lt;feature layer url&amp;gt;,
                                  out_layer='FeatureLayer')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have the feature layer created, you can then change versions using &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/changeversion.htm" target="_blank"&gt;Change Version (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;(if needed) or plug the feature layer into other geoprocessing tools.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 18:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/makefeaturelayer-management-with-feature-service/m-p/1545302#M40675</guid>
      <dc:creator>BruceBacia</dc:creator>
      <dc:date>2024-10-03T18:00:19Z</dc:date>
    </item>
  </channel>
</rss>

