The following function uses a gis object created by authenticating with an api key developer credential. The line uses a spatially enabled dataframe (SEDF) to overwrite a feature layer in AGOL. It was working successfully until the AGOL security updates to developer credentials in early-mid April 2026. Now it appears the code cannot successfully access the folder containing the feature layer even though the api key has full access (although not recommended), and specifically has access to the feature layer.
zips_to_append_sedf.spatial.to_featurelayer(gis=gis,sanitize_columns=True, overwrite=True,
service=service_info)
Error message:
User is anonymous, exiting
Traceback (most recent call last):
File "C:\Users\xyz\AppData\Local\ESRI\conda\envs\arcgispro-py3-automated_workflows\Lib\site-packages\IPython\core\interactiveshell.py", line 3579, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-e7550eae93a9>", line 1, in <module>
zips_to_append_sedf.spatial.to_featurelayer(gis=gis, sanitize_columns=True, overwrite=True,
File "C:\Users\xyz\AppData\Local\ESRI\conda\envs\arcgispro-py3-automated_workflows\Lib\site-packages\arcgis\features\geo\_accessor.py", line 2459, in to_featurelayer
result = content.import_data(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xyz\AppData\Local\ESRI\conda\envs\arcgispro-py3-automated_workflows\Lib\site-packages\arcgis\gis\__init__.py", line 9029, in import_data
return _cm_helper.import_as_item(self._gis, df, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xyz\AppData\Local\ESRI\conda\envs\arcgispro-py3-automated_workflows\Lib\site-packages\arcgis\gis\_impl\_content_manager\_import_data.py", line 271, in import_as_item
file_item, new_item = _create_items(gis, file, file_type, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xyz\AppData\Local\ESRI\conda\envs\arcgispro-py3-automated_workflows\Lib\site-packages\arcgis\gis\_impl\_content_manager\_import_data.py", line 151, in _create_items
file_item = folder.add(
^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'add'