๐Ÿ“ฆ heaths / dotazure-rs

Load environment variables from Azure Developer CLI environment

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ MIT License
azdazure-devdotenv
๐Ÿ“ฅ Clone https://github.com/heaths/dotazure-rs.git
HTTPS git clone https://github.com/heaths/dotazure-rs.git
SSH git clone git@github.com:heaths/dotazure-rs.git
CLI gh repo clone heaths/dotazure-rs
Heath Stewart Heath Stewart Use AzureDeveloperCliCredential for example (#6) 21c7a54 4 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .devcontainer
๐Ÿ“ .github
๐Ÿ“ .helix
๐Ÿ“ .vscode
๐Ÿ“ examples
๐Ÿ“ infra
๐Ÿ“ src
๐Ÿ“„ .cspell.json
๐Ÿ“„ .editorconfig
๐Ÿ“„ .gitattributes
๐Ÿ“„ .gitignore
๐Ÿ“„ .taplo.toml
๐Ÿ“„ azure.yaml
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ LICENSE.txt
๐Ÿ“„ README.md
๐Ÿ“„ README.md

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 project, you can create one:

azd init

Add dotazure to your project:

cargo add dotazure

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.,

``rust no_run 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.