Use-Custom-PowerShell-modules-in-Azure-Functions

Azure Functions will be able to support customers bringing their own modules. These modules will reside in a folder named modules that is located in the same directory where the PowerShell script resides.

We will not support customers installing their own modules using the Install-Module cmdlet, however, customers may upload their modules into the modules folder.

All modules in the modules folder will be loaded automatically, so customers will not have to explicitly use the Import-Module cmdlet.

We will support script, binary and manifest modules. These modules will reside in a flat structure within the modules folder.

For runtime 1, the folder should be located in the directory of each azure function.

1
2
3
4
5
Install-PackageProvider nuget -force -scope CurrentUser;

mkdir ./[function folder]/Modules;

save-module [module-name] -path ./[function folder]/Modules

For runtime 2, the folder should be located int the /wwwroot directory to be shared by all azure functions.

1
2
3
4
5
Install-PackageProvider nuget -force -scope CurrentUser;

mkdir ./Modules;

save-module [module-name] -path ./Modules

1

2

HTH. By Jacky 2020-3-2