Files
linearvoid/docs/infrastructure/cloudflare/cloudflare-account-troubleshooting.md
T
zwitschi 9e56ff7859
CI / test (push) Successful in 2m55s
CI / docker (push) Successful in 46s
feat(ops): replace Cloudflare Pages with Workers for frontend hosting
2026-08-16 08:17:23 +02:00

1.2 KiB

Cloudflare Account Troubleshooting

Reference for Cloudflare account and API token troubleshooting.

Use wrangler whoami to verify the account ID and API token are valid, or query the Workers API at https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/workers/scripts.

Validate Cloudflare account and API token

# Validate Cloudflare account and API token in .env
Set-Location -Path "E:\Documents\02-Projects\07-Mentoring\Corey\linearvoid"
Get-Content .env | Select-String 'CLOUDFLARE_API_TOKEN'
Get-Content .env | Select-String 'CLOUDFLARE_ACCOUNT_ID'

# Test API token with wrangler
npx wrangler whoami

# Or verify with the Workers API directly
$env:CLOUDFLARE_API_TOKEN = (Get-Content .env | Select-String 'CLOUDFLARE_API_TOKEN' | ForEach-Object { $_.Line.Split('=')[1].Trim() })
$env:CLOUDFLARE_ACCOUNT_ID = (Get-Content .env | Select-String 'CLOUDFLARE_ACCOUNT_ID' | ForEach-Object { $_.Line.Split('=')[1].Trim() })

# List all Workers for the account
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$env:CLOUDFLARE_ACCOUNT_ID/workers/scripts" -H "Authorization: Bearer $env:CLOUDFLARE_API_TOKEN" -H "Content-Type: application/json"