Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
388 stars 178 forks source link

Service hook `predeploy` does not work for appcontainer #3546

Open vhvb1989 opened 3 months ago

vhvb1989 commented 3 months ago

For example:

services:
  web:
    project: ./src/web
    language: js
    host: containerapp
    hooks:
         predeploy:
          posix:
            shell: sh
            run: 'echo aaaa && sleep 50'    

runing azd deploy web starts building dockerfile immediately, ignoring the hook.

Note: prepackage hook is also ignored.

wbreza commented 3 months ago

The predeploy hook runs after service packaging and is not expected to run before the docker build. If there is a requirement to run a hook before docker build you can use the undocumented prebuild hook.

The lifetime events of the service are as follows: