Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Governance and Administ...
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?
  • Kikoger Profile Picture
    221 on at
    Re: Use Add-PowerAppsAccount in Azure Function

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

  • eleung83 Profile Picture
    232 on at
    Re: Use Add-PowerAppsAccount in Azure Function

    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

  • Gozar Profile Picture
    2 on at
    Re: Use Add-PowerAppsAccount in Azure Function

    Is there anyone who can help?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Governance and Administering

#1
bscarlavai33 Profile Picture

bscarlavai33 5 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 4 Super User 2025 Season 1

#3
Vince_K Profile Picture

Vince_K 2

Overall leaderboard

Featured topics