{"id":28274773,"url":"https://github.com/heaths/go-dotazure","last_synced_at":"2025-06-16T08:30:59.690Z","repository":{"id":291730764,"uuid":"977872211","full_name":"heaths/go-dotazure","owner":"heaths","description":"Load environment variables from Azure Developer CLI environment","archived":false,"fork":false,"pushed_at":"2025-05-07T22:11:49.000Z","size":17,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-21T02:14:00.395Z","etag":null,"topics":["azd","azure-dev","dotenv"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heaths.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-05T05:27:58.000Z","updated_at":"2025-05-07T21:55:43.000Z","dependencies_parsed_at":"2025-05-06T09:33:48.478Z","dependency_job_id":null,"html_url":"https://github.com/heaths/go-dotazure","commit_stats":null,"previous_names":["heaths/go-dotazure"],"tags_count":2,"template":false,"template_full_name":"heaths/template-golang","purl":"pkg:github/heaths/go-dotazure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fgo-dotazure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fgo-dotazure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fgo-dotazure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fgo-dotazure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heaths","download_url":"https://codeload.github.com/heaths/go-dotazure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fgo-dotazure/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260126143,"owners_count":22962591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azd","azure-dev","dotenv"],"created_at":"2025-05-21T02:13:14.330Z","updated_at":"2025-06-16T08:30:59.685Z","avatar_url":"https://github.com/heaths.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dotazure\n\n[![releases](https://img.shields.io/github/v/release/heaths/go-dotazure.svg?logo=github)](https://github.com/heaths/go-dotazure/releases/latest)\n[![reference](https://pkg.go.dev/badge/github.com/heaths/go-dotazure.svg)](https://pkg.go.dev/github.com/heaths/go-dotazure)\n[![ci](https://github.com/heaths/go-dotazure/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/heaths/go-dotazure/actions/workflows/ci.yml)\n\nLocate and load environment variables defined when provisioning an [Azure Developer CLI] project.\n\n## Getting Started\n\nIf you do not already have an [Azure Developer CLI] (azd) project, you can create one:\n\n```sh\nazd init\n```\n\nAfter you define some resources e.g., an [Azure Key Vault](https://github.com/heaths/go-dotazure/blob/main/infra/resources.bicep),\nyou can provision those resources which will create a `.env` file with any `output` parameters:\n\n```sh\nazd up\n```\n\n## Example\n\nAfter `azd up` provisions resources and creates a `.env` file, you can call `Load()` to load those environment variables\nfrom the default environment e.g.,\n\n```go\npackage main\n\nimport (\n    \"errors\"\n    \"fmt\"\n    \"os\"\n\n    \"github.com/heaths/go-dotazure\"\n)\n\nfunc main() {\n    if loaded, err := dotazure.Load(); err != nil {\n        panic(err)\n    } else if loaded {\n        fmt.Fprintln(os.Stderr, \"loaded environment variables\")\n    }\n\n    // Assumes bicep contains e.g.\n    //\n    // output AZURE_KEYVAULT_URL string = kv.properties.vaultUri\n    vaultURL, _ := os.LookupEnv(\"AZURE_KEYVAULT_URL\")\n    fmt.Printf(\"AZURE_KEYVAULT_URL=%q\\n\", vaultURL)\n}\n```\n\nIf you want to customize behavior, you can call `Load()` with various `With*` option functions.\n\n## License\n\nLicensed under the [MIT](https://github.com/heaths/go-dotazure/blob/refactor/LICENSE.txt) license.\n\n[Azure Developer CLI]: https://aka.ms/azd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheaths%2Fgo-dotazure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheaths%2Fgo-dotazure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheaths%2Fgo-dotazure/lists"}