Good afternoon, I'm trying to setup infracost bot...
# help
a
Good afternoon, I'm trying to setup infracost both within my IDE (VS Code) as well as for a comment within my PRs. Locally I run Windows, VSCode. Our git repos are in Azure DevOps and we use Azure Pipelines. For now I'm only interested in running infracost as the free plan. We are starting up to use Azure, but our costs are not very high yet, but they are expected to rise in the future so we're implementing basic finops measures, which could be extended later on. The terraform projects I'm running are using both modules from the repository as well as from AVM (so online). Not detecting projects In the root of my project I have statically defined my projects like this:
Copy code
version: 0.1
projects:
  - path: terraform/apps/conn
    name: conn
    terraform_var_files:
      - env/con-production.tfvars
  - path: terraform/apps/kko
    name: kko-startup
    terraform_var_files:
      - env/kko-startup.tfvars
  - path: terraform/apps/mgt
    name: mgt
    terraform_var_files:
      - env/mgt-production.tfvars
  - path: terraform/apps/szg
    name: szg-startup
    terraform_var_files:
      - env/szg-startup.tfvars
It looks like they are recognized during the scan, but not during the PR comment. In the PR comment I see a table with the projects like this: Changed project - Module path DevOpsOrg/DevOpsProject/Azure - terraform/apps/kko DevOpsOrg/DevOpsProject/Azure - terraform/apps/szg DevOpsOrg/DevOpsProject/Azure-production - terraform/apps/mgt DevOpsOrg/DevOpsProject/Azure/terraform/apps/kko - terraform/apps/kko DevOpsOrg/DevOpsProject/Azure/terraform/apps/mgt-production - terraform/apps/mgt DevOpsOrg/DevOpsProject/Azure/terraform/apps/szg - terraform/apps/szg The costs are being moved around, maybe that is because this is the first run, but it looks like the projects are being autodetected, which I also see in the output of the tasks: 2026-08-18T092928Z INFO Autodetected 4 Terraform projects across 4 root modules - Local scan in VS Code does not work When I run infracost scan locally all projects either error out with the error below, or the scan runs for hours and never finishes: 2026-08-18 110910.674 [error] time=2026-08-18T110910.671+02:00 level=ERROR msg="analyzeFullScan: project scan failed" name=szg-startup error="parsing: rpc error: code = DeadlineExceeded desc = context deadline exceeded" elapsed=1m0.3333715s In the meantime, the extension says it's scanning the workspace, which does not end. It just keeps on scanning without any output or error message. I've ran Infracost doctor: Infracost Doctor 2.16.2 - running 7 checks Authentication ✔️ Credentials found ✔️ Token valid ✔️ Organization accessible "hagaziekenhuis" ✔️ API reachable (385 ms) CLI ✔️ Version 2.16.2 (latest) Configuration ✔️ Config file valid ✔️ Default org set (hagaziekenhuis) ✔️ 7 passed An I've also cleaned up the cache: infracost cache clear ✓ Cache cleared. After clearing the cache, when running command below I get popups for GitHub, even though this is Azure Repos: infracost breakdown --path=. --format=json --out-file=./breakdown.json !
infracost breakdown
is deprecated, running
infracost scan
instead. ✔️ Plugins up to date ⡿ Scanning... ⣾ Scanning... ⣾ Scanning... ⣾ Scanning... ⢿ Scanning... - I also get messages in vscode that the ls has a new version, but when trying an update it says: 2026-08-18 115659.269 [error] time=2026-08-18T115659.268+02:00 level=ERROR msg="method error" method=infracost/update duration=1.0762821s error="replacing binary: rename C:\\Users\\sjoer\\.vscode\\extensions\\infracost.infracost-0.4.17-win32-x64\\bin\\.infracost-ls-update-1706734103 C\\Users\\sjoer\\.vscode\\extensions\\infracost.infracost 0.4.17 win32 x64\\bin\\infracost ls.exe Access is denied." - And a final additional question, is the cli within vscode included in the free edition? Because I don't see anything about that on the pricing page.
w
@adventurous-nail-5992 any ideas re the vscode issue? @astonishing-morning-76605 yes the CLI within the vscode is part of the free edition, though after the trial period only the cost estimates work (i.e. tagging policies, guardrails, finops policies will not show-up in vscode as those are part of the paid product)
a
@white-airport-8778, thank you, that is all that I want (for now), if I can get it working.
b
@astonishing-morning-76605 how have you setup the pipeline on ADO? Can you try explicitly pointing to the config file using the
--config-file
flag?
the timeout/hanging for hours has me wondering if it's running into a problem importing a module. Are there any modules that point to private repositories? Is there possibly a git credential manager dialog/popup hidden somewhere behind an open window?
If possible, adding the azure repos app in infracost cloud is the simplest way to get the PRs working.
a
@brash-barista-9591, when I do the config file flag it says unknown flag:
Copy code
infracost scan --config-file infracost.yml
Info: unknown flag: --config-file

infracost --version
infracost version 2.16.2
Note that I'm on Windows in a powershell. > Are there any modules that point to private repositories? No, we only use modules from AVM and modules that are in the repo itself, under terraform/modules > Is there possibly a git credential manager dialog/popup hidden somewhere behind an open window? Not as far as I could tell, after days of trying I think I should have seen that. > If possible, adding the azure repos app in infracost cloud is the simplest way to get the PRs working. Actually I did install that. When in the dashboard I go to repos I still only see the auto-detected projects, not the defined projects from my static file. Note that the PRs are working technically, it's just not seeing the projects correctly, making it look weird. My biggest issues is that: • the projects are not detected correctly and that the static file is not being recognized/picked up. • infracost is not working locally in my vscode