Azure function taking a long time to load, save, run and receiving an unexpected error.

David Holden 5 Reputation points
2023-10-02T15:57:49.2266667+00:00

I am relatively new to power shell and azure functions. I have the power shell script that extracts catalogue information (reports, datasets et cetera) and activities information for the previous 24 hours. This currently works on premise.

I am attempting to move this to an Azure function. As of Friday, the scripts were running, for activities and writing the data to Json files. On Friday I was trying to amend the script to store the Json files in a storage account, instead of the function filesystem.

(I realise I should be developing in an external tool, such as visual studio code, but initially I am developing in the Azure web environment-at least until I have activities working, then I take a step back and re-evaluate the best strategy. Unfortunately for me this will also include deciding what environment works best with my speech recognition software.

Anyway, today the azure function environment has been extremely slow… By that I mean over a minute to load up the Code + Test screen or even to save the script. The script appears to be refusing to run with the offending line being:-

I have even reduced the script to just setting a variable and outputting a response but even as 16 lines script is taking over a minute to load (and usually it just fails to load) or save.

The handful of times that it has run suggests that the line it did not like is:-
$currentPath = $PSScriptRoot

But as I have already said, this was all working on Friday.

Any suggestions?

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,401 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,172 questions
{count} vote

1 answer

Sort by: Most helpful
  1. David Holden 5 Reputation points
    2023-10-09T11:09:12.7133333+00:00

    The problems seemed to have been rectified. Thanks for your help.