Sessione tenuta al SQL Start! 2019 di Ancona, in cui introduco i concetti base di PowerShell e PowerShell DSC nel contesto di SQL Server.
Demo: https://github.com/OmegaMadLab/DeployAndManageSqlInstancesWithPowerShell
3. Speaker bio
Advisory Engineer @ Softjam S.p.A.
Geek to the bone
Marco Obinu
marco.obinu@omegamadlab.com
@OmegaMadLab
www.omegamadlab.com
https://github.com/OmegaMadLab
4. Agenda
• Infrastructure as Code
• SQL Server Setup
• SQL Server Management
• Demo, demo, demo
https://github.com/OmegaMadLab/DeployAndManageSqlInstancesWithPowerShell
5. Creare ed amministrare le proprie
istanze con PowerShell
Breve introduzione ad Infrastructure as Code
6. Infrastructure as Code
• Modello dichiarativo
• Automazione
• Evita derive di configurazione
• Ambienti riproducibili
• Version Control
• CI/CD
• Traccia le dipendenze delle risorse
7. Setup di SQL Server
PowerShell Desired State Configuration
9. PowerShell Desired State Configuration
• Sistema di configuration management basato su PowerShell
• Funziona sia su Windows che su OSS
• Elementi chiave:
• Configurazioni componente dichiarativa
• Risorse componente imperativa
• Tre funzioni: Test, Get, Set
• Reperibili da PSGallery Find-DscResource
• Local Configuration Manager
• ApplyOnly
• ApplyAndMonitor
• ApplyAndAutocorrect
• Min. PoSH 4.0, consigliato 5.1 – necessita di WinRM
10. PowerShell Desired State Configuration
• PUSH e PULL
• CmdLet da ricordare
• Find-Module
• Install-Module
• Update-Module
• Get-Command -noun DSC*
14. SQL Server e PowerShell
Microsoft
• SQL Management Objects (SMO)
• SqlPs SqlServer
Terze parti
• DbaTools
• SQL2000+
• Windows 7 with PowerShell 3 lato client; non necessario sui server
• DbaChecks
• Etc, etc, etc…
15. It’s demo time!
Gestione SQL Server con PowerShell
https://github.com/OmegaMadLab/DeployAndManageSqlInstancesWithPowerShell