I started writing a blog post today about hooking PowerShell Azure Functions into PowerApps.
But I couldn’t get even the simplest function to work – every query resulted in 500 (Internal Server Error).
Of course, I spent ages looking for a stupid mistake that I’d made. (And I found one: my code containted Wait-Debugger – this is still my biggest Azure Functions gotcha.)
Then I put two and two together. The PowerShell Gallery is down today, and this has broken a bunch of people’s CI/CD pipelines.
This is the error that I see in the Azure Functions portal:
Exception: Fail to install function app dependencies.
Restarting the app may resolve the error.
Error: 'A connection attempt failed because the
connected party did not properly respond after a period
of time, or established connection failed because
connected host has failed to respond A connection attempt
failed because the connected party did not properly respond
after a period of time, or established connection failed
because connected host has failed to respond'
And I was able to fix my Function by commenting out the Az line in my local project’s requirements.psd1 and pushing the changes to Azure:
# This file enables modules to be automatically managed by the Functions service.
# Only the Azure Az module is supported in preview.
# See https://aka.ms/functionsmanageddependency for additional information.
#'Az' = '1.*'
Needless to say, PowerShell Azure Functions is in Public Preview, and it’s expected that things will sometimes not work.
But I expect dependencies on PowerShell Gallery in the wider ecosystem will get a lot of attention after today!