/README.md
Markdown | 48 lines | 34 code | 14 blank | 0 comment | 0 complexity | ebcb3365dbcea28ffc71c06079b7a3f4 MD5 | raw file
- # Azure Functions Templates
- This repository contains the templates used by the [Azure Functions Portal](https://functions.azure.com/signin). Templates are pre-defined functions that demonstrate a working scenario and could be used as a starting point for more complex ones.
- ## Template Format
- A template requires specific metadata files and folder structure so that [Azure Functions Portal](https://functions.azure.com/signin) can understand and graphically present it. Please find more information on individual files and their contents below.
- - **Binding.json:** This is a metadata file for all the bindings and their possible configuration settings. It is common across all templates and is located [here](Bindings/bindings.json). It also contains metadata for binding related UI Elements and the corresponding text.
- - **Function.json:** This file contains binding data specific to each template. It provides valid values for the possible settings on a binding.
- - **Code file:** Code file holds the actual code executed by the template. The name of the file depends on the Target language used by the template. For all the languages, the file name is `run`, followed by the file extension specific to the language. Additionally Javascript also supports `index.js` as the name of the code file.
- - **Metadata.json:** UI related metadata specific to each template is present here. For e.g. Template Name, category.
- - **Sample.dat:** Sample.dat contains sample input data for each template. The Run text box in the portal will be populated by the contents of the sample.dat file. The contents of this file is also used as input by the [test script](Test/TemplateTest.ps1). Refer the [Running Tests](#running-tests) section for more information on testing templates.
- - **Readme.md (optional):** The markdown file that presents basic information and description of the templates.
- ## Testing templates
- ### Testing via Azure Functions Portal
- 1. Download and install fiddler from [https://www.telerik.com/download/fiddler](https://www.telerik.com/download/fiddler).
- 2. Download zip file with portal script from [here](http://go.microsoft.com/fwlink/?LinkID=786554&clcid=0x409).
- 3. Extract the contents of the zip file.
- 4. Execute the following command in PowerShell from the root of the templates repository.</br>
- `createTemplateJson.ps1 -templatesFolderPath .\Templates\`
- 5. Open Fiddler -> AutoResponder, Click Import -> Select templates.farx file from the extracted zipfile.
- 6. Select the rule ending with bindingconfig, Go to Rule Editor in the bottom -> Click on the empty drop down -> Select find a file.
- 7. Select bindings.json from Templates repo.
- 8. Select the rule ending with templates, Go to Rule Editor in the bottom -> Click on the empty drop down -> Select find a file.
- 9. Select templates.json generated by the script createTemplateJson.ps1.
- 10. Make sure the checkboxes `Enable rules` and `Unmatched requests passthrough` are checked.
- 11. Your template changes should appear in the [portal](https://functions.azure.com/signin).
- ## License
- This project is under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/) and is licensed under [the MIT License](LICENSE.txt)
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
- ## Related Github Repositories
- - [Azure Functions Portal](https://github.com/projectkudu/AzureFunctionsPortal)
- - [WebJobs Script SDK](https://github.com/Azure/azure-webjobs-sdk-script/)
- - [WebJobs SDK Extensions](https://github.com/Azure/azure-webjobs-sdk-extensions)
- ## Contribute Code or Provide Feedback
- If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.com/guidelines.html).
- If you encounter any bugs with the templates please file an issue in the [Issues](https://github.com/Azure/azure-webjobs-sdk-templates/issues) section of the project.