Nodejs project working with Docker and Azure Batch.
Get the Azure Cli 2.0 or use docker run -it azuresdk/azure-cli-python
.
Set you subscription:
az login #follow the instructions
az account list
az account set --subscription <YOUR SUB ID>.
Create azure batch:
az group create --name azurebatchfunctionsrg --location eastus
az provider register -n Microsoft.Batch
az provider show -n Microsoft.Batch -o table #run a few times and wait until it says registered
az batch account create -l eastus -g azurebatchfunctionsrg -n myazurebatch
To learn about testing and debuging Azure functions locally read the docs. To get started with this project:
-
Install azure functions runtime
npm i -g azure-functions-core-tools
-
Clone the repo and cd into the folder
-
Run
npm install
-
Run
npm test
to run unit tests -
Update rename
example.settings.json
tolocal.settings.json
-
Upload docker_install_start_task.sh to a storage account.
-
Update settings in
local.settings.json
:
The following command will start the function host process in separate terminal and call the function GetPoolInfo
passing the json object as body to request. For any of the other functions replace the name (some don't need the sample data as well).
func run GetPoolInfo -f GetPoolInfo/sample.dat
func new --language JavaScript --template HttpTrigger --name NameOfFunction
Find the docs for the node.js library at http://azure.github.io/azure-sdk-for-node/azure-batch/latest/
Azure Batch has a useful (if early release) of a cross platform Batch view at https://github.com/Azure/BatchLabs. As the project is very young there are a few missing features and you have to build the project yourself.