title: Entity Framework Core migrations through CI and CD in Azure DevOps
body: <p>I have created an Entity Framework Core project and it is working fine and I am able to generate migrations through Visual Studio. </p>
  
  <p>But I want to generate SQL scripts through Azure Devops CI and deployment through CD. I am unable to do it. </p>
  
  <p>By adding this command </p>
  
  <pre><code>dotnet ef migrations script --project $(Build.SourcesDirectory)\SampleEFCoreApplication\SampleEFCoreApplication.csproj -o $(build.artifactstagingdirectory)\migrations\scripts.sql
  </code></pre>
  
  <p>This generates the entire SQL script. But next time, if I have to make any changes in my model, it again regenerates the entire SQL script. But I only want the changes to appear if I make any model changes. How can I do that ?</p>
  
  <p>This is how my CI looks in Azure DevOps </p>
  
  <p><a href="https://i.stack.imgur.com/7qXDZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7qXDZ.png" alt="enter image description here"></a></p>