I am using our Enterprise Portal Notebook server to create a notebook of a toolbox that already exists, one that appends from an AGOL layer that has attachments.
We use the code:
with arcpy.EnvManager(preserveGlobalIds=True, maintainAttachments=True):
arcpy.management.Append(inputs=agol_url, target=target, schema_type="NO_TEST", field_mapping="", subtype="", expression=where_clause)
This exact code works in ArcGIS Pro notebook, and it works when calling the toolbox file from the notebook server, but it gives an error when called in the notebook with the same parameters.
The 'agol_url' is changed in the error from the actual layer.
ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Datasets: Dataset agol_url does not exist or is not supported Failed to execute (Append).
I have used the code gis = GIS(portal_url, username, password)
and x = arcpy.SignInToPortal(portal_url, username, password)
to sign in and try and set the active portal thinking this was the problem, but it still does not work while I can .edit_features() of the AGOL layer just fine, so I'm stumped.