
Hi, I have self-hosted Appwrite v1.7.4 and the latest Appwrite CLI. I cannot get the "variables" in the appwrite.json to deploy. I am using this format:
"path": "functions/my-node-function",
"variables": {
"API_KEY": "your-secret-api-key",
"DATABASE_URL": "your-database-connection-string",
"NODE_ENV": "production"
}
So, yes, specifying the variables as an object and not an array. Everything else from the appwrite.json deploys fine.
I have seen that this was previously a bug reported by others. Has the bug been reintroduced?
I am using Node.js v22.0 and JavaScript for functions (Node 22 support added in the Appwrite, self-hosted docker .env file)
As a workaround, I have set the variables in the Project Settings - Global variables, which then apply to all functions, but I would like to set these granularly per function on initial deployment (without subsequently applying variables with the CLI and needing another deployment to apply them).
Have I missed anything by chance?

I don't think this is how variables should be deployed? Looking here in the docs it's far different.
https://appwrite.io/docs/tooling/command-line/functions#appwritejson

Thanks, I missed that as I was looking in the docs under functions and older support posts. I'll give that format a try.

As of 8.2.1, vars in the appwrite.json are no longer supported
Recommended threads
- Failed sending to target forbidden error
// Send test email using the specific target ID await messaging.createEmail( 'unique()', // messageId 'Test Email, // subject ...
- Not getting any mail in self hosted whil...
Mail is not working when inviting members to join the org
- SignUp with Apple failed
Hi, I tried to implement the Sign-In-With-Apple functionality in my iOS-App. It almost works, because appwrite is already creating the user, but on the client-s...
