Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Azure Functions for Rust
The Azure Functions for Rust crate supports creating Azure Functions with Rust.
The following Azure Functions trigger bindings are supported:
The following Azure Functions input bindings are supported:
The following Azure Functions output bindings are supported:
Eventually more bindings will be implemented, including custom binding data.
Examples
Start by creating a new binary package:
Edit Cargo.toml
to include the following dependencies:
= "0.2.1"
= "0.4.2"
Azure Functions are implemented by applying a #[func]
attribute to a Rust function.
For example, let's create src/greet.rs
that implements a HTTP triggered function:
# extern crate azure_functions;
# extern crate log;
use func;
use ;
Replace the contents of src/main.rs
with the following to register the function with
the Azure Functions Host:
extern crate log;
extern crate azure_functions;
// The main! macro generates an entrypoint for the binary
// Expects a list of Azure Functions to register with the Azure Functions host
main!
Initialize the application with the init
command, where $AzureWebJobsScriptRoot
is
the desired Azure Functions script root directory:
Run the Azure Functions Host:
The above Azure Function can be invoked with http://localhost:5000/api/greet?name=John
.
The expected response would be Hello from Rust, John!
.