Lambda and other thoughts
See original GitHub issue-
Allow the user to declare assembly dependencies. (what UX?)
- e.g. A function depends on a custom assembly, which will be loaded by
using Assembly ...orAdd-Type ..., orAssembly.Load(...). Do we want to support that scenario? One solution would be theAssemblyLoadContext.Default.Resolving.
- e.g. A function depends on a custom assembly, which will be loaded by
-
~Capture
Write-Hostto logging~Write-Hostalso write the message toInformationstream, so we are good here. -
PowerShell based Lambda doesn’t bundle
AWSPowerShell.NetCore(AWS version ofAzureRM.NetCore) with the runtime, but instead, bundle it with user’s scripts in the deployment package. The user needs to use#Requires -Modulesin script to specify the module dependency.- I don’t like having
AzureRM.NetCorebundle with user’s Function App, that will likely cause duplications of such module, which is a waste of bandwidth. However, that would solve the module version issue, since user needs to be explicit about what version ofAzRMto be deployed. - But we do need a way to let user specify what custom module they want to deploy along with their scripts. (what UX? use
#Requires -Moduleslike Lambda does?) - Just realized that the
funcCLI doesn’t have apackoption. Is the deployment restricted to container image?dotnet-lambda packagepack the function app into azipfile, ready for deployment.- Lambda provides a powershell module to facilitate creating a powershell lambda, including templates, create a package (zip), publish a package to AWS.
- By having a powershell helper module, it’s able to parse the script to get the module dependencies from
#Requires -Modules ..., and pack the dependencies into the package. We cannot find the dependency moduels without running in the PowerShell session that the user uses for creating the function.
- I don’t like having
-
~Lambda tool is a .NET Global Tool “Amazon.Lambda.Tools”. Maybe
funcCLI should consider to be a Global Tool too, given it’s a .NET Core application.~ (not related to the PS worker)
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Some Quick Thoughts on LaMBDA and Sentience
Folks seem to be talking past each other, working with different definitions of terms, and being overconfident in their proclamations. So I ...
Read more >9 Killer Use Cases for AWS Lambda | Contino
In this post, I will cover how Lambda works, what makes it different and explore 9 killer AWS Lambda use cases.
Read more >AWS Lambda - Serverless Computing
AWS Lambda is a serverless compute service for running code without having to provision or manage ... Run code without thinking about servers...
Read more >Are Lambda-to-Lambda calls really so bad?
A more accurate description of my thinking should be “across ownership lines”. That is, calling Lambda functions that are owned by other ......
Read more >Learning about Lambda function in Python
A Lambda Function in Python is an anonymous function or a function which doesn't have any name. It is a mostly one liner...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks @KirkMunro for sharing your experiences. For the last two points, it’s doable by loading a module to a separate
AssemblyLoadContext. Both code and data (statics) from a module can be isolated in that way. The idea is to add a new flag-IsolatedtoImport-Moduleto explicitly make powershell load a module to a separate assembly context. The tricky part is how the type resolution in powershell should change accordingly. I will write up an RFC on this after PSConf Asia, probably in late November.funcCLI as a global tool makes sense but is orthogonal to this and I suspect many PowerShell scripters won’t have dotnetcli installed.From a packaging standpoint, I think it would be interesting to have a generic way to package a script and dependencies so that ITPros can easily distribute them in their environment even outside of AzF. This can simply be a zip with a well known extension and layout (including assemblies).
I like the idea of requiring the user to package Az module rather than having it in our worker image to resolve the versioning problem.