{"id":23633252,"url":"https://github.com/food-x-technologies/puff-example","last_synced_at":"2026-04-14T00:04:38.225Z","repository":{"id":41165674,"uuid":"306908714","full_name":"Food-X-Technologies/puff-example","owner":"Food-X-Technologies","description":"Information about the Puff tool. use cases; examples; etc.","archived":false,"fork":false,"pushed_at":"2020-11-04T19:41:47.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-28T04:49:27.905Z","etag":null,"topics":["azure","azure-devops","azure-pipelines","example","infrastructure","json","puff","region","subscriptions","yaml"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Food-X-Technologies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-24T15:06:21.000Z","updated_at":"2023-12-12T08:40:35.000Z","dependencies_parsed_at":"2022-07-25T21:32:17.046Z","dependency_job_id":null,"html_url":"https://github.com/Food-X-Technologies/puff-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Food-X-Technologies%2Fpuff-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Food-X-Technologies%2Fpuff-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Food-X-Technologies%2Fpuff-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Food-X-Technologies%2Fpuff-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Food-X-Technologies","download_url":"https://codeload.github.com/Food-X-Technologies/puff-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239560686,"owners_count":19659293,"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":["azure","azure-devops","azure-pipelines","example","infrastructure","json","puff","region","subscriptions","yaml"],"created_at":"2024-12-28T04:49:39.243Z","updated_at":"2025-11-08T20:30:23.036Z","avatar_url":"https://github.com/Food-X-Technologies.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Information about Puff(ing)\nAt FoodX we have been releasing a lot of software, and this requires the infrastructure of our services to be maintained across many (12+) environments. We use [Azure DevOps](https://dev.azure.com) as our CI/CD; and have found that (especially) in infrastructure deployments it is best to not leverage variables in release pipelines; so we push them into git. That way we can view a single source of truth, without contamination from a secondary source.\n\nPuff enables this, by making management of the parameters per environment land in a single yaml file. Secondly, (by design) you can review a change that could affect all environments, or changes that affect a select number of environments in a single file. Which takes cognitive load off of pull requests, that could have a disastrous effect (yes, I have 'deleted' a cosmos database in production).\n\nLet us all agree infrastructure is only there to serve the purpose; so anything we can do to reduce the problem is valued. Making it easy, and with less error helps improve availability; and those guilty oh-sshhhh moments.\n\nAlso note worthy, is that we use [Jest](https://www.npmjs.com/package/jest) to unit test our parameters files, so that we can ensure changes are noted by people developing new services. Using JavaScript to test json, makes a lot of sense; and is the reason why puff ended up being a Node.js runtime.\n\n# Basics\nWe have a couple main things that contain our services across environments:\n\n## Name\nThe name is the prefix used in the file generation, it does not end up inside the template.\n\n## Default\nValues that are set in all templates through all environments and services, this is defined at the top of the template along with the name. The can be over-loaded in further definitions of the service or environment.\n\n## Environments\nOur approach is to have an environment map to an [Azure Subscription](https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/create-subscription). We use subscriptions to ensure that we maintain appropriate security controls. Given that, we deploy into Dev/Test/Staging/Production Secondary/Production Primary in that sequence; to enure validity of every change we make, for infrastructure and applications.\n\n## Regions\nRegion is important for us, as we deploy multiple regions per environment for active/active services; things like functions, we want to have workers running off of the [Azure Service Bus](https://azure.microsoft.com/en-us/services/service-bus/); across paired regions. Region can be specified as region (singular); or regions with a list (as multiple).\n\n# Get Started\nConvert yaml into Azure ARM parameters templates (json).\n- On GitHub: [puff](https://github.com/Food-X-Technologies/puff).\n- On NPM: [puff](https://www.npmjs.com/package/@foodx/puff).\n\n## Clone\n```\ngit clone git@github.com:Food-X-Technologies/puff-example.git\n```\n## NPM\n### Install\n```\nnpm i\n```\n### Puff\nGenerate json parameters files, based on yaml file.\n```\nnpm run puff\n```\n### Delete\nDelete generated files, keep your git clean!\n```\nnpm run puffin\n```\n\n# Examples\n- [Azure Functions](https://github.com/Food-X-Technologies/puff-example/tree/main/function)\n- [Azure Storage Accounts](https://github.com/Food-X-Technologies/puff-example/tree/main/storage-account)\n\n## [Input (yaml)](https://github.com/Food-X-Technologies/puff-example/blob/main/example-simple/example.yml)\n```\nname: ex-\nkey1: value1default\nkey2: value2default\nenvironments:\n  one:\n    key3: value2one\n    regions:\n    - abc:\n        key1: value1abc\n  two:\n    key4: value4two\n    region: xyz\nservices:\n  service1:\n    region: abc\n    key2: value2xyz\n```\n\n## Outputs (json)\n### 1. [ex-service1.one.abc.json](https://github.com/Food-X-Technologies/puff-example/blob/main/example-simple/ex-service1.one.abc.json)\n```\n{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#\",\n \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {\n  \"key1\": {\n   \"value\": \"value1abc\"\n  },\n  \"key2\": {\n   \"value\": \"value2default\"\n  },\n  \"region\": {\n   \"value\": \"abc\"\n  },\n  \"key3\": {\n   \"value\": \"value2one\"\n  }\n }\n}\n```\n### 2. [ex-service1.two.xyz.json](https://github.com/Food-X-Technologies/puff-example/blob/main/example-simple/ex-service1.two.xyz.json)\n```\n{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#\",\n \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {\n  \"key1\": {\n   \"value\": \"value1default\"\n  },\n  \"key2\": {\n   \"value\": \"value2default\"\n  },\n  \"region\": {\n   \"value\": \"xyz\"\n  },\n  \"key4\": {\n   \"value\": \"value4two\"\n  }\n }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffood-x-technologies%2Fpuff-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffood-x-technologies%2Fpuff-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffood-x-technologies%2Fpuff-example/lists"}