Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 44 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Considerations

The functions run in **Serverless Framework** and use **Windows** like OS.
The functions run in **Serverless Framework** and use **Linux** like OS to run functions.

## Install

Expand All @@ -22,24 +22,63 @@ Check Install
serverless -v
```

Install azure plugin
Install azure plugins

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is necessary a specific version of node to install this plugins?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, Only Nodejs should be 10, is due to azure cli compatibility


```bash
serverless plugin install --name serverless-azure-functions
```


In case that you have **make** installed in your computer you can use

```bash
serverless plugin install --name serverless-azure-functions
make install-serverless-plugins
```

Install Azure CLI
## Azure Account

### Install Azure CLI

[More Information](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)

```bash
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
```

Login
### Login

```bash
az login
```

## NodeJs Functions

### Create new function
Go to *nodejs-functions/*, to add a new function, you need create a new directory in *src/handlers/*, inside of directory you need create a **index.js** file

And how last step you need add reference to this function in **serverless.yml**, check the azure serverless documentation [here](https://www.serverless.com/framework/docs/providers/azure/guide/intro/) for more information.

### Add Third Parties Dependencies
Add *package.json* with the modules that you need inside of function directory. Then add the follow line in **Makefile** inside of *nodejs-functions/*:

```bash
install-dependencies-nodejs:
cd src/handlers/automatic-clock-outs ; pwd ; $(MAKE) install
cd src/handlers/my-awesome-function ; pwd ; $(MAKE) install ## add function path. Dont forget use tabs

```


## Python Functions

Go to *python-functions/*, to add a new function, you need create a new directory in *src/handlers/*, inside of directory you need create a _ _ init _ _.py file

And how last step you need add reference to this function in **serverless.yml**, check the azure serverless documentation [here](https://www.serverless.com/framework/docs/providers/azure/guide/intro/) for more information.


## Ops Work
In case that you need:
- Add a new Environment Variable
- Create some function with third parties dependencies
- Error in Pipeline
- Some Question :)