I am currently publishing my deployment on Cloudflare pages via wrangler CLI. Its working fine… i am able to successfully deploy project on CF Pages. Wrangler CLI command that i use for this is:
CLOUDFLARE_API_TOKEN=apitoken wrangler pages publish ./project --project-name=project --branch=production
Now, an authentication error showed up when i try to publish the same project on different Cloudflare account. Just a different account. When i try to publish, it throws an authentication error. Having a look at the logs, i found that wrangler tries to call the Cloudflare API with previous account id. but i also explicitly provide the new account id in the wrangler command like this:
CLOUDFLARE_ACCOUNT_ID=account-id CLOUDFLARE_API_TOKEN=apitoken wrangler pages publish ./project --project-name=project --branch=production
But it throws an authentication error. I will appreciate if you guys can help.