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.
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.
-
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. 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 supportsindex.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.
- Download and extract contents of Template tools zip file.
- Execute the following command from the root of the folder containing the extracted files.
CreateTemplateConfig.exe <TemplateRepositoryRootPath>
- The tool will generate the following files.
- templates.json
- bindings.json
- Open https://functions.azure.com in chrome and login with your credentials.
- Open developer Tools (F12) -> Application -> Local Storage
- Expand
Local Storage
and select https://functions.azure.com - Create a new key
dev-bindings
and copy contents ofbindings.json
in the value column. - Create a new key
dev-templates
and copy contents oftemplates.json
in the value column. - Refresh the portal page to reflect your template/binding changes.
This project is under the benevolent umbrella of the .NET Foundation and is licensed under the MIT License
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines. If you encounter any bugs with the templates please file an issue in the Issues section of the project.