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
- Github connection error - Self Hosted Ap...
I am trying to connect my github account to deploy a project to sites, but Connect to Gtihub button is disabled. I have configured all Env variables needed for...
- "Domain verification failed"
"Domain verification failed" I was install Appwrite in my VDS server. I using Coolify for install Appwrite. After install complete, i want add my domain, and i ...
- Appwrite Sites triggers builds for all p...
I connected my Appwrite Sites to my Git app on my self hosted Appwrite server, but even though I only connected it to main branch, it creates a build every sing...