Select to view content in your preferred language

item.export fails to run from a Notebook on AGOL using a custom role

794
1
05-20-2021 07:11 PM
ClintonBallandis1
Frequent Contributor

Hi,

I've written a Notebook that backups up our AGOL hosted feature services to File Geodatabases. I'm using the new tasks feature in AGOL to schedule the backups everyday.

The notebook calls the item.export method and everything works well under my default administrator role. I'd like to create a new custom role in AGOL that can be used specifically to run the backups. I was hoping to give this role enough privileges to run the script without having full administrative rights. 

However I can't seem to give the custom role enough permissions. I'm getting the following error:

You do not have permissions to access this resource or perform this operation.

(Error Code: 403)

Question: Can you only run item.export from a default  administrator account or am I missing something in configuring the custom role?

It seems strange that I can create a custom role with full rights to add and delete organizational members and edit update delete data but I cant set one up to do an export ? 

Thanks,

Clinton 

0 Kudos
1 Reply
emedina
Regular Contributor

I've been aware of this issue for some time but have never had time to report it. You're correct - the export function doesn't appear to honor the permissions. You can work around this two ways:

1. Perform the export with a manual call to the ArcGIS REST API.

2. Use :create" to create a replica (you need sync enabled for this).

#2 is not perfect either...I have seen this method drop records at times. Again, an issue I've not had time to report (the workaround is the same - make a manual call to the underlying REST operation).

0 Kudos