PageRenderTime 48ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/README.md

https://gitlab.com/zhu_jie/BackupTempData
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](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.
  3. ## Template Format
  4. 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.
  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. - **Readme.md (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 [https://www.telerik.com/download/fiddler](https://www.telerik.com/download/fiddler).
  14. 2. Download zip file with portal script from [here](http://go.microsoft.com/fwlink/?LinkID=786554&clcid=0x409).
  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](https://functions.azure.com/signin).
  25. ## License
  26. This project is under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/) and is licensed under [the MIT License](LICENSE.txt)
  27. 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.
  28. ## Related Github Repositories
  29. - [Azure Functions Portal](https://github.com/projectkudu/AzureFunctionsPortal)
  30. - [WebJobs Script SDK](https://github.com/Azure/azure-webjobs-sdk-script/)
  31. - [WebJobs SDK Extensions](https://github.com/Azure/azure-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](http://azure.github.com/guidelines.html).
  34. 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.