I've found a curious apparent incompatibility between the Python API as installed with Pro 3.0 and Portal 10.8.1. When I try to search or access items, or perform admin tasks, I get permissions errors:
Exception: You do not have permissions to access this resource or perform this operation.
(Error Code: 403)
For items, the only way to resolve this is to share the item publicly, which is not a good solution for the feature layers I'm working with. At first, I thought it might be the machine I was accessing it from, but I saw that it was working with our Dev Portal which is at 10.9.1. So I tested using another machine which still had Pro at 2.9, and it worked correctly. I then upgraded Pro on that machine to 3.0 and saw the same behavior. Is this a bug? Or is there a security setting, additional authentication step, etc, I need to be using?
Here is an example of the code I'm using:
from arcgis import gis
portal = gis.GIS(r'https://myserver.myCompany.com/portal', username = r'superduperuser')
portal.content.get("ebea40d5aeg1beri5h3924306fe3142f")
The looks like a typical proxy issue. I'm guessing your internet access goes through a proxy.
Can you elaborate on this and/or provide some additional resources for a solution?
Is there something different with how proxies are handled between Pro 2.9 and 3.0 and/or Enteprise 10.8.1 and 10.9.1? I ask because Pro 3.0 and Enterprise 10.8.1 is the only combination of those that doesn't work.
I'll try... My corporate proxy goes through ports 8888. If ArcGIS Pro is trying to get out on 443 it will not work. You will need to declare HTTP/HTTPS using 8888
OR
You will need to authenticate in python to get out through the proxy
add the following syntax:
response = requests.get(url, auth=('user', 'pass')
Having same issue trying to update a web map using jupyter notebook (arcgis pro 3.0.1)
map1.update()
Exception: You do not have permissions to access this resource or perform this operation.
(Error Code: 403)
Glad to hear I'm not the only one. What version of Portal/AGOL are you using?