azure webapp deployment from local git fails but returns exit code 0

Viewed 47

I use bitbucket pipelines to push code to an azure webapp (the webapp has "local git" setup as the deployment source).

I sometimes have the case that the bitbucket pipeline shows success even though the azure deployment failed. This seems to happen because the azure deployment returns exit code 0 even though it encountered an exception. Is there some config that allows to forward the actual exit code?

This is an example of the azure deployment log:

remote:                                                                                        
remote:   SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'reports          
remote:   _user_id_foreign'; check that column/key exists                                      
remote:                                                                                        
remote: 
remote: Script @php artisan migrate handling the post-autoload-dump event returned with error code 1        
remote: An error has occurred during web site deployment.        
remote: 
remote: Deployment Failed.        
remote: Error - Changes committed to remote repository but deployment to website failed.       
1 Answers

I think your deployment issue is tied to your SQL error you're getting. It appears that you're doing a database migration during deployment against existing data. I would suggest doing database migrations as a separate pipeline so you can have more granular control.

Also, you mentioned

the webapp has "local git" setup as the deployment source

Is there any reason why you didn't configure the deployment source as your BitBucket repo?

Related