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!
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...
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!
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.
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.
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.
@@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.
@@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.
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 😀
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)
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.
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,
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?
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.
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.
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
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
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?
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.
@@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!
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?
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)
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.
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?
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.
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?
@@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.
@@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 😀
Extremely useful, sir. And I had no problem locating and tracking your head the entire video.
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!
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...
Glad you liked it and it was helpful!!
Thanks Rahul, very nice video.
Thank you 😀
Simply Nice one. Thanks
Thank you! Cheers Rajaram !!
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!
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.
Glad it helped!
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.
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.
@@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.
@@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.
Great video. You could make the cam recording smaller relative to the screen when you are presenting. Apart from that 5*
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 😀
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)
How does it compare with RH roundhouse?
Not sure, I have not used it before.
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.
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,
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.
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?
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.
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.
@@RahulNath Thank you for this. I’ll let you know if have any further questions
@@ransandu Sure do!
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
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
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?
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.
@@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!
@@kellygulutz3992 Glad you sorted it out Kelly!
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?
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)
Thank you
Hi Rahul, How to handle database for staging-slot in Azure Devops? is there any for the DB like web app?
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.
Migration timestamp 4am? Did you just wake up? Or didn't sleep yet??
Woke up - usually around that time 😀
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?
Yes that is a great convention to achieve this. But having 50 databases for one application might itself be something of a problem?
will this work for serverless in synapse?
haven't tried this - are you facing any issues?
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.
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?
@@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.
@@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 😀