dotazure

Crates.iodotazure
lib.rsdotazure
version
sourcesrc
created_at2025-05-04 07:47:23.344146+00
updated_at2025-05-08 01:06:01.774593+00
descriptionLocate and load environment variables defined when provisioning an Azure Developer CLI project.
homepage
repositoryhttps://github.com/heaths/dotazure-rs
max_upload_size
id1659417
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Heath Stewart (heaths)

documentation

README

Dotazure

releases docs ci

Locate and load environment variables defined when provisioning an Azure Developer CLI project.

Getting Started

If you do not already have an Azure Developer CLI (azd) project, you can create one:

azd init

After you define some resources e.g., an Azure Key Vault, you can provision those resources which will create a .env file with any output parameters:

azd up

Example

After azd up provisions resources and creates a .env file, you can call load() to load those environment variables from the default environment e.g.,

fn main() {
    dotazure::load().unwrap();

    // Assumes bicep contains e.g.
    //
    // output AZURE_KEYVAULT_URL string = kv.properties.vaultUri
    println!(
        "AZURE_KEYVAULT_URL={}",
        std::env::var("AZURE_KEYVAULT_URL").unwrap(),
    );
}

If you want to customize behavior, you can call dotazure::loader() to get a builder-like object.

License

Licensed under the MIT license.

Commit count: 0

cargo fmt