npx wranger token permission for automated deployment

Hello everyone, I'm trying to deploy a Cloudflare Pages site using a Bitbucket pipeline. I've set everything up (CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN) and am running the following command:
npx --yes wrangler@latest pages deploy /dist/
npx --yes wrangler@latest pages deploy /dist/
However, I'm encountering an issue with token permissions. I'm using a token with the "Edit Cloudflare Workers" template, but it doesn't seem to have sufficient permissions for the deployment. I haven't been able to find more information on the required permissions for this process. Has anyone experienced this issue or knows what specific permissions I should be using? Any help would be greatly appreciated!
No description
10 Replies
Patiphan
PatiphanOP2mo ago
Here is the current token permission
No description
Patiphan
PatiphanOP2mo ago
Has anyone has some example permissions that works? It seems to be a bug rather than mis config?
Walshy
Walshy2mo ago
This isn't a perm issue Your account ID isn't being replaced you can see the URL is $$$$CLOUDFLARE_ACCOUNT_ID You gotta fix your variable
Patiphan
PatiphanOP2mo ago
Hello, Sorry, I missed your message, It's been picked up but was censored by Bitbucket pipeline As I was able to run whomai without problem.
Patiphan
PatiphanOP2mo ago
No description
Walshy
Walshy2mo ago
whoami doesn't use the account ID, it isn't showing $$$$CLOUDFLARE... there So are you sure it is? The only way to get the error you're getting is if the URL is wrong due to either incorrect path or incorrect values passed in
Patiphan
PatiphanOP2mo ago
Could it be that CLOUDFLARE_ACCOUNT_ID is a reserved word? Take a look at the picture, it's behaviour is very strange
No description
Walshy
Walshy2mo ago
Weird behaviour. I'd maybe ask whoever your CI provider is what's happening
Patiphan
PatiphanOP2mo ago
Found the problem. Once I saw that Bitbucket censored using single $, it clicked to me that the many $$$$$ just the way they want to indicate that your env does indeed has $ in it. My problem was that I set CLOUDFLARE_ACCOUNT_ID=$CLOUDFLARE_ACCOUNT_ID literally. It's my mistake, sorry, to bother you. And thanks for pointing out, I really does point me into the correct direction.
Walshy
Walshy2mo ago
Ah haha that'll do it
Want results from more Discord servers?
Add your server