๐Ÿ“ฆ heaths / functions-quickstart-rust-azd

๐Ÿ“„ build.rs ยท 22 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22use std::{fs, path::Path};

fn main() {
    // Create initial local.settings.json - which should not be committed - to support local hosting.
    let path = Path::new("local.settings.json");
    if !path.exists() {
        fs::write(
            path,
            r#"{
  "IsEncrypted": false,
  "Values": {
    "AzureFunctionsJobHost__customHandler__description__defaultExecutablePath": "target/debug/handler",
    "AzureWebJobsStorage": "",
    "FUNCTIONS_WORKER_RUNTIME": "custom"
  }
}
"#,
        )
        .expect("write local.settings.json");
    }
}