Execute DBT commands from bash file in Azure pipeline

The problem I’m having

I want to excute bash file with dbt commands from Azure .yml pipeline.

The context of why I’m trying to do this

I am new to dbt. I have daily CI pipeline in Azure where a bunch of static dbt commands get executed. I see some models get failed so in next run, I only want to execute those failed models only. if nothing failed then we can execute all the models.
Failed model info I get from the log table.

What I’ve already tried

I created on .sh file with content as below:
dbt run -s dim1.sql
dbt run -s dim1.sql

and called this file in my Azure .yml pipeline with bash task:

  • task: Bash@3
    targetType: ‘inline’
    script: |
    # Write your commands here
    sh File1.sh

Some example code or error messages

dbt: command not found
and the step execution fail with ##[error]Bash exited with code ‘127’.

Is it something wrong in above approach.