<?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: Unable to connect to ArcGis Enterprise Portal via python using token in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-connect-to-arcgis-enterprise-portal-via/m-p/845044#M3640</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am facing the same issue.&amp;nbsp;&lt;A _jive_internal="true" class="" data-userid="70589" data-username="sigu" href="https://community.esri.com/people/sigu" style="color: #8ca9cd; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: none; font-size: 13.7136px;"&gt;service sigu&lt;/A&gt;&amp;nbsp;please let me know if you solved it .&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Sep 2020 09:55:01 GMT</pubDate>
    <dc:creator>LuckyMishra</dc:creator>
    <dc:date>2020-09-18T09:55:01Z</dc:date>
    <item>
      <title>Unable to connect to ArcGis Enterprise Portal via python using token</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-connect-to-arcgis-enterprise-portal-via/m-p/845042#M3638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to connect to our ArcGis Entreprise portal in a python script using a valid token, but it fails ....&lt;/P&gt;&lt;P&gt;I execute this script from ArcGis Pro connected to our portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #33cccc;"&gt;#My script "Script"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #33cccc;"&gt;import arcgis.gis&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #33cccc;"&gt;import arcgis.gis.admin &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #33cccc;"&gt;import arcgis.gis.server&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #33cccc;"&gt;ent_gis = arcgis.gis.GIS(url=arcpy.GetActivePortalURL(),token=arcpy.GetSigninToken())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #33cccc;"&gt;print(arcpy.GetActivePortalURL())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Messages&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;Start Time: mercredi 23 octobre 2019 15:01:01&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;Running script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;Failed script Script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp; File "C:\Users\freval-s\Documents\ArcGIS\Projects\MyProject5\portal_ent.py", line 6, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ent_gis = arcgis.gis.GIS(url=arcpy.GetActivePortalURL(),token=arcpy.GetSigninToken())&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 381, in __init__&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self._lazy_properties = PropertyMap(self._portal.get_properties(force=force_refresh))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\portalpy.py", line 1088, in get_properties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if resp:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;UnboundLocalError: local variable 'resp' referenced before assignment&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;Failed to execute (Script).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;Failed at mercredi 23 octobre 2019 15:01:07 (Elapsed Time: 5,80 seconds)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2019 13:22:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-connect-to-arcgis-enterprise-portal-via/m-p/845042#M3638</guid>
      <dc:creator>servicesigu</dc:creator>
      <dc:date>2019-10-23T13:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect to ArcGis Enterprise Portal via python using token</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-connect-to-arcgis-enterprise-portal-via/m-p/845043#M3639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is how the getting started &lt;A href="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/"&gt;notebooks&lt;/A&gt;&amp;nbsp;(&lt;STRONG&gt;Click on link Using Oauth 2.0&lt;/STRONG&gt;) showed me how to access portal content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a Python application on your portal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Sign In to Portal&lt;/P&gt;&lt;P&gt;2. Go to My Content&lt;/P&gt;&lt;P&gt;3. Click on Add Item and select application&lt;/P&gt;&lt;P&gt;4. Dialog appears and select Application&lt;/P&gt;&lt;P&gt;5. Name the application Python and give it a tag Python&lt;/P&gt;&lt;P&gt;6. Go to Settings under the application you just created and grab the client id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you create the portal python application, Use the following code in your notebook&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcgis&lt;BR /&gt;from arcgis.gis import GIS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gis = GIS("https://&amp;lt;portal address&amp;gt;/portal",client_id='###########') #client id is the id assigned to the python application&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2019 15:47:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-connect-to-arcgis-enterprise-portal-via/m-p/845043#M3639</guid>
      <dc:creator>MichaelWallace3</dc:creator>
      <dc:date>2019-10-23T15:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect to ArcGis Enterprise Portal via python using token</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-connect-to-arcgis-enterprise-portal-via/m-p/845044#M3640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am facing the same issue.&amp;nbsp;&lt;A _jive_internal="true" class="" data-userid="70589" data-username="sigu" href="https://community.esri.com/people/sigu" style="color: #8ca9cd; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: none; font-size: 13.7136px;"&gt;service sigu&lt;/A&gt;&amp;nbsp;please let me know if you solved it .&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2020 09:55:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-connect-to-arcgis-enterprise-portal-via/m-p/845044#M3640</guid>
      <dc:creator>LuckyMishra</dc:creator>
      <dc:date>2020-09-18T09:55:01Z</dc:date>
    </item>
  </channel>
</rss>

