PageRenderTime 2ms CodeModel.GetById 85ms RepoModel.GetById 1ms app.codeStats 0ms

Markdown | 48 lines | 34 code | 14 blank | 0 comment | 0 complexity | ebcb3365dbcea28ffc71c06079b7a3f4 MD5 | raw file
  1. # Azure Functions Templates
  2. This repository contains the templates used by the [Azure Functions Portal]( Templates are pre-defined functions that demonstrate a working scenario and could be used as a starting point for more complex ones.
  3. ## Template Format
  4. A template requires specific metadata files and folder structure so that [Azure Functions Portal]( can understand and graphically present it. Please find more information on individual files and their contents below.
  5. - **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.
  6. - **Function.json:** This file contains binding data specific to each template. It provides valid values for the possible settings on a binding.
  7. - **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.
  8. - **Metadata.json:** UI related metadata specific to each template is present here. For e.g. Template Name, category.
  9. - **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.
  10. - ** (optional):** The markdown file that presents basic information and description of the templates.
  11. ## Testing templates
  12. ### Testing via Azure Functions Portal
  13. 1. Download and install fiddler from [](
  14. 2. Download zip file with portal script from [here](
  15. 3. Extract the contents of the zip file.
  16. 4. Execute the following command in PowerShell from the root of the templates repository.</br>
  17. `createTemplateJson.ps1 -templatesFolderPath .\Templates\`
  18. 5. Open Fiddler -> AutoResponder, Click Import -> Select templates.farx file from the extracted zipfile.
  19. 6. Select the rule ending with bindingconfig, Go to Rule Editor in the bottom -> Click on the empty drop down -> Select find a file.
  20. 7. Select bindings.json from Templates repo.
  21. 8. Select the rule ending with templates, Go to Rule Editor in the bottom -> Click on the empty drop down -> Select find a file.
  22. 9. Select templates.json generated by the script createTemplateJson.ps1.
  23. 10. Make sure the checkboxes `Enable rules` and `Unmatched requests passthrough` are checked.
  24. 11. Your template changes should appear in the [portal](
  25. ## License
  26. This project is under the benevolent umbrella of the [.NET Foundation]( and is licensed under [the MIT License](LICENSE.txt)
  27. This project has adopted the [Microsoft Open Source Code of Conduct]( For more information see the [Code of Conduct FAQ]( or contact []( with any additional questions or comments.
  28. ## Related Github Repositories
  29. - [Azure Functions Portal](
  30. - [WebJobs Script SDK](
  31. - [WebJobs SDK Extensions](
  32. ## Contribute Code or Provide Feedback
  33. If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](
  34. If you encounter any bugs with the templates please file an issue in the [Issues]( section of the project.