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

Announcements

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,070

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 608

Last 30 days Overall leaderboard