PowerShell language worker for Azure Functions.
Перейти к файлу
Tyler James Leonhardt 9ebf44f942
E2e test suite from Nodejs worker (#139)
* Add e2e test suite from java worker

* add to appveyor for CI

* remove Invoke-Test for e2e

* move test csproj

* fix path in module tests

* change to capital T

* uppercase another T

* delete extensions.csproj

* add silentlyContinue to Remove-Item

* props file is one directory up
2019-02-01 18:15:39 -08:00
.vscode Support `profile.ps1` and remove auto-auth to azure (#114) 2018-12-12 21:17:58 -08:00
examples/PSCoreApp Refactor the code to pre-validate at 'FunctionLoadRequest' and officially support entrypoint (#116) 2018-12-14 13:49:51 -08:00
managedDependencies Adding supportedManagedDependencies.json with a list of supported modules. (#129) 2019-01-17 19:05:42 -08:00
package Set ProductVersion by having a common props file (#142) 2019-02-01 16:30:29 -08:00
protobuf Added subtree from 'azure-functions-language-worker-protobuf' repo. Branch: dev. Commit: 58b3dc0 (#61) 2018-09-20 22:12:12 -07:00
src Use ConvertFromJson/ConvertToJson APIs directly (#141) 2019-02-01 16:31:09 -08:00
test E2e test suite from Nodejs worker (#139) 2019-02-01 18:15:39 -08:00
tools Embed resource strings to the PS worker and move all error strings to the resource file (#135) 2019-01-23 13:23:05 -08:00
.gitignore Add in-process concurrency support to the PS worker (#123) 2019-01-07 11:56:22 -08:00
LICENSE Initial commit 2018-07-27 09:17:18 -07:00
NuGet.config Remove `powershell-core` and `dotnet-core` feeds from NuGet.config (#60) 2018-09-19 23:34:05 -07:00
PowerShellWorker.Common.props Set ProductVersion by having a common props file (#142) 2019-02-01 16:30:29 -08:00
README.md add better what's available 2018-12-14 15:18:58 -08:00
ThirdPartyNotices.txt add ThirdPartyNotices (#32) 2018-09-06 18:37:58 -07:00
appveyor.yml E2e test suite from Nodejs worker (#139) 2019-02-01 18:15:39 -08:00
azure-functions-powershell-worker.sln E2e test suite from Nodejs worker (#139) 2019-02-01 18:15:39 -08:00
build.ps1 E2e test suite from Nodejs worker (#139) 2019-02-01 18:15:39 -08:00

README.md

Azure Functions Logo

Branch Status
master Build status
dev Build status

Azure Functions PowerShell Language Worker

This repository will host the PowerShell language worker implementation for Azure Functions. We'll also be using it to track work items related to PowerShell support. Please feel free to leave comments about any of the features and design patterns.

🚧 The project is currently work in progress. Please do not use in production as we expect developments over time. To receive important updates, including breaking changes announcements, watch the Azure App Service announcements repository. 🚧

Overview

PowerShell support for Functions is based on PowerShell Core 6.1, Functions on Linux, and the Azure Functions runtime V2.

What's available?

Triggers / Bindings

  • HTTP Trigger (Webhook)
  • Timer Trigger
  • Blob Trigger
  • Queue Trigger

What's coming?

  • More triggers and bindings
  • Tooling integration
  • A bunch of other good things

Contributing

This project is not currently taking pull requests because it's still in the early development and is changing rapidly.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Building from source

Prereqs

Build

  1. Clone this repository
  2. cd azure-functions-powershell-worker
  3. ./build.ps1

NOTE: If you're missing a dependency, you will be asked to run ./build.ps1 -Bootstrap

Run & Debug

The PowerShell worker alone is not enough to establish the functions app, we also need the support from Azure Functions Host. You may either use a published host CLI or use the in-development host. But both of the methods require you to attach to the .NET process if you want a step-by-step debugging experience.

Published Host

First, follow the instructions to install the Azure Functions Core Tools. Then locate the azure-functions-core-tools\bin\workers\ folder. Here are a few hints on where it could be located:

On Windows if you installed via npm

~\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\

On macOS if you installed via brew

/usr/local/Cellar/azure-functions-core-tools/<version>/workers/

Copy the result of the publish directory into a powershell folder under workers:

Copy-Item -Recurse -Force ./src/bin/Debug/netcoreapp2.1/publish/ "/usr/local/Cellar/azure-functions-core-tools/$(func --version)/workers/powershell"

NOTE: if the powershell folder already exists, you should delete it or debugging won't work.

Then cd into a Function App with PowerShell as the worker runtime (NOTE: There's an example PowerShell Function App in the examples folder).

Lastly, run:

func start

NOTE: If you would like to see more out of the logs, see the logging section in the Azure Functions Host repo.

Latest Host

A developer may also use the latest host code by cloning the git repository Azure Functions Host. Now you need to navigate to the root folder of the host project and build it through:

dotnet restore WebJobs.Script.sln
dotnet build WebJobs.Script.sln

After the build succeeded, set the environment variable "AzureWebJobsScriptRoot" to the root folder path (the folder which contains the host.json) of your test functions app.

Then copy the publish directory to workers:

Copy-Item -Recurse -Force ./src/bin/Debug/netcoreapp2.1/publish/ "<Azure Functions Host Root>/src/WebJobs.Script.WebHost/bin/Debug/netcoreapp2.1/workers/powershell"

Then you can start the host but running:

dotnet ./src/WebJobs.Script.WebHost/bin/Debug/netcoreapp2.1/Microsoft.Azure.WebJobs.Script.WebHost.dll

Note: Remember to remove "AzureWebJobsScriptRoot" environment variable after you have finished debugging, because it will also influence the func CLI tool.

Packaging

To package the PowerShell Language Worker as a nupkg, do the following:

  • cd azure-functions-powershell-worker
  • dotnet publish
  • cd package
  • dotnet pack

That will place a Microsoft.Azure.Functions.PowerShellWorker.*.nupkg in:

azure-functions-powershell-worker/package/bin/Debug

It pulls the contents of the publish folder in:

azure-functions-powershell-worker/src/bin/Debug/netcoreapp2.1/publish

if you specify a different Configuration or TargetFramework that will be honored.