Getting Started With DbUp And Setting Up Azure DEVOPS Pipeline | Deploy Changes to SQL Server

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 50

  • @chrisbordeman107
    @chrisbordeman107 3 ปีที่แล้ว +5

    Extremely useful, sir. And I had no problem locating and tracking your head the entire video.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Thank you, Chris! haha, yeah in this video the white square showed up throughout because of a camera bug. I didn't want to record it for just that reason 😀
      And you can call me Rahul!

  • @armandorubiano879
    @armandorubiano879 2 ปีที่แล้ว +1

    Thanks for the comprehensive way of covering the DbUp from the simple C# console project in Visual Studio and adding your SQL scripts to it and up to using DEvOps Build and Release pipelines to use DbUp.... your presentation was very clear and straight to the subject point...

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Glad you liked it and it was helpful!!

  • @prasadkotnana290
    @prasadkotnana290 4 ปีที่แล้ว +3

    Thanks Rahul, very nice video.

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว

      Thank you 😀

  • @rajaramdeivanayagame
    @rajaramdeivanayagame 6 หลายเดือนก่อน

    Simply Nice one. Thanks

    • @RahulNath
      @RahulNath  6 หลายเดือนก่อน +1

      Thank you! Cheers Rajaram !!

  • @RahulNath
    @RahulNath  4 ปีที่แล้ว +2

    Source Code - rahulpnath.visualstudio.com/TH-cam%20Samples/_git/DbUp
    Build Pipeline - rahulpnath.visualstudio.com/TH-cam%20Samples/_build?definitionId=20&_a=summary
    Release Pipeline - rahulpnath.visualstudio.com/TH-cam%20Samples/_release?_a=releases&view=mine&definitionId=9
    Sorry about the Auto Focus box that keeps tracking my face. Forgot to turn it off before recording. Will keep a note for future recordings!

  • @CptMonde
    @CptMonde 4 ปีที่แล้ว +3

    Excellent video, thank you so much!
    I did encounter an issue though when running the pipeline (which I managed to resolve): "'dotnet' is not recognized as an internal or external command." What I needed to do was add "Use .Net Core" steps before building the project, and before executing the command line step.

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว

      Glad it helped!

  • @ranakrishnaraj
    @ranakrishnaraj 2 ปีที่แล้ว +1

    Hi Rahul,
    Thanks for sharing this information! I have one question - Let say if 2 developers committed 4 SPs / functions at almost same time in the DbUp repo. Now I want to rename these files by appending some datetime values as you show in this video. For example - File name "GetPatientList_SP.sql" to "202207301620_GetPatientList_SP.sql". So once I approve the PR, all these files should be renamed. Is there any way to do this?
    Thanks.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Thank you - why do you want to rename it after PR approval? 2 developers would name the file with the datetime prefix convention when submitting the PR itself.

    • @ranakrishnaraj
      @ranakrishnaraj 2 ปีที่แล้ว +1

      @@RahulNath Thanks for the reply. I understand your point. Actually we are planning to implement Dbup and my team members are not used to commit with above naming convention in git. Even If I train them, still there are a chances that they may forget it. In-short I don't want them to follow any convention. Just system will do that. So is there any Pre-process or Post-process like thing in Azure DevOps? I mean not directly but in-directly, for example - Once I approved the PR, then this Post-process will execute my console app or dll function to rename the files as per the convention.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      @@ranakrishnaraj Easiest I can think of is to write a convention test to ensure the filename starts with the specific convention you want to enforce. So if anyone adds a file that breaks the convention unit test will fail. You could look at automating with git pre-commit hooks etc too.

  • @marcioduarte2906
    @marcioduarte2906 4 ปีที่แล้ว +3

    Great video. You could make the cam recording smaller relative to the screen when you are presenting. Apart from that 5*

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว

      Glad you liked it and thank you for your feedback. Yes, my cam recording indeed was taking more space. I have fixed this in my recent videos and adjusted the size. Do let me know your thoughts if you get a chance to watch any of them 😀

  • @bojdeep
    @bojdeep 4 หลายเดือนก่อน

    Hi , Thanks for the sharing the information. How to replace/change the schema dynamically in devops instead of dbo (in all the scripts.. scripts are generated with dbo only)

  • @r1111111r
    @r1111111r 4 ปีที่แล้ว +2

    How does it compare with RH roundhouse?

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว

      Not sure, I have not used it before.

    • @chrisbordeman107
      @chrisbordeman107 3 ปีที่แล้ว

      RH is a separate EXE that must be installed in the pipeline, or a RH container pulled in. It also requires .NEt Core 2.1 be installed. DbUp lets you build your own console app, as you see.

  • @ganirban82
    @ganirban82 3 ปีที่แล้ว +1

    Thanks @Rahul, very nice video.
    One Question#...
    For an existing large database driven web app case as like .. suppose for fixing a bug , 2 files of C# code change happen(at webapp) and 1 table schema change happen and also 1 SP change happen(at DB scripts),then how we can handle above situation ?
    Many Thanks,

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      How are you handling updates to Database currently? Are you using DbUp already? In that case if would be all packaged as part of the deployment.

  • @VivekSharma-hi5gd
    @VivekSharma-hi5gd 2 ปีที่แล้ว

    How about to read the connection string from App.config instead of a json file? We can select XML type and put connection name in our variable list. After doing this I am getting an error like object reference not set to an instance in last task...how can we solve this?

  • @ransandu
    @ransandu 3 ปีที่แล้ว +1

    Hey Rahul.
    Thank you very much for sharing this with the community.
    I got a question for you.
    What are the pros and cons using DbUp and DACPAC tools for database development and use them in CO/CD pipelines.
    Appreciate your feedback.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +2

      Glad you liked it Ranga. This is a good read on the pros and cons of the approaches dbup.readthedocs.io/en/latest/philosophy-behind-dbup/
      Let know if that helps and if you have additional questions.

    • @ransandu
      @ransandu 3 ปีที่แล้ว +1

      @@RahulNath Thank you for this. I’ll let you know if have any further questions

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      @@ransandu Sure do!

  • @manjeetchourasia2005
    @manjeetchourasia2005 2 ปีที่แล้ว

    I have multiple databases of production (Like P1, and P2 ) and also multiple folders of SQL scripts (Like FP1, FP2, and P3 ). Now how do I will manage with DBUP that folder FP1 and P3 script will run into P1 DB. and FP2 and P3 script will run on P2 DB

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      You can run multiple upgrades and use the folders to detect the appropriate script files and the connection string to use. Have you tried that and facing any specific issues? dbup.readthedocs.io/en/latest/more-info/script-providers/ FileSystemScriptProvider

  • @kellygulutz3992
    @kellygulutz3992 ปีที่แล้ว

    This is so great, but I wish it worked for me. Has anything changed with devops or dbup that would prevent the .Net Core CLI task from working? For me, when the pipeline runs, it throws this error. Error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.2 were not found. And it happens no matter what .Net framework I target. Any ideas?

    • @RahulNath
      @RahulNath  ปีที่แล้ว

      Think this is because your devops env does not have the relevant .NET installed. What versions are your other applications? If your apps are on .NET Core use the .NET core packages for DbUp and that should solve it. For .NET Core you can also use this task to specify a version learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/use-dotnet-v2?view=azure-pipelines
      Hope this helps.

    • @kellygulutz3992
      @kellygulutz3992 ปีที่แล้ว

      @@RahulNathI ended up getting it to work using a windows-latest image, using NuGet to get the dbup framework, and then used the output exe in the release pipeline. But I think the root cause what that I must have created the wrong C# console app when I initially setup the project. Maybe I didn't have the right developer pack installed to begin with. I'm a DBA by trade so I don't spend a lot of time in Visual Studio. I think I selected Console App (.Net Framework) instead just Console App. Redoing it with the right project made it all work as expected. Thanks so much for your help!

    • @RahulNath
      @RahulNath  ปีที่แล้ว

      @@kellygulutz3992 Glad you sorted it out Kelly!

  • @jeffersonromario5936
    @jeffersonromario5936 ปีที่แล้ว

    And how does it work to only use it in the database, that is, for database administrators, to save the changes and the scripts as a version control system?

    • @RahulNath
      @RahulNath  ปีที่แล้ว

      This is more from an application perspective/dev to keep/track changes to db and to make sure the database grows along/side-by-side the application. Not sure how you are managing the db as a database administrators. But yes you can have the scripts checked into a Version control system and have it deployed via DbUp as well. But there might be other ways to achieve this as well if you are looking purely from a DBA perspective and other apps/devs don't touch the db (which I guess is less likely a case)

  • @georgeblazhev
    @georgeblazhev 11 หลายเดือนก่อน

    Thank you

  • @harikv8088
    @harikv8088 3 ปีที่แล้ว

    Hi Rahul, How to handle database for staging-slot in Azure Devops? is there any for the DB like web app?

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      With databases and staging slots I have found it always tricky. Usually prefer rolling forward migrations and those that are compatible with previous releases, so that it wouldn't conflict to prod version.

  • @triyuga
    @triyuga 4 ปีที่แล้ว +4

    Migration timestamp 4am? Did you just wake up? Or didn't sleep yet??

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว +4

      Woke up - usually around that time 😀

  • @ToastyMcNuggetLuvr
    @ToastyMcNuggetLuvr 3 ปีที่แล้ว

    What if I have say 50 databases on a given server... How can I let developers choose what database to deploy to? Would it be wise to create a repo that contains a folder for each of my databases and then the idea is that they would commit changes under that folder and then pass in the folder name as a variable to the conn string?

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Yes that is a great convention to achieve this. But having 50 databases for one application might itself be something of a problem?

  • @crazybauns
    @crazybauns 2 ปีที่แล้ว

    will this work for serverless in synapse?

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      haven't tried this - are you facing any issues?

  • @TellaTrix
    @TellaTrix 3 ปีที่แล้ว +1

    Hi Rahul, I would request you to create proper TH-cam playlist for each topic. Like if anyone follow particular series then don't confuse between azure devops, dotnetcore, dbup and azure function. Your content is unique just need to organise well. i am just giving you advise.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Thank you for the suggestion. I do have playlists for each of the series and sub-topics (where appropriate). th-cam.com/users/RahulNathplaylists
      Are you finding anything missing in particular?

    • @TellaTrix
      @TellaTrix 3 ปีที่แล้ว +1

      @@RahulNath Thank you for reply Rahul, It's strange when I was clicked Playlist it was empty, thought to notice you. Anyway I can clearly see this now.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      @@TellaTrix Thank you - Yes I've had some else mention that as well. Not sure if that is an intermittent TH-cam issue. But thank you for letting me know 😀