Netlify cli replaces toml file on deploy

Hi, when I deploy from my local machine like this:
netlify deploy --dir=.\dist\pwa --prod

Everything works great, my netlify.toml file is uploaded and processed just fine.

However, in Azure Devops, when I call deploy from there, the contents of the netlify.toml is written with some default values. See it here …
NEWUSER://app.netlify.com/sites/localeventbuzz/deploys/67dc764914483104fe3ab77c

I have setup the netlify cli task and that writes this to the log:
2025-03-20T20:10:44.9946308Z [command]
C:\Windows\system32\cmd.exe /D /S /C “C:\npm\prefix\netlify.cmd deploy “–auth=XXXXXX” “–site=c209c498-4c00-4d8f-bd72-d0f5f97ac46d” “–dir=D:\a\r1\a\drop\drop\pwa” --prod “–message=Deployed from Azure DevOps - LocalEventBuzz.Quasar” “–functions=D:\a\r1\a” --json”

All the files get deployed but the .toml file contains empty settings like this:
plugins =
headers =
redirects =

[functions]

[functions.“*”]

[build]

[build.environment]

[build.processing]

[build.processing.css]

[build.processing.html]

[build.processing.images]

[build.processing.js]

[build.services]

The file that I am sending in looks like this:
[build]
base = “/”

[[headers]]
for = “/index.html”
[headers.values]
cache-control = ‘’’
max-age=0,
no-cache,
no-store,
must-revalidate’‘’

[[headers]]
for = “/sw.js”
[headers.values]
cache-control = “no-cache”

Redirect all http to NEWUSER

[[redirects]]
from = “http://localeventbuzz.com/*”
to = “NEWUSER://localeventbuzz.com/:splat”
status = 200
force = true

Send home page to the tenants page

[[redirects]]
from = “http://localeventbuzz.com/
to = “NEWUSER://indymicro-production-as.azurewebsites.net/engine/cms/”
status = 200
force = true
headers = {X-IndyMicro-Tenant = “localeventbuzz”}

Send home page to the tenants page

[[redirects]]
from = “NEWUSER://localeventbuzz-dev.netlify.app/”
to = “NEWUSER://indymicro-host-dev-as.azurewebsites.net/engine/cms/”
status = 200
force = true
headers = {X-IndyMicro-Tenant = “localeventbuzz”}

Send backend cms pages to Azure

[[redirects]]
from = “NEWUSER://localeventbuzz.com/cms/*”
to = “NEWUSER://indymicro-production-as.azurewebsites.net/engine/cms/:splat”
status = 200
force = true
headers = {X-IndyMicro-Tenant = “localeventbuzz”}

[[redirects]]
from = “NEWUSER://localeventbuzz-dev.netlify.app/cms/*”
to = “NEWUSER://indymicro-host-dev-as.azurewebsites.net/engine/cms/:splat”
status = 200
force = true
headers = {X-IndyMicro-Tenant = “localeventbuzz”}

[[redirects]]
from = “/sitemap.xml”
to = “/sitemap.xml”
status = 200

[[redirects]]
from = “/robots.txt”
to = “/robots.txt”
status = 200

[[redirects]]
from = “/8f2987944ce240c6a1ec0b835f7c0e70.txt”
to = “/8f2987944ce240c6a1ec0b835f7c0e70.txt”
status = 200

All app pages go the spa, use router to nav from there

[[redirects]]
from = “/*”
to = “/index.html”
status = 200


I recently switched from using _redirect and _headers files to this .toml file because I wanted to add the headers to the redirect. I feel I am close because the local deploy works.
Thanks
–Andy

(fyi, NEWUSER = https here)

Have you tried using netlify deploy --build --dir=.\dist\pwa --prod?

Hmmm the Azure devops Netlity Task sets that dir for me … can I change that? or make it cd first?

Sorry, I just meant try adding the --build flag to your command.

Soory, I’m talking about this Azure plugin that doesn’t allow that:
AzureDevOps.Extensions/Netlify/src/deploy/index.ts at dev · aliencube/AzureDevOps.Extensions

Oh, in that case that would be something to report to them to be added. Basically, the command that we expect someone to build and deploy their site is: netlify deploy --build. Any reasons why you can’t directly run the CLI and have to use that pipeline?

Yes. Besides, I don’t want to build, I’ve already done that, I just want the config file applied, which looks broken.

Workaround here is to deploy manually from a dev machine, then the toml file works.