# Serverless framework

**URL:** <https://discourse.julialang.org/t/serverless-framework/10255>\
**Category:** General Usage\
**Tags:** cloud-computing\
**Created:** [April 10, 2018, 5:15am UTC](https://discourse.julialang.org/t/serverless-framework/10255 "2018-04-10T05:15:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [April 10, 2018, 5:15am UTC](https://discourse.julialang.org/t/serverless-framework/10255/1 "2018-04-10T05:15:30Z")

</div>

Anyone thought about making Julia available on serverless framework?

[https://github.com/serverless/serverless](https://github.com/serverless/serverless)

---

<div class="post-metadata">

**Author:** ![amellnik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amellnik/32/137_2.png) [@amellnik](https://discourse.julialang.org/u/amellnik)\
**Post date:** [April 10, 2018, 3:11pm UTC](https://discourse.julialang.org/t/serverless-framework/10255/2 "2018-04-10T15:11:46Z")

</div>

There’s [GitHub - samoconnor/AWSLambda.jl: AWS Lambda interface for Julia](https://github.com/samoconnor/AWSLambda.jl) but I haven’t used it personally.

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [April 10, 2018, 4:31pm UTC](https://discourse.julialang.org/t/serverless-framework/10255/3 "2018-04-10T16:31:16Z")

</div>

Yes, I’m aware of that.

Serverless is an abstraction over any cloud, however. It would also be really nice to get Julia out there from a marketing perspective 😉

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [April 10, 2018, 7:27pm UTC](https://discourse.julialang.org/t/serverless-framework/10255/4 "2018-04-10T19:27:18Z")

</div>

It’s so weird, I was looking for _exactly_ that like 4 days ago. Yea… This would be mighty nice…

---

<div class="post-metadata">

**Author:** ![Ivan\_Serdyuk](https://avatars.discourse-cdn.com/v4/letter/i/46a35a/32.png) [@Ivan\_Serdyuk](https://discourse.julialang.org/u/Ivan_Serdyuk)\
**Post date:** [March 3, 2019, 3:49pm UTC](https://discourse.julialang.org/t/serverless-framework/10255/5 "2019-03-03T15:49:19Z")

</div>

I am assuming that OpenWhisk, Fn and OpenFaaS project might have a sub-repo, for the Julia’s template. If you are targeting something around standardization - consider this [https://cloudevents.io/](https://cloudevents.io/).

In any case: I wonder if both micro-services and serverless functions could be implemented, auto-tested and deployed during workshops, at the conf:

[https://devopsstage.com/](https://devopsstage.com/)

Ivan

---

<div class="post-metadata">

**Author:** ![anon67531922](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anon67531922](https://discourse.julialang.org/u/anon67531922)\
**Post date:** [May 6, 2019, 6:03am UTC](https://discourse.julialang.org/t/serverless-framework/10255/6 "2019-05-06T06:03:51Z")

</div>

I feel some inertia here 😊

Please vote 🙂

[https://feedback.azure.com/forums/355860-azure-functions/suggestions/37558057-julia-lang-support-for-azure-functions](https://feedback.azure.com/forums/355860-azure-functions/suggestions/37558057-julia-lang-support-for-azure-functions)

---

<div class="post-metadata">

**Author:** ![asyrov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asyrov/32/13578_2.png) [@asyrov](https://discourse.julialang.org/u/asyrov)\
**Post date:** [April 16, 2021, 8:34pm UTC](https://discourse.julialang.org/t/serverless-framework/10255/7 "2021-04-16T20:34:44Z")

</div>

Minor update: it is now possible to create custom function on azure. Though, there are no samples for julia, but only for r and go, it is possible to adapt them for julia. So, it is now possible to build azure serverless with julia.

Here is outline:

Overall process of writing custom azure function described here:  
[Working with Azure Functions in containers | Microsoft Learn](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image)?  
tabs=bash%2Cportal&pivots=programming-language-python

Here is example (prototype, proof of concept). We create custom image (based on python image, but it probably could be any, lean base image):

```julia
FROM mcr.microsoft.com/azure-functions/python:3.0-python3.9

COPY context/ .

RUN tar zxvf julia-1.6.0-linux-x86_64.tar.gz
ENV PATH="${PATH}:/julia-1.6.0/bin"
RUN julia -e "using Pkg; Pkg.add(\"Genie\")"

#EXPOSE 8080 80
ENV FUNCTIONS_WORKER_RUNTIME_VERSION=1.6

CMD ["/azure-functions-host/Microsoft.Azure.WebJobs.Script.WebHost"]

```

Now, some simple web server (server.jl):

```julia
using Genie
import Genie.Router: route
import Genie.Renderer.Json: json

const PORT = parse(Int64, get(ENV, "FUNCTIONS_CUSTOMHANDLER_PORT", "8080"))
Genie.config.run_as_server = true
Genie.config.server_port = PORT

route("/api/order") do
    (:message => "order at api") |> json
end

route("/order") do
    (:message => "just order") |> json
end
Genie.startup()

```

Config files are all default except for host.json, where we need to start julia with our server:

```julia
"customHandler": {
    "description": {
      "defaultExecutablePath": "/julia-1.6.0/bin/julia",
      "workingDirectory": "",
      "arguments": ["server.jl"]
    },
    "enableForwardingHttpRequest": true
  }

```

This is all. And here is how it looks:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/8/38cf92d0e28b6d6ffcae475f20cab2537e3e93bd.png)

---

<div class="post-metadata">

**Author:** ![Deduction42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/deduction42/32/9206_2.png) [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Post date:** [March 10, 2023, 7:29pm UTC](https://discourse.julialang.org/t/serverless-framework/10255/9 "2023-03-10T19:29:18Z")

</div>

Hello, I managed to get a couple of fairly intensive Azure Function Apps. I created a template for myself that I use to start new projects. This includes

1. An example on setting up an HTTP endpoint that forwards requests to a storage queue,
2. A PyCall powered module to access blob storage, (and a safe way to use PyCall while multithreading)
3. A proven-out path to use PackageCompiler.jl for large projects with a lot of dependencies (such as projects that depend on Flux.jl or DifferentialEquations.jl).

You can access the repo here. I hope this can help out other people trying to deploy Julia code in this manner.

> **[GitHub - Deduction42/Azure-Functions-Julia-Example: Implements an example of...](https://github.com/Deduction42/Azure-Functions-Julia-Example)**
>
> Implements an example of a custom Azure Functions handler in Julia (similar to the Go example provided by Microsoft) - GitHub - Deduction42/Azure-Functions-Julia-Example: Implements an example of a...
