I have been working on this automation that generates a report from an online ticketing tool and then stores the Excel report in a folder, from where the PowerBI file has to be opened. Once open, refresh button needs to be pressed. Followed by saving the file.
While running the automation from orchestrator, my job is failing with the below error.
Use Application: pbidesktop.exe: Cannot bring the target application in foreground because the Windows session is locked.
I am running this task in a remote server in unattended mode. My all the other tasks like manipulating Excel sheets, browsing to a location in the web, etc is working. Except for PowerBI.
FYI, when I am logged in to the remote server, the process completes normally.
To anyone that faces similar issues in the future, here is what I did.
I noticed that, in my server, I had installed UIpath in user-mode. You can check it out by going to task manager, and checking for Uipath Service Host, If not present, you will need to uninstall the UIpath and install it back in Service mode (Recommended for Advanced Users → Unattended mode).
Once done, create a new machine in your orchestrator, and generate the machine key. And use the key in Uipath assistant to connect the same. After the connection is done, I was able to run the application with the server locked but was facing an issue when I had to close a dialog button after a process. For that, I used the CV activities by clicking the button. Thanks to Uipath Community members.