Select to view content in your preferred language

ArcGIS Pro Jupyter Notebook pointing to AGOL

507
2
Jump to solution
01-11-2024 12:10 PM
JoseSanchez
Regular Contributor

Good afternoon everyone,

I published a new hosted feature class to AGOL with ArcGIS Pro. When I create a Notebook in ArcGIS Pro and try to get the hosted feature class with the code below, I get an error message.

from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection
gis = GIS()
item = gis.content.get("1b17cac40e0c4af69c1d2e43c7bb7b29")

 

and I get the following error message:

Error Message:
Exception: You do not have permissions to access this resource or perform this operation.
(Error Code: 403)

 

How can I fix that?

Thanks.

 

 

0 Kudos
1 Solution

Accepted Solutions
rwrenner_esri
Esri Alum

Instead of using gis = GIS() use gis = GIS("Pro") instead. That way you're connecting via your Pro credentials rather than anonymously.

-Rylee

View solution in original post

0 Kudos
2 Replies
rwrenner_esri
Esri Alum

Instead of using gis = GIS() use gis = GIS("Pro") instead. That way you're connecting via your Pro credentials rather than anonymously.

-Rylee

0 Kudos
MarkGilbert
Esri Contributor

This is magic! Thank you. I wasn't aware of the pattern.

0 Kudos