Select to view content in your preferred language

ArcGIS API for Python - Group Manager - Create - 403 Error

833
2
07-06-2021 04:51 PM
LouieRowley
Occasional Contributor

I would like to use the migration abilities of the API however after the migration.create is called, I receive a 403 error.  I have not idea why the error, I can do other things, such as search and get the item id for the group. 
 
<code>
gisconn
 = GIS(user etc)
gp = gisconn.groups.get('someid')
result = gp.migration.create(items=self.get_map_ids(),future=False) #produces 403
</code>

<error>
File "c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 1319, in create
res = self._gis._con.post(url, params)
File "c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 720, in post
force_bytes=kwargs.pop('force_bytes', False))
File "c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 514, in _handle_response
self._handle_json_error(data['error'], errorcode)
File "c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 536, in _handle_json_error
raise Exception(errormessage)
Exception: You do not have permissions to access this resource or perform this operation.
(Error Code: 403)
</error>
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

This error?  BUG-000136399: The error message, “Error Code: 403 Access to admin .. (esri.com)

don't know it applies, but there is a suggested workaround


... sort of retired...
0 Kudos
LouieRowley
Occasional Contributor

Thanx Dan and I hope you are sort of relaxing.  🙂
I am sure that this is related.  In this case I am not using the a domain user in the login but it may be the user that is being used to access the internet, that is referenced here.  I have no idea where I could alter that user other than using the proxy option, which I have already tried; something like below.

<code>
portal = "https://azure.myserver/portal"
userid = "enterprise_admin"
pwd = "enterprise_admin_pwd"
gis_init =r"MYUSERNAME:userpassword@255.255.255.255"
gisconn=gis(portal,userid,pwd,proxy_host=gis_init, proxy_port=8080)
</code>

0 Kudos