Forge app upgrade issue

Hello,

I am using a function that needs to run on install event and on upgrade,
I noticed yesterday that after deploying a new version on production, that the log in my function is not showing,

here is the config in my manifest yml

- key: init-storage-on-install
  function: initStorageOnInstall

  events:

    - avi:forge:installed:app

    - avi:forge:upgraded:app

function:

- key: initStorageOnInstall

  handler: resolvers/adminResolvers.initStorageOnInstall

please tell me what I am missing,

kind regards,

Hi @AliSalem1,

What you are missing is that avi:forge:upgraded:app does not behave like a “run on every deploy” event.

Forge creates either major or minor versions depending on the type of change. Minor versions are rolled out automatically, while major versions require admin approval before the upgrade is applied:

So in practice, if you only deployed a code-only change, not seeing this event is expected.

Typically, this event becomes relevant when the upgrade requires admin consent. For example, changes like new scopes or egress rules usually result in a major version upgrade.

If you need migration logic for regular deployments, I would recommend handling it in your app logic itself, for example by storing a schema/app version in KVS and running the migration once when the app detects an older version.

2 Likes