Select to view content in your preferred language

Scheduling Tasks That Access Portal Data

659
10
Jump to solution
06-12-2025 09:05 AM
Labels (1)
DavidSolari
MVP Regular Contributor

I'm going over how my team manages scheduled tasks and I'm running into a roadblock. We have a number of tools that need to run directly against feature services, which means Pro needs credentials for the portal they're hosted and registered in. The issues is that Pro doesn't keep a user signed in indefinitely, so I have to go through every machine that runs these tasks and sign out then in to refresh the credentials. Consolidating every task to a single machine and service account simplifies this process but ideally I want a solution that doesn't need regular checkups like this.

Has anyone found a good solution for keeping Pro credentials refreshed? Alternatively, is there a reliable way for tasks to access portal data without relying on Pro's current account?

0 Kudos
10 Replies
DavidSolari
MVP Regular Contributor

Bingo! Scheduling a task that accesses a feature service, opening the task wrapper and adding arcpy.SignInToPortal(arcpy.GetActivePortalURL(), username, password) makes the tool run without issues. It even sets the application's logged-in user which is great for consistency. Thanks for all the advice Josh!