# Execute DBT commands from bash file in Azure pipeline

**URL:** <https://discourse.getdbt.com/t/execute-dbt-commands-from-bash-file-in-azure-pipeline/13225>\
**Category:** Help\
**Tags:** snowflake, dbt-core\
**Created:** [May 7, 2024, 2:19pm UTC](https://discourse.getdbt.com/t/execute-dbt-commands-from-bash-file-in-azure-pipeline/13225 "2024-05-07T14:19:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RP\_007](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@RP\_007](https://discourse.getdbt.com/u/RP_007)\
**Post date:** [May 7, 2024, 2:19pm UTC](https://discourse.getdbt.com/t/execute-dbt-commands-from-bash-file-in-azure-pipeline/13225/1 "2024-05-07T14:19:44Z")

</div>

## 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  
inputs:  
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.

---

<div class="post-metadata">

**Author:** ![kiranzope](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kiranzope](https://discourse.getdbt.com/u/kiranzope)\
**Post date:** [September 9, 2025, 10:00am UTC](https://discourse.getdbt.com/t/execute-dbt-commands-from-bash-file-in-azure-pipeline/13225/2 "2025-09-09T10:00:16Z")

</div>

can you share the content of shell script to check?
