What point are environment variables created?

I’m working on some code in a branch and have previewsEnabled, the apps/services have all been created successfully and are getting updated as I update the code in the branch.

However, If I add new variables to the render.yaml it doesn’t seem like these are being applied to the existing apps - I’ve not found anything in the docs to suggest that the render.yaml is only applied when the preview is first created.

Thanks,
John.

answering my own question(ish).

Clicking Manual Sync and then approving the new vars seems to fix things but it’s not immediately apparent that’s the best way to fix this?

However, If I add new variables to the render.yaml it doesn’t seem like these are being applied to the existing apps

Since you are using previewsEnabled, I guess you sync Render YAML with your master/main branch, and Render automatically creates a preview environment for your feature branch.
Do you add new environment variables to render.yaml in your master/main branch or feature branch? If you add it to the feature branch, new environment variables should automatically add to the service and trigger deploying.

This is an example:
After push commit to feature branch, your preview environment should automatically sync the changes

New environment variable (MY_API_KEY2 in this case) should also be added to the PR service.

SO weird, that’s what I expected would happen but it didn’t appear so and now that I retest it works like that. Thanks!

Good to hear that it works now! At the same time we will keep improving the stability of the feature.