The future of deployments by Rami Mounla PowerShell DSC The future of deployments by Rami Mounla
Today’s outline About myself Learn about DSC Look at DSC in action Check the DSC CRM configuration
About myself Solution Architect Lead of the Dynamics CRM Team MCP – MCSD – MCTS Dynamics CRM MVP
Who are you? TechEd 2013 11/11/2018 11:52 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Industry Maturity Model
Deployments Characteristics Predictable Repeatable Fast Automated No Human
5 days!!! C++ Previous Experience Platform SQL Prerequisites AD Firewall ½ day VM 1 day
Environment Drift
PowerShell - Desired State Configuration DSC
What is DSC “DSC is a new management platform in Windows PowerShell that enables deploying and managing configuration data for software services and managing the environment in which these services run”
What Does DSC provide? “DSC provides a set of Windows PowerShell language extensions, new Windows PowerShell cmdlets, and resources that you can use to declaratively specify how you want your software environment to be configured.”
What are the advantages? Avoid configuration drift Keep configurations the same for all servers (all environments) Easily create VMs from scratch for every deploy On-premise or cloud (e.g. Azure)
So what? Increase the (on going) assurance that deployment will succeed Faster Deployments Automate and simplify our deployments
MAKE IT SO! How does it work? Authoring Phase: Create Configuration PowerShell Staging Phase: Create MOF file Apply the configuration to the server Push Start-DscConfiguration Pull OData services to pull the details Runs as System User MAKE IT SO!
Architecture
DSC Cocktails
Providers Provider DSC Archive Resource DSC Environment Resource Description DSC Archive Resource Unpacks archive (.zip) files at specific paths on target nodes. DSC Environment Resource Manages system environment variables on target nodes. DSC File Resource Manages files and directories on target nodes. DSC Group Resource Manages local groups on target nodes. DSC Log Resource Logs configuration messages. DSC Package Resource Installs and manages packages, such as Windows Installer and setup.exe packages, on target nodes. DSC WindowsProcess Resource Configures Windows processes on target nodes. DSC Registry Resource Manages registry keys and values on target nodes. DSC WindowsFeature Resource Adds or removes Windows features and roles on target nodes. DSC Script Resource Runs Windows PowerShell script blocks on target nodes. DSC Service Resource Manages services on target nodes. DSC User Resource Manages local user accounts on target nodes.
156 Other Providers xPendingReboot Checks to see if a reboot is pending and allows DSC to predictably handle the condition xSmbShare Allow's configuration of a SMB Share xADDomain Allows configuration of Active Directory components xChrome Installs the Chrome browser xUAC Allows configuration of User Account Control prompt. xWindowsUpdate Handles installation of a Windows update (or a hotfix) from a given path (file path or a URI) xFirewall Manage firewall rules https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d
Demo Resource example & Diff
Prerequisites Windows Management Framework (WMF) 4.0 PowerShell 4.0 with remoting enable .NET 4.5 Preferably 2012 R2 or 8.1 Patch KB2883200 (for eXperimental resources)
CRM 2015 perquisites AD OU Service Account SQL (with specific config) Access to Performance Log Users group SQL (with specific config) .NET 3.5 .NET 4.5.2 Installation account must be Domain account Cannot run using remoting
Typical CRM deploy: UI
Typical CRM deploy: Scripted Deploy <CRMSetup> <Server> <Patch update="true"> </Patch> <LicenseKey>****</LicenseKey> <SqlServer>WIN-FJSSHT6JGM6</SqlServer> <Database create="true"/> <Reporting URL="http://WIN-FJSSHT6JGM6/ReportServer"/> <OrganizationCollation>Latin1_General_CI_AI</OrganizationCollation> <basecurrency isocurrencycode="NZD" currencyname="New Zealand Dollar" currencysymbol="$" currencyprecision="2"/> <Organization>CRM 2015 Organisation</Organization> <OrganizationUniqueName>CRM2015Org</OrganizationUniqueName> <OU>OU=DynamicsCrmOu,DC=TheAuthority,DC=local</OU> <WebsiteUrl create="true" port="5555"> </WebsiteUrl> <InstallDir>c:\Program Files\Microsoft Dynamics CRM</InstallDir> ... <SQM optin="false"/> <muoptin optin="true"/> <Email> <IncomingExchangeServer name=""/> </Email> </Server> </CRMSetup>
Command line E:\Server\amd64\SetupServer.exe /Q /l C:\deployment\crmserver_install.log /config C:\deployment\crmConfigurationFile2015.xml
Demo CRM using DSC
Your Turn…
Resources Continuous Delivery by Jez Humble, David Darley a Martin Fowler Signature book http://bit.ly/1abB8PD (good place to start) http://bit.ly/1TNqIqs (PluralSight course) http://bit.ly/1MEGQGz (Microsoft Providers) http://bit.ly/1xmaVFV (eXperimantal Resources)
Questions?