Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
334 stars 103 forks source link

Creating the deployment package (BYOC) #79

Closed asavaritayal closed 6 years ago

asavaritayal commented 6 years ago

bring-your-own-container

Azure Functions lets you host your Python functions on Linux in your own custom container. You can use one of the following options to build the container:

1. Build locally

Download and customize the sample

Clone the sample app repository to your local machine, then change to the directory that contains the sample code.

git clone https://github.com/Azure/azure-functions-docker-python-sample.git
cd azure-functions-docker-sample

Build the image from the Docker file

The Dockerfile describes the environment that is required to run the function app on Linux.

To build the Docker image, run the docker build command, and provide a name mydockerimage, and a tag v1.0.0. Replace <docker-id> with your Docker Hub account ID.

docker build . --tag <docker-id>/mydockerimage:v1.0.0

Push the custom image to Docker Hub

Before you can push an image, you must sign in to Docker Hub using the docker login command. Replace <docker-id> with your account name and type in your password into the console at the prompt.

docker login --username <docker-id>

After you have signed in, you push the image to Docker Hub by using the docker push command.

docker push <docker-id>/mydockerimage:v1.0.0

Now, you can use this image as the deployment source for a new function app in Azure.

2. Build on a CI server

TBD @elprans , @1st1

Deployment Workflow

A function app hosts the execution of your functions. Create a function app from the Docker Hub image by using the az functionapp create command.

Instructions: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image#create-and-deploy-the-custom-image

asavaritayal commented 6 years ago

@1st1 @elprans