What happened to CF_ZONE_ID in Wrangler 3?

I see with current Wrangler documentation a mention of 'Zone ID route' (https://developers.cloudflare.com/workers/wrangler/configuration/#zone-id-route) in the config file, but, for security reasons, we don't want the information stored in flat files in any case. I see here (https://developers.cloudflare.com/workers/wrangler/system-environment-variables/#supported-environment-variables) that dynamically defining CLOUDFLARE_ACCOUNT_ID & CLOUDFLARE_API_TOKEN appear to be the go-forward environment variables to use with wrangler deploy, but, I don't see in the documentation any mention of CF_ZONE_ID or a new CLOUDFLARE_ZONE_ID being supported. Is it? Or, is there some other thing that should be done instead? Please advise.
System Environment Variables · Cloudflare Workers docs
System Environment Variables are local environment variables that can change Wrangler’s behavior. There are three ways to set System Environment …
Configuration · Cloudflare Workers docs
Wrangler optionally uses a wrangler.toml configuration file to customize the development and publishing setup for a Worker.
3 Replies
Peter Belbin
Peter BelbinOP•2y ago
CF_ZONE_ID being provided as an environment variable was supported in the past as evidenced here https://github.com/cloudflare/wrangler-legacy/issues/985
GitHub
Allow setting account and zone id in environment variable · Issue #...
💡 Feature request Overview and problem statement Similar to CF_API_TOKEN it would be great if account and zone id could be set as environment variable instead of putting them into the config file. ...
Chaika
Chaika•2y ago
Looks like it never got carried over to Wrangler 2.x or 3.x. Not too surprising, 2.x was a complete rewrite in Javascript rather then Rust. For what it's worth, Zone ID, Account ID and most other IDs, are not "secrets" in any way. They're purely random and perfectly ok to be shared/made public/etc. You can use zone_name with route bindings as well
Peter Belbin
Peter BelbinOP•2y ago
Thank you for the response, even if the result seems disappointing. Yeah, I pulled code for the 1.x Wrangler, and see the Zone ID there, and did likewise for 3.x and 2.x code, but do not see the Zone ID in either the 2.x or 3.x code. 😦. Is it possible that this means the desired result can be obtained without needing to specifiy the Zone ID (or name for that matter)? Hmmm. Perhaps. But if not, then yeah, that's a hassle.
Want results from more Discord servers?
Add your server