web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Use Add-PowerAppsAccou...
Power Apps
Unanswered

Use Add-PowerAppsAccount in Azure Function

(0) ShareShare
ReportReport
Posted on by 2

I have written a script that reminds me on refreshing flows and powerapps according to a specific time rule.

Now I wanted to create an Azure function that ran every week but I do get an error that the assembly "System.Windows.Forms" could not be found.

 

2022-07-27T03:56:34Z [Error] EXCEPTION: The following exception occurred while retrieving member "WithAuthority": "Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified."

 

I call the following cmdlet:

 

Add-PowerAppsAccount -Username $Credentials.UserName -Password $Credentials.Password
 
Is there any chance to make this run?
I have the same question (0)
  • Gozar Profile Picture
    2 on at

    Is there anyone who can help?

  • eleung83 Profile Picture
    232 on at

    I'm assuming you're running a Powershell core version of the Azure Function (and running the latest version of Powershell core)

    I'm also guessing your powershell script has the necessary commands to install the powershell modules.

     

    One thing you could try is importing the module but use the "-UseWindowsPowerShell" argument (this generates a proxy module that uses local Windows Powershell, but I'm not sure if an Azure function running Powershell Core runtime on windows would still have the full powershell stack installed)

     

    Another option you may consider is Azure Automation runbooks which can allow you to schedule powershell scripts execution whenever you want

  • Kikoger Profile Picture
    221 on at

    Were you able to resolve this in the end? Facing the same issue 😕

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard