├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── docs ├── graphics │ ├── Azure SQL Database.png │ ├── Azure-DevOps-Service.png │ ├── DatabaseManagementLifecycle.png │ ├── DevOps.png │ ├── cloud.png │ ├── contributing.png │ ├── db.png │ ├── devops-cycle.png │ ├── devops-flow.png │ ├── digital-transformation.png │ ├── dml.png │ ├── microsoft-logo-small.png │ ├── modules.png │ ├── prerequisites.png │ ├── ribbon.png │ ├── roles.png │ └── scope.png └── labs │ ├── 1-ConfigLocalEnvironment.md │ ├── 2-Configure_your_DevOps_Environment.md │ ├── 3-AzureResourceDeployment.md │ ├── 4-DatabaseLifecycleManagement.md │ ├── README.md │ ├── UnitTests.md │ ├── imgs │ ├── AzureDataStudioLogo.png │ ├── CI-AgentStepRename.png │ ├── Clone.png │ ├── CloneCopy.png │ ├── Git-Icon.png │ ├── GitImport.png │ ├── PS1filetype.png │ ├── PS1filetype2.png │ ├── PS1filetype3.png │ ├── PS1filetype4.png │ ├── PSextension.png │ ├── RepoBranchPolicies.png │ ├── RepoInitialize.png │ ├── RepoMasterBranchPolicies.png │ ├── RepoMasterBranchPoliciesIcon.png │ ├── ReposBranchs.png │ ├── ServiceConnection.png │ ├── SuperchargeAzureSQL.png │ ├── ad.jpg │ ├── cd-artifacts-delete.png │ ├── cd-artifacts.png │ ├── cd-azpowershell.png │ ├── cd-deploy.png │ ├── cd-emptyjob.png │ ├── cd-new-pipeline.png │ ├── cd-powershell.png │ ├── cd-prod-rename.png │ ├── cd-release-vars.png │ ├── cd-release.png │ ├── cd-result1.png │ ├── cd-result2.png │ ├── cd-tasks.png │ ├── cd-trigger.png │ ├── cd-variablegroup.png │ ├── ci-ARM-task.png │ ├── ci-agent.png │ ├── ci-clone-task.png │ ├── ci-filter-build.png │ ├── ci-publish-build-artfacts.png │ ├── ci-publish-path.png │ ├── ci-run-pipeline.png │ ├── ci-run-pipeline2.png │ ├── ci-run-pipeline3.png │ ├── ci-save-build.png │ ├── ci-save-build2.png │ ├── ci-sources-prod.png │ ├── ci-sqldb-validate.png │ ├── ci-view-logs.png │ ├── classiceditor.jpg │ ├── clone-cdrive.png │ ├── commit-ssdt.png │ ├── copiedsource.png │ ├── db-dev-build-vars.png │ ├── db-dev-build.png │ ├── db-dev-ci-publisharts.png │ ├── db-dev-ci.png │ ├── db-dev-triggers.png │ ├── db-dev-vsbuild.png │ ├── dev.png │ ├── devSelect.png │ ├── devops-signup.png │ ├── dl_VS.png │ ├── dlm-cd-add-task.png │ ├── dlm-cd-dev-CD.png │ ├── dlm-cd-dev-clonetask.png │ ├── dlm-cd-dev-rEnv.png │ ├── dlm-cd-dev-tasksall.png │ ├── dlm-cd-emptyjob.png │ ├── dlm-cd-linked-vars.png │ ├── dlm-cd-new.png │ ├── dlm-cd-rename.png │ ├── dlm-cd-sql-task.png │ ├── dlm-dev-cd-artifact.png │ ├── dlm-dev-cd-sql.png │ ├── dlm-dev-cd-trigger.png │ ├── dlm-lb-keys.png │ ├── dlm-lb-keys2.png │ ├── dlm-lb-keys3.png │ ├── dlm-lb-keys4.png │ ├── dlm-rename-dev.png │ ├── email.png │ ├── emptyjob.png │ ├── explore-gitignore.png │ ├── explore-hidden.png │ ├── fullserviceconnection.jpg │ ├── gitignore.png │ ├── icon-lock.png │ ├── icon-unlock.png │ ├── importrepo.jpg │ ├── installSSDT.png │ ├── master.png │ ├── newproject.jpg │ ├── parameters.png │ ├── parmAdmin.png │ ├── pipelines.jpg │ ├── postload-datedim.png │ ├── postload-script.png │ ├── pr-active.png │ ├── pr-clone-dev-rename.png │ ├── pr-clone-dev.png │ ├── pr-compare.png │ ├── pr-complete.png │ ├── pr-prod-pipline.png │ ├── pr-rename-prod-stage.png │ ├── prod-approve.png │ ├── prod-email.png │ ├── prod-release1.png │ ├── projectsettings.jpg │ ├── ps_vscode.jpg │ ├── push.png │ ├── remotefiles.png │ ├── repo.jpg │ ├── reposource.jpg │ ├── resourcegoup.jpg │ ├── resourcegoup2.jpg │ ├── rgDeployment1.png │ ├── rgDeployment2.png │ ├── rgResources.png │ ├── serverAdmin.png │ ├── serviceconnection.jpg │ ├── sourcecode.png │ ├── sourcedir.png │ ├── sql_db.png │ ├── srvName.png │ ├── ssdt-Synce.png │ ├── ssdt-build-result.png │ ├── ssdt-build.png │ ├── ssdt-commit-staged.png │ ├── ssdt-compare-gear.png │ ├── ssdt-compare-target.png │ ├── ssdt-createdb.png │ ├── ssdt-db-settings.png │ ├── ssdt-dev.png │ ├── ssdt-execute-script.png │ ├── ssdt-git-push.png │ ├── ssdt-load-data.png │ ├── ssdt-localdb-connection.png │ ├── ssdt-localdb-query.png │ ├── ssdt-localdb.png │ ├── ssdt-master.png │ ├── ssdt-refactor1.png │ ├── ssdt-refactor2.png │ ├── ssdt-refactor3.png │ ├── ssdt-select-target.png │ ├── ssdt-sqlexplorer.png │ ├── ssdt-stage.png │ ├── ssdt-tablescript.png │ ├── ssms-firewall.png │ ├── stagefiles.png │ ├── variable-group.png │ ├── visualstudio.png │ ├── vs-git-fetch.png │ ├── vsCode.png │ ├── vscode-check.png │ └── vscode-sync-message.png │ └── zz-labTemplate.md └── source ├── DatabaseProjects ├── Deployment │ ├── FindSQLPackage.ps1 │ └── SqlPackage.ps1 └── trainingDW │ ├── trainingDW.sln │ └── trainingDW │ ├── Scripts │ ├── LoadDateDim.sql │ └── LoadMIP.sql │ ├── Security │ └── Schemas │ │ ├── dim.sql │ │ ├── fact.sql │ │ └── stg.sql │ ├── dim │ ├── Tables │ │ ├── dim.Attendee.sql │ │ ├── dim.AttendeeNotes.sql │ │ ├── dim.Date.sql │ │ ├── dim.DeliveryStatus.sql │ │ ├── dim.Instructor.sql │ │ ├── dim.Location.sql │ │ ├── dim.MIP.sql │ │ └── dim.deliveredworkshop.sql │ └── Views │ │ └── dim.vwWorkshop.sql │ ├── fact │ └── Tables │ │ └── fact.MIPfact.sql │ ├── stg │ ├── Programmability │ │ └── Stored Procedures │ │ │ ├── stg.ClearStaging.sql │ │ │ └── stg.LoadDims.sql │ └── Tables │ │ └── stg.workshop.sql │ ├── trainingDW.refactorlog │ └── trainingDW.sqlproj └── Deployments ├── ARM ├── parameters │ ├── KeyVault.parameters.json │ └── sql_db.parameters.dev.json └── templates │ ├── KeyVault.json │ ├── empty-template.json │ └── sql_db.json └── Scripts ├── KeyVault-WriteSecrets.ps1 └── Parse-ARMOutputs.ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | bld/ 27 | [Bb]in/ 28 | [Oo]bj/ 29 | [Ll]og/ 30 | [Ll]ogs/ 31 | 32 | # Visual Studio 2015/2017 cache/options directory 33 | .vs/ 34 | # Uncomment if you have tasks that create the project's static files in wwwroot 35 | #wwwroot/ 36 | 37 | # Visual Studio 2017 auto generated files 38 | Generated\ Files/ 39 | 40 | # MSTest test Results 41 | [Tt]est[Rr]esult*/ 42 | [Bb]uild[Ll]og.* 43 | 44 | # NUnit 45 | *.VisualState.xml 46 | TestResult.xml 47 | nunit-*.xml 48 | 49 | # Build Results of an ATL Project 50 | [Dd]ebugPS/ 51 | [Rr]eleasePS/ 52 | dlldata.c 53 | 54 | # Benchmark Results 55 | BenchmarkDotNet.Artifacts/ 56 | 57 | # .NET Core 58 | project.lock.json 59 | project.fragment.lock.json 60 | artifacts/ 61 | 62 | # StyleCop 63 | StyleCopReport.xml 64 | 65 | # Files built by Visual Studio 66 | *_i.c 67 | *_p.c 68 | *_h.h 69 | *.ilk 70 | *.meta 71 | *.obj 72 | *.iobj 73 | *.pch 74 | *.pdb 75 | *.ipdb 76 | *.pgc 77 | *.pgd 78 | *.rsp 79 | *.sbr 80 | *.tlb 81 | *.tli 82 | *.tlh 83 | *.tmp 84 | *.tmp_proj 85 | *_wpftmp.csproj 86 | *.log 87 | *.vspscc 88 | *.vssscc 89 | .builds 90 | *.pidb 91 | *.svclog 92 | *.scc 93 | 94 | # Chutzpah Test files 95 | _Chutzpah* 96 | 97 | # Visual C++ cache files 98 | ipch/ 99 | *.aps 100 | *.ncb 101 | *.opendb 102 | *.opensdf 103 | *.sdf 104 | *.cachefile 105 | *.VC.db 106 | *.VC.VC.opendb 107 | 108 | # Visual Studio profiler 109 | *.psess 110 | *.vsp 111 | *.vspx 112 | *.sap 113 | 114 | # Visual Studio Trace Files 115 | *.e2e 116 | 117 | # TFS 2012 Local Workspace 118 | $tf/ 119 | 120 | # Guidance Automation Toolkit 121 | *.gpState 122 | 123 | # ReSharper is a .NET coding add-in 124 | _ReSharper*/ 125 | *.[Rr]e[Ss]harper 126 | *.DotSettings.user 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # NuGet Symbol Packages 186 | *.snupkg 187 | # The packages folder can be ignored because of Package Restore 188 | **/[Pp]ackages/* 189 | # except build/, which is used as an MSBuild target. 190 | !**/[Pp]ackages/build/ 191 | # Uncomment if necessary however generally it will be regenerated when needed 192 | #!**/[Pp]ackages/repositories.config 193 | # NuGet v3's project.json files produces more ignorable files 194 | *.nuget.props 195 | *.nuget.targets 196 | 197 | # Microsoft Azure Build Output 198 | csx/ 199 | *.build.csdef 200 | 201 | # Microsoft Azure Emulator 202 | ecf/ 203 | rcf/ 204 | 205 | # Windows Store app package directories and files 206 | AppPackages/ 207 | BundleArtifacts/ 208 | Package.StoreAssociation.xml 209 | _pkginfo.txt 210 | *.appx 211 | *.appxbundle 212 | *.appxupload 213 | 214 | # Visual Studio cache files 215 | # files ending in .cache can be ignored 216 | *.[Cc]ache 217 | # but keep track of directories ending in .cache 218 | !?*.[Cc]ache/ 219 | 220 | # Others 221 | ClientBin/ 222 | ~$* 223 | *~ 224 | *.dbmdl 225 | *.dbproj.schemaview 226 | *.jfm 227 | *.pfx 228 | *.publishsettings 229 | orleans.codegen.cs 230 | 231 | # Including strong name files can present a security risk 232 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 233 | #*.snk 234 | 235 | # Since there are multiple workflows, uncomment next line to ignore bower_components 236 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 237 | #bower_components/ 238 | 239 | # RIA/Silverlight projects 240 | Generated_Code/ 241 | 242 | # Backup & report files from converting an old project file 243 | # to a newer Visual Studio version. Backup files are not needed, 244 | # because we have git ;-) 245 | _UpgradeReport_Files/ 246 | Backup*/ 247 | UpgradeLog*.XML 248 | UpgradeLog*.htm 249 | ServiceFabricBackup/ 250 | *.rptproj.bak 251 | 252 | # SQL Server files 253 | *.mdf 254 | *.ldf 255 | *.ndf 256 | 257 | # Business Intelligence projects 258 | *.rdl.data 259 | *.bim.layout 260 | *.bim_*.settings 261 | *.rptproj.rsuser 262 | *- [Bb]ackup.rdl 263 | *- [Bb]ackup ([0-9]).rdl 264 | *- [Bb]ackup ([0-9][0-9]).rdl 265 | 266 | # Microsoft Fakes 267 | FakesAssemblies/ 268 | 269 | # GhostDoc plugin setting file 270 | *.GhostDoc.xml 271 | 272 | # Node.js Tools for Visual Studio 273 | .ntvs_analysis.dat 274 | node_modules/ 275 | 276 | # Visual Studio 6 build log 277 | *.plg 278 | 279 | # Visual Studio 6 workspace options file 280 | *.opt 281 | 282 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 283 | *.vbw 284 | 285 | # Visual Studio LightSwitch build output 286 | **/*.HTMLClient/GeneratedArtifacts 287 | **/*.DesktopClient/GeneratedArtifacts 288 | **/*.DesktopClient/ModelManifest.xml 289 | **/*.Server/GeneratedArtifacts 290 | **/*.Server/ModelManifest.xml 291 | _Pvt_Extensions 292 | 293 | # Paket dependency manager 294 | .paket/paket.exe 295 | paket-files/ 296 | 297 | # FAKE - F# Make 298 | .fake/ 299 | 300 | # CodeRush personal settings 301 | .cr/personal 302 | 303 | # Python Tools for Visual Studio (PTVS) 304 | __pycache__/ 305 | *.pyc 306 | 307 | # Cake - Uncomment if you are using it 308 | # tools/** 309 | # !tools/packages.config 310 | 311 | # Tabs Studio 312 | *.tss 313 | 314 | # Telerik's JustMock configuration file 315 | *.jmconfig 316 | 317 | # BizTalk build output 318 | *.btp.cs 319 | *.btm.cs 320 | *.odx.cs 321 | *.xsd.cs 322 | 323 | # OpenCover UI analysis results 324 | OpenCover/ 325 | 326 | # Azure Stream Analytics local run output 327 | ASALocalRun/ 328 | 329 | # MSBuild Binary and Structured Log 330 | *.binlog 331 | 332 | # NVidia Nsight GPU debugger configuration file 333 | *.nvuser 334 | 335 | # MFractors (Xamarin productivity tool) working folder 336 | .mfractor/ 337 | 338 | # Local History for Visual Studio 339 | .localhistory/ 340 | 341 | # BeatPulse healthcheck temp database 342 | healthchecksdb 343 | 344 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 345 | MigrationBackup/ 346 | 347 | # Ionide (cross platform F# VS Code tools) working folder 348 | .ionide/ 349 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## ![](docs/graphics/contributing.png) Contributing 2 | 3 | This project welcomes contributions and suggestions. Most contributions require you to 4 | agree to a Contributor License Agreement (CLA) declaring that you have the right to, 5 | and actually do, grant us the rights to use your contribution. For details, visit 6 | https://cla.microsoft.com. 7 | 8 | When you submit a pull request, a CLA-bot will automatically determine whether you need 9 | to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the 10 | instructions provided by the bot. You will only need to do this once across all repositories using our CLA. 11 | 12 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 13 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 14 | or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Microsoft Logo](docs/graphics/microsoft-logo-small.png) 2 | 3 | # **Supercharge your Azure SQL deployments by operationalizing Azure with DevOps** 4 | This repository is used for a technical workshop. It focuses on the skills and technologies needed to learn how to quickly deploy and manage Azure SQL database development and deployments at scale using Azure DevOps Services. Supercharge your data estate with database life cycle management using modern cloud principles and architectures. Learn how to leverage the power of Azure Resource Manager and DevOps to deploy efficiently. Learn how to seamlessly manage database projects and handle schema changes that will avail your cloud migration efforts with ease. 5 | 6 | --- 7 | ## ![](docs/graphics/ribbon.png) Learning objective 8 | Learn how to architect, design, and develop a full Azure SQL DB management lifecycle using DevOps. You will learn how to build an end to end solution to deploy the Azure Services along with full CI/CD pipelines to "Rub a little DevOps" on your database development. 9 | 10 | --- 11 | 12 | ## ![](docs/graphics/roles.png) Target role(s) 13 | Architects, consultants, DBAs, database developers, and data professionals in the Data and AI realm wanting to learn how to operationalize Azure with DevOps. 14 | 15 | ## ![](docs/graphics/modules.png) Workshop Modules 16 | 17 | [All modules](/docs/labs/README.md) 18 | 19 | 1. [Configure your Local Environment](/docs/labs/1-ConfigLocalEnvironment.md) 20 | 21 | 2. [Configure your DevOps Environment](/docs/labs/2-Configure_your_DevOps_Environment.md) 22 | 23 | 3. [Azure Resource Deployment CI/CD](/docs/labs/3-AzureResourceDeployment.md) 24 | 25 | 4. [Database Life cycle Management](/docs/labs/4-DatabaseLifecycleManagement.md) 26 | 27 | 28 | ## ![](docs/graphics/prerequisites.png) Prerequisites & References 29 | While there are no prerequisites for this workshop, it is helpful if you have already had some experience and understanding of the following: 30 | - [Overview of SQL Server Data Tools (SSDT)](https://docs.microsoft.com/en-us/sql/ssdt/sql-server-data-tools?view=sql-server-ver15) 31 | - [SqlPackage.exe reference](https://docs.microsoft.com/en-us/sql/tools/sqlpackage?view=sql-server-ver15) 32 | - [Azure Data Architecture Guide](https://docs.microsoft.com/en-us/azure/architecture/data-guide/) 33 | - [Online analytical processing (OLAP)](https://docs.microsoft.com/en-us/azure/architecture/data-guide/relational-data/online-analytical-processing) 34 | - [Online transaction processing (OLTP)](https://docs.microsoft.com/en-us/azure/architecture/data-guide/relational-data/online-transaction-processing) 35 | - [Data warehousing](https://docs.microsoft.com/en-us/azure/architecture/data-guide/relational-data/data-warehousing) 36 | - [Azure Resource Group planning and design](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview) 37 | - [Azure AD and RBAC - Controlling which Azure resources accounts have access to](https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal) 38 | - [How to login to an Azure subscription using Azure PowerShell](https://docs.microsoft.com/en-us/powershell/azure/authenticate-azureps?view=azps-3.1.0) 39 | - [Deploying resources into Azure using ARM templates](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-deploy) 40 | - [Git source control framework - Basics of source control and collaborating with others](https://docs.microsoft.com/en-us/azure/devops/learn/git/what-is-git) 41 | 42 | ## ![](docs/graphics/scope.png) Scope 43 | This workshop is the distilled and simplified experience of multiple engineers working on migrating data estates for enterprise customers to the cloud. 44 | 45 | ## ![](docs/graphics/Azure SQL Database.png) What is Azure SQL Database? 46 | Azure SQL Database is the intelligent, scalable, cloud database as a service in Azure. It is a general-purpose relational database in Azure as a managed service. It is based on the latest stable version of the Microsoft SQL Server database engine. To learn about Azure SQL Database please read through the Microsoft Documentation: [Azure SQL Database documentation](https://docs.microsoft.com/en-us/azure/sql-database/) 47 | 48 | ## ![](docs/graphics/Azure-DevOps-Service.png) What is Azure DevOps? 49 | Azure DevOps is software as a service that provides developer services to support work item planning, collaborate of code development, and building and deploying applications. This workshop uses Azure DevOps service to operationalize the development and deployment of Azure SQL Database. The full documentation for Azure DevOps can be reviewed by visiting the Microsoft Docs: [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/?view=azure-devops). 50 | 51 | ## ![](docs/graphics/DevOps.png) What is DevOps? 52 | “DevOps is the union of people, process, and products to enable continuous delivery of value to our end users.” – Donovan Brown
53 | ![](docs/graphics/devops-cycle.png)
54 | To learn more about DevOps please vist: What is [DevOps?](https://docs.microsoft.com/en-us/azure/devops/learn/what-is-devops)
55 | ![](docs/graphics/devops-flow.png)
56 | To learn the prerequisite skills and technologies needed to succeed with Azure DevOps as the preferred method for deploying applications into Azure please vist: [Azure Superpowers](https://github.com/microsoft/AzureSuperpowers)
57 | 58 | ## ![](docs/graphics/dml.png) What is Database management lifecycle? 59 | ![](docs/graphics/DatabaseManagementLifecycle.png)
60 | Database Life cycle Management (DLM) is an approach to managing databases and data assets using CI/CD. DLM is a comprehensive approach to managing the database schema, data, and metadata for the database(s). A thoughtful and proactive approach to DLM enables an organization to manage data resources according to appropriate levels of performance, protection, availability, and cost. Providing the team the ability to source control their database(s) while supercharging their deployments and development with DevOps. Leveraging SQL Server Data tools to manage database projects and integrate with Git Repositories within Azure DevOps Services. The team can develop, test, build, deploy, maintain, monitor, and scale with ease. 61 | 62 | ## ![](docs/graphics/contributing.png) [Contributing](./CONTRIBUTING.md) 63 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 64 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 65 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. 66 | 67 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide 68 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions 69 | provided by the bot. You will only need to do this once across all repos using our CLA. 70 | 71 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 72 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 73 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 74 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /docs/graphics/Azure SQL Database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/Azure SQL Database.png -------------------------------------------------------------------------------- /docs/graphics/Azure-DevOps-Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/Azure-DevOps-Service.png -------------------------------------------------------------------------------- /docs/graphics/DatabaseManagementLifecycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/DatabaseManagementLifecycle.png -------------------------------------------------------------------------------- /docs/graphics/DevOps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/DevOps.png -------------------------------------------------------------------------------- /docs/graphics/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/cloud.png -------------------------------------------------------------------------------- /docs/graphics/contributing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/contributing.png -------------------------------------------------------------------------------- /docs/graphics/db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/db.png -------------------------------------------------------------------------------- /docs/graphics/devops-cycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/devops-cycle.png -------------------------------------------------------------------------------- /docs/graphics/devops-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/devops-flow.png -------------------------------------------------------------------------------- /docs/graphics/digital-transformation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/digital-transformation.png -------------------------------------------------------------------------------- /docs/graphics/dml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/dml.png -------------------------------------------------------------------------------- /docs/graphics/microsoft-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/microsoft-logo-small.png -------------------------------------------------------------------------------- /docs/graphics/modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/modules.png -------------------------------------------------------------------------------- /docs/graphics/prerequisites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/prerequisites.png -------------------------------------------------------------------------------- /docs/graphics/ribbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/ribbon.png -------------------------------------------------------------------------------- /docs/graphics/roles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/roles.png -------------------------------------------------------------------------------- /docs/graphics/scope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/graphics/scope.png -------------------------------------------------------------------------------- /docs/labs/1-ConfigLocalEnvironment.md: -------------------------------------------------------------------------------- 1 | ## Lab 1 - Configure your Local Environment 2 | -------------------------------- 3 | 4 | [Back to all modules](/docs/labs/README.md) 5 | 6 | 7 | 8 | | Lab Description | This lab covers the installation of tools that you will use in the labs. | 9 | | :------------ | :-------------- | 10 | | Estimated Time to Complete | 50 minutes | 11 | | Key Takeaways | 1. Download and install the required tools | 12 | | | 2. Know what version of the tools are installed | 13 | | | 3. Learn to configure VS Code and install extensions | 14 | | | By the end of this lab, you should have: Git, Visual Studio - SSDT, Visual Studio Code, Azure PowerShell, SSMS, Azure Data Studio, SQLPackage.exe | 15 | | Author | Frank Garofalo | 16 | 17 | ### Purpose 18 | 19 | For those new to DevOps, Source Control, and Database Projects, 20 | there are many tools that you need to familiarize yourself with. This module 21 | walks you through installing and configuring the required tools for this lab, as well as making sure they are on the current supported versions. 22 | 23 | ##
Exercise - Setup Az PowerShell Module
24 | 25 | ### Launch PowerShell 26 | 27 | 1. Right Click on **Windows PowerShell** from either the Desktop or the 28 | Start Menu 29 | 30 | 2. Select **Run as Administrator** 31 | 32 | ### Set PowerShell Execution Policy 33 | 34 | 1. Run the following PowerShell Command to set your execution policy to 35 | Unrestricted: 36 | 37 | ```powershell 38 | Set-ExecutionPolicy Unrestricted 39 | ``` 40 | 41 | 2. Select "Yes to All" if prompted. Execution policies determine whether you can 42 | load configuration files, such as your PowerShell profile, or run 43 | scripts and whether scripts must be digitally signed before they are 44 | run. More information on this topic can be found here: 45 | 46 | 47 | ### Install Az Module 48 | 49 | 1. Run the following PowerShell Command: 50 | 51 | ```powershell 52 | Install-Module -Name 'Az' 53 | ``` 54 | 55 | 2. If not already installed, you may be prompted to install the NuGet 56 | provider. Select **Yes** if this is the case. 57 | 58 | 3. You may receive a warning message stating you are installing modules 59 | from an untrusted repository. Select **Yes to All** if this is the case. 60 | This process may take several minutes. 61 | 62 | 4. Run the following PowerShell Command to verify the module has 63 | installed correctly: 64 | 65 | ```powershell 66 | Get-Module -Name '*Az*' -ListAvailable 67 | ``` 68 | 69 | 5. If installed, Az.* modules should be returned 70 | 71 | 6. Run the following PowerShell Command to turn off autosaving Azure 72 | credentials\ 73 | (some Azure PowerShell versions have this on as the default) 74 | 75 | ```powershell 76 | Disable-AzContextAutosave 77 | ``` 78 | 79 | Expected return: 80 | 81 | > PS C:\\\> Disable-AzContextAutosave 82 | > 83 | > Mode : Process 84 | > 85 | > ContextDirectory : 86 | > 87 | > ContextFile : 88 | > 89 | > CacheDirectory : 90 | > 91 | > CacheFile : 92 | > 93 | > Settings : {} 94 | 95 | ##
Exercise - Setup ![](docs/../imgs/Git-Icon.png) Git for Windows
96 | ### Download Git for Windows Installation Files 97 | 98 | 1. In a web browser, navigate to 99 | 100 | 2. The 64-bit version of **Git for Windows** should begin automatically 101 | downloading, if it does not select **64-bit Git for Windows Setup** 102 | 103 | 3. Note the location of the installation files 104 | 105 | ### Install Git for Windows 106 | 107 | 1. Run the **Git for Windows** installation file 108 | 109 | 2. Accept the EULA by clicking **Next** 110 | 111 | 3. Accept the default Destination Location and click **Next** 112 | 113 | 4. Accept the default Components and click **Next** 114 | 115 | 5. Accept the default Start Menu Folder of "Git" and click **Next** 116 | 117 | 6. Accept the default editor of Vim and click **Next** 118 | 119 | 7. Accept the default "Git from the command line and also from 120 | 3rd-party software" and click **Next** 121 | 122 | 8. Accept **OpenSSL** as the default HTTPS transport backend and click 123 | **Next** 124 | 125 | 9. Accept the default **Windows-style** "Configuring the line ending 126 | conversions" and click **Next** 127 | 128 | 10. Accept the default **MinTTY** terminal emulator and click **Next** 129 | 130 | 11. Accept the default Configuring extra options and click **Next** 131 | 132 | 12. Click **Install** 133 | 134 | 13. Uncheck "View Release Notes" and click **Finish** 135 | 136 | ##
Exercise - Setup ![](docs/../imgs/vsCode.png) Visual Studio Code
137 | 138 | ### Download Visual Studio Code 139 | 140 | 1. In a web browser, navigate to 141 | 142 | 2. Click **Download for Windows** 143 | 144 | 3. Note the location of the installation files 145 | 146 | ### Install Visual Studio Code 147 | 148 | 1. Run the **VSCodeUserSetup** installation file 149 | 150 | 2. If you are prompted with a message \"This User Installer is not 151 | meant to be run as an Administrator\" Click **OK** 152 | 153 | 3. Accept the EULA and click **Next** 154 | 155 | 4. Accept the default installation location and click **Next** 156 | 157 | 5. Accept the default Start Menu Folder and click **Next** 158 | 159 | 6. Select **All additional tasks** and click **Next** (Optional) 160 | 161 | 7. Click **Install** 162 | 163 | 8. Uncheck "Launch Visual Studio Code" and click **Finish** 164 | 165 | 166 | ##
Exercise - Setup ![](docs/../imgs/visualstudio.png) Visual Studio - SSDT
167 | 168 | ### Download Visual Studio 2019 169 | 170 | 1. In a web browser, navigate to 171 | 172 | 2. Click Free Download on Community Edition
173 | *if you have a license, download the appropriate edition*
174 | 175 | ![VS Studio DL Image](docs/../imgs/dl_VS.png) 176 | 177 | 1. Note the location of the installation files 178 | 179 | ### Install Visual Studio 2019 180 | 181 | 1. Run the **vs_community** installation file 182 | 183 | 2. Accept the EULA and click Next 184 | 185 | 3. Select Workloads -> Other Toolsets -> **Data storage and processing** 186 | 187 | 4. Make sure SQL Server Data Tools is selected 188 | 189 | 5. Click Install
190 | *This is a large install and can take some time to complete(~20 mins)*
191 | 192 | ![SSDT Installer Page](./imgs/installSSDT.png) 193 | 194 | ##
Exercise - Setup Sql Server management studio (SSMS)
195 | *`SSMS is not required for this lab, but is useful to connect to and query Azure SQL Database with.`* 196 | 197 | ### Download SSMS 198 | 199 | 1. In a web browser, navigate to 200 | 201 | 2. Note the location of the installation file 202 | 203 | ### Install SSMS 204 | 205 | 1. Run the **SSMS-Setup-ENU** installation file 206 | 207 | 2. Leave default installation path 208 | 209 | 3. Click Install 210 | 211 | 4. Once Setup completes click **Close** 212 | 213 | ##
Exercise - Setup ![](docs/../imgs/AzureDataStudioLogo.png) Azure Data Studio
214 | *`Azure Data Studio is not required for this lab, but is useful to connect to and query Azure SQL Database with.`* 215 | 216 | ### Download Azure Data Studio 217 | 218 | 1. In a web browser, navigate to 219 | 220 | 2. Note the location of the installation file 221 | 222 | ### Install Azure Data Studio 223 | 1. Run the **azuredatastudio-windows-user-setup** installation file 224 | 225 | 2. If you are prompted with a message \"This User Installer is not 226 | meant to be run as an Administrator\" Click **OK** 227 | 228 | 3. Accept the EULA and click **Next** 229 | 230 | 4. Accept the default installation location and click **Next** 231 | 232 | 5. Accept the default Start Menu Folder and click **Next** 233 | 234 | 6. Select all additional tasks and click **Next** (Optional) 235 | 236 | 7. Click **Install** 237 | 238 | 8. Uncheck "Launch Azure Data Studio" and click **Finish** 239 | 240 | ##
Exercise - Install sqlpackage for Windows
241 | 242 | ### Download sqlpackage 243 | 244 | 1. In a web browser, navigate to 245 | 246 | 2. Note the location of the installation file 247 | 248 | ### Install sqlpackage 249 | 1. Run the **DacFramework** installation file 250 | 251 | 2. Click **Next** 252 | 253 | 3. Accept the EULA and click **Next** 254 | 255 | 4. Click **Install** 256 | 257 | 5. click **Finish** to complete the install 258 | 259 | >The sqlpackage installs to: C:\Program Files\Microsoft SQL Server\150\DAC\bin 260 | 261 | ##
Exercise - Version Check and Configuration
262 | 263 | ### Check the version of Az 264 | 265 | 1. Launch VS Code 266 | 267 | 2. Select the terminal. This is typically in the lower right pane of VS 268 | Code and is often tabbed with other panes, such as Problems, Output, 269 | and Debug Console. If you do not see Terminal, click View in the top 270 | menu bar and click **Terminal**. 271 | 272 | 3. Type the following PowerShell command: 273 | 274 | ```powershell 275 | Get-Module -Name 'Az.Compute' -ListAvailable | Select-Object -Property 'Version' 276 | ``` 277 | 278 | 4. The expected output is **3.3.0** or later 279 | 280 | ### Check the version of Git for Window 281 | 282 | 1. From within the VS Code Terminal, Type the following git command: 283 | 284 | ```powershell 285 | git --version 286 | ``` 287 | 288 | 2. The expected output is **git version 2.24.1.windows.2** or later 289 | 290 | 3. If you experience any issues with this step, restart VS Code and try 291 | again 292 | 293 | ### Check the version of Visual Studio Code 294 | 295 | 1. From the VS Code File Menu, click **Help** then **About** 296 | 297 | 2. The expected version is **1.41.1** or later 298 | 299 | ### Install extensions in Visual Studio Code 300 | *Credit for this exercise goes to: [Azure Superpowers](https://github.com/microsoft/AzureSuperpowers/blob/master/docs/AzureSuperpowers.md#exercise---vs-code-interface "Azure Superpowers")* 301 | 1. Visual Studio Code has a rich extensibility model for interacting 302 | with and adding to the tool. The features that Visual Studio Code 303 | includes out-of-the-box are just the start. VS Code extensions let 304 | you add languages, debuggers, and tools to your installation to 305 | support your development workflow. 306 | 307 | 2. You may find an extension for Azure Repos. We do not recommend using 308 | this extension in this workshop. If you already have this extension 309 | installed, please remove it for the duration of this workshop. 310 | 311 | 3. Search for and install the following extension, published by 312 | Microsoft. Once the extension is installed, reload VS Code. 313 | 314 | > Note: Search for extensions on the activity window on the left (bottom icon) 315 | 316 | a. PowerShell (In addition to enhancements to PowerShell, this 317 | extension includes a PowerShell ISE color theme that can found 318 | by selecting File, Preferences, Color Theme) 319 | b. Install the latest available version of the PowerShell 320 | extension, which may be newer than the version shown below. 321 | 322 | ![](./imgs/PSextension.png) 323 | 324 | 4. You will not need any other VS Code extensions for this course. You 325 | may find extensions that attempt to connect you into Git 326 | repositories in Azure DevOps, but they are not needed and have been 327 | found to cause confusion with future steps in this workshop. 328 | 329 | 5. In VS Code, the language support for a file is based on its filename 330 | extension. However, at times you may wish to change language modes 331 | when working in a particular file. To do this, while editing a file, 332 | click on the language indicator - which is located at the bottom of 333 | the VS Code window on the right hand of the Status Bar. This will 334 | bring up the Select Language Mode drop-down where you can select 335 | another language for the current file you are working on. 336 | 337 | ![](./imgs/PS1filetype.png) 338 | 339 | ![](./imgs/PS1filetype2.png) 340 | 341 | 6. Regarding PowerShell authoring in VS Code, you will want to have the 342 | PowerShell extension installed. You will also want to ensure that 343 | when you are working with PowerShell code, you have the VS Code 344 | language set to PowerShell, and you will want to use the PowerShell 345 | Integrated Console. **You will need have at least one PowerShell file 346 | open in VS Code for the PowerShell Integrated Console to appear.**
347 | 348 | ![](./imgs/PS1filetype3.png) 349 | 350 | 1. Operating in this configuration will provide you with the best 351 | PowerShell experience, and enable familiar options from the 352 | PowerShell ISE, such as pressing F8 to execute a selected area of 353 | code. 354 | 355 | 2. **NOTE:** When it comes to authoring PowerShell code in this course, 356 | we recommend that you type your commands in the top editor window, 357 | and use the F8 key to execute your code. Typing your code in the 358 | editor window allows you to save the commands you type throughout 359 | this course so you can easily refer to them later. The top editor 360 | window also enables you to be able to select and execute multiple 361 | lines of PowerShell. 362 | 363 | ![](./imgs/PS1filetype4.png) 364 | 365 | ##
Troubleshooting
366 | 367 | **Azure PowerShell**
368 | We have seen issues in previous workshops if a system has multiple 369 | versions of the Azure PowerShell module installed. If you run into 370 | module related issues, remove **all Azure modules** from\ 371 | C:\\Program Files\\WindowsPowerShell\\Modules and install the Azure 372 | module again. 373 | 374 | While it is technically possible to have both the Az and AzureRM 375 | PowerShell modules installed, we recommend removing the AzureRM modules 376 | and using only the Az modules. 377 | 378 | The Az PowerShell module requires .Net Framework Runtime 4.7.2 or higher 379 | ___ 380 | - [Next Lab](/docs/labs/2-Configure_your_DevOps_Environment.md) 381 | - [Back to all modules](/docs/labs/README.md) 382 | ___ 383 | ___ 384 | 385 | **Azure subscriptions** 386 | 387 | TRIAL SUBSCRIPTIONS ARE NOT SUPPORTED FOR THIS WORKSHOP -------------------------------------------------------------------------------- /docs/labs/2-Configure_your_DevOps_Environment.md: -------------------------------------------------------------------------------- 1 | ## Lab 2 - Configure your DevOps Environment 2 | -------------------------------- 3 | 4 | [Back to all modules](/docs/labs/README.md) 5 | 6 | | Lab Description | This lab covers the configurations and environment creation for DevOps deployments. | 7 | | :------------ | :-------------- | 8 | | Estimated Time to Complete | 30 minutes | 9 | | Key Takeaways | 1. Create resource group in Azure for deployment automation | 10 | | | 2. Establish RBAC permissions for resource creation | 11 | | | 3. Setup permissions and service principals for continuous deployments in Azure DevOps environment | 12 | | | By the end of this lab, you should have: Resource Groups, Service Principal, Azure DevOps Environment, Artifacts needed to complete this workshop 13 | | Author | Shirley MacKay
Frank Garofalo| 14 | 15 | ### Purpose 16 | 17 | This lab will create the environment for the CI/CD process. Service Principals are leveraged to allow permission to deploy or update resources in certain environments for a specific purpose. The Service Connection uses a Service Principal's permissions which are based off of RBAC. It gives Administrators better control over their environment while allowing the engineers the ability to focus on their code. 18 | 19 | **Summary** 20 | * [Setup Up Azure Environment](#exercise---setup-azure-environment) 21 | * [Azure AD Service Principal](#exercise---setup-permissions) 22 | * [Setup Azure DevOps Environment](#exercise---set-up-azure-devops-environment) 23 | * [Push files to your Azure DevOps Repo](#exercise---push-files-to-your-repo) 24 | 25 | ##
Exercise - Setup Azure Environment
26 | 27 | ### Create Azure Resource groups 28 | 29 | 30 | > Perform the tasks below either via the **Portal** or **PowerShell**. 31 | > Create two resource groups one for **Dev** and **Prod** 32 | > Example naming convention: {name}-prod, {name}-dev 33 | 34 | #### Prerequisites 35 | 1. Active Azure Subscription 36 | 1. TRIAL SUBSCRIPTIONS ARE NOT SUPPORTED FOR THIS WORKSHOP 37 | 2. Live workshops may have an Azure Pass Promo Code 38 | 1. Redeem your **Promo Code** for activating your Azure Subscription, go to the following link: [Click here](https://www.microsoftazurepass.com/Home/HowTo?Length=5) 39 | 3. Azure DevOps account 40 | 1. If you do not have an account Sign up for free using [Windows Live ID](https://account.microsoft.com/account) or Github 41 | 42 | ![](./imgs/devops-signup.png) 43 | 44 | > #### **Portal** 45 | 1. Login to **https://portal.azure.com** 46 | 2. Select **Resource Groups** from the main menu 47 | 48 | ![](./imgs/resourcegoup.jpg) 49 | 50 | ![](./imgs/resourcegoup2.jpg) 51 | 52 | Create resource groups, **SuperchargeSQL-dev** and **SuperchargeSQL-prod** with the steps below: 53 | 1. Click **+ Add** 54 | 1. Select the **Subscription** 55 | 2. Enter the **Resource Group** name 56 | 3. Select the **Region** 57 | 4. Click **Review + create** 58 | 5. Click **Create** 59 | 2. Click **Refresh** in the portal to see the new resource group 60 | 61 | > #### **PowerShell** 62 | :bulb: Recommend using the **VS Code** IDE for PowerShell script development 63 | 64 | Create **SuperchargeSQL-dev** and **SuperchargeSQL-prod** resource groups with the PowerShell Script below: 65 | 66 | 1. Open **VS Code** 67 | 2. Create a new file 68 | 3. Change the default environment to PowerShell. In the bottom corner of **VS Code**, click on "Plain Text" and type "PowerShell" 69 | 70 | ![](./imgs/ps_vscode.jpg) 71 | 72 | :exclamation: Execute the script below for each resource group 73 | 74 | ```powershell 75 | #You only need to use Login-AzAccount once if you use the same session 76 | #IMPORTANT: The signin window may show up BEHIND the application. Minimize windows to view the signin window. 77 | Login-AzAccount #For Azure Government use: #Login-AzAccount -Environment AzureUSGovernment 78 | 79 | #For 1st script execution update $rg value with: SuperchargeSQL-dev 80 | #For 2nd script execution update $rg value with: SuperchargeSQL-prod 81 | $rg = "" 82 | 83 | #You can use the following cmdlet to obtain the region (location) 84 | #Get-AzLocation 85 | $location = "" #Example: eastus2 86 | 87 | #You can use the following cmdlet to obtain the subscription id 88 | #Get-AzSubscription 89 | Select-AzSubscription –Subscription "" 90 | 91 | New-AzResourceGroup -Name $rg -Location $location 92 | Get-AzResourceGroup -Name $rg 93 | ``` 94 | 95 | ### Create Service Principal 96 | 97 | > Perform the tasks below either via the **Portal** or **PowerShell**. 98 | 99 | :bulb: This lab uses one Service Principal. Typically, a Service Principal is used for each environment: Development, Staging, Production. 100 | 101 | > #### **Portal** 102 | 103 | 1. Login to **https://portal.azure.com** 104 | 2. Select **Azure Active Directory** from the main menu or from **More Services** 105 | ![](./imgs/ad.jpg) 106 | 107 | 3. Select the **App Registrations** blade 108 | 4. Select **+ New registration** 109 | 1. Enter the **Name**: **{your alias}-SuperchargeSQL-SP** 110 | 1. Leave the defaults 111 | 1. Click **Register** 112 | 113 | On the **App Registrations - {Your App Name}** blade 114 | 1. Select the **Certificates & secrets** blade 115 | 1. Select the **+ New client secret** 116 | 1. Enter the **Description** 117 | 1. Click **Add** 118 | 1. Copy the **Value** 119 | 120 | :exclamation: Copy the new **client secret** value and **Application Id** (Overview blade). You won't be able to retrieve it after you perform another operation or leave this blade. Generate a new secret if it is lost it or expires. We recommend using the portal steps to generate a new client secret. 121 | 122 | > #### **PowerShell** 123 | 124 | :bulb: Use the below PowerShell script in a PowerShell file with **VS Code**. Make sure to update the parameter values. 125 | 126 | ```powershell 127 | #You only need to use Login-AzAccount once if you use the same session 128 | #IMPORTANT: The signin window may show up BEHIND the application. 129 | Login-AzAccount #For Azure Government use: #Login-AzAccount -Environment AzureUSGovernment 130 | 131 | #You can use the following cmdlet to obtain the subscription id 132 | #Get-AzSubscription 133 | Select-AzSubscription –Subscription "" 134 | 135 | 136 | $spName = "{your alias}-SuperchargeSQL-SP" 137 | $id = (New-Guid).Guid 138 | $secret = (New-Guid).Guid 139 | 140 | $cred = New-Object Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential 141 | $cred.StartDate = Get-Date 142 | $cred.EndDate = (Get-Date).AddYears(1) 143 | $cred.KeyId = $id 144 | $cred.Password = $secret 145 | New-AzADServicePrincipal -DisplayName $spName -PasswordCredential $cred 146 | 147 | #IMPORTANT: Save the value for $secret, it will be used later 148 | $secret 149 | ``` 150 | 151 | :exclamation: Copy and save the Service Principal Name, Application Id and Secret. You won't be able to retrieve it after you perform another operation or leave this blade. Generate a new secret if it is lost it or expires. We recommend using the portal steps to generate a new client secret. 152 | 153 | 154 | ##
Exercise - Setup Permissions
155 | 156 | ### Access Control (IAM) for the Resource Group(s) 157 | 158 | > Perform the tasks below either via the **Portal** or **PowerShell**. 159 | 160 | > #### **Portal** 161 | 162 | :exclamation: Do the following steps for both resource groups created earlier: 163 | 164 | 1. Go to the resource group 165 | 2. Click on the **Access control (IAM)** blade 166 | 3. Click on **+ Add** 167 | 4. Click on **Add role assignment** 168 | 1. Select the **Owner** role 169 | 2. Enter your Service Principal name in the **Select** box to search 170 | 3. Click **Save** 171 | 5. Click on **Role Assignments** to verify 172 | 173 | > #### **PowerShell** 174 | 175 | :exclamation: Use the below PowerShell Script in a PowerShell file in **VS Code**, executing it twice, once for each resource group. Make sure to update the parameter values 176 | 177 | ```powershell 178 | #You only need to use Login-AzAccount once if you use the same session 179 | #IMPORTANT: The signin window may show up BEHIND the application. 180 | Login-AzAccount #For Azure Government use: #Login-AzAccount -Environment AzureUSGovernment 181 | 182 | #You can use the following cmdlet to obtain the subscription id 183 | #Get-AzSubscription 184 | Select-AzSubscription –Subscription "" 185 | 186 | #For 1st script execution update $rg value with: SuperchargeSQL-dev 187 | #For 2nd script execution update $rg value with: SuperchargeSQL-prod 188 | $spName = '' 189 | $rg = "" 190 | 191 | $app = (Get-AzADServicePrincipal -DisplayName $spName).ApplicationID 192 | New-AzRoleAssignment -ApplicationID $app -ResourceGroupName $rg -RoleDefinitionName 'Owner' 193 | ``` 194 | 195 | ##
Exercise - Setup Azure DevOps Environment
196 | 197 | 198 | #### Azure DevOps Organizations 199 | 200 | 1. Sign in **https://dev.azure.com/** 201 | 2. Navigate to Azure DevOps after signing in 202 | 3. Click on **New Organization** 203 | 1. Confirm and Enter an **organization** name 204 | * The organization name is a DNS name therefore it must be globally unique. 205 | 2. Choose a **Location** 206 | 4. After creation, navigate to your organization **https://dev.azure.com/{yourorganization}** 207 | 208 | 209 | #### Azure DevOps Project - ![](docs/../imgs/Git-Icon.png)Clone Project Repo 210 | 1. Enter your **Project name** 211 | 2. Enter Description (optional) 212 | 3. Select **Private** 213 | 4. Expand the Advanced options 214 | 5. Select **Git** and **Basic** for version control and work item process, respectively. 215 | 6. Click on **+ Create project** 216 | 7. Project name: **SuperchargeSQLDeployments** 217 | 8. Description: **Supercharge SQL Deployments** 218 | 219 | :exclamation: To prevent any confusion later on in the lab it is strongly recommend to name your DevOps project **SuperchargeSQLDeployments**. If you name your project something else make note that some of the lab instructions may not match your path(S) 220 | 221 | ![](./imgs/newproject.jpg) 222 | 223 | 1. Click on **Repos** 224 | 225 | ![](./imgs/repo.jpg) 226 | 227 | 1. Click on **Initialize**
228 | *Default settings to include Add a README* 229 | 230 | 231 | ## Branching 232 | There are many options for a branching strategy and Git gives you the flexibility in how you use version control to share and manage code. It's an important part of DevOps and your strategy is something that your team should come up with. For more information about branching strategies please review [Adopt a Git branching stategy](https://docs.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=azure-devops) docs page. For this workshop we are going to work with just a *dev* and *master* branch. 233 | 234 | 1. Click on Repos to expand the **Repos** submenu 235 | 2. Click on submenu **Branches**
236 | *Notice that your Repo only has a **master** branch, by default new Git Repos only have a **master** branch*
237 | 238 | ![](./imgs/ReposBranchs.png) 239 | 240 | 3. Click **New branch** 241 | 4. Enter Name: **dev** 242 | 5. Click **Create** 243 | 6. Click on the ellipse on the **master** branch to expose more options 244 | 7. Click **Branch policies** 245 | 246 | ![](./imgs/RepoBranchPolicies.png) 247 | 248 | 8. You are now going to set a policy to Protect your **master** branch
249 | *This is to keep people from accidentally checking dev code into master/prod branch* 250 | 1. Select **Require a minimum number of reviewers** 251 | 2. Change the minimum number of reviewers to **1** 252 | 3. Select **Requestors can approve their own changes** 253 | 4. Save changes 254 | 255 | ![](./imgs/RepoMasterBranchPolicies.png) 256 | 257 | 1. Click on **Branches** 258 | 2. Notice that your master branch, now has a Branch Policy icon on it. 259 | 260 | ![](./imgs/RepoMasterBranchPoliciesIcon.png) 261 | 262 | ## DevOps Service Connection with Azure Resource Manager 263 | 264 | 1. Select the **Project Settings** 265 | 266 | ![](./imgs/projectsettings.jpg) 267 | 268 | 2. Select **Service Connections** under **Pipelines** 269 | 3. Create a new **Service Connection** 270 | 4. Select **Azure Resource Manager** and **Next** 271 | 5. Select **Service Principal (Manual)** and **Next** 272 | 273 | Enter the following: 274 | 275 | 1. Enter **Service connection name**: Supercharge SQL Service Connection 276 | 2. Select Environment 277 | 3. Select Scope level **Subscription** 278 | 4. Enter **Subscription Id**
279 | ```PowerShell 280 | Get-AzSubscription 281 | #Returns Subscription Name, Id, TenantId and State 282 | ``` 283 | 5. Enter **Subscription Name** (Found in Resource Group > Overview blade) 284 | 6. Enter **Service Principal Id** ([Value noted earlier](#create-service-principal)) 285 | 7. Select Credential **Service principal key** 286 | 8. Enter **Service principal key** ([Value noted earlier](#create-service-principal)) 287 | 9. Enter **Tenant ID** (Found in Azure Active Directory > properties blade) 288 | 10. Click on **Verify** 289 | 13. Click on **Verify and Safe** 290 | 291 | ##
Exercise - Push files to your Repo
292 | Your repository is currently empty, except for the default README.md file that was created to initialize your repo. In this exercise you are going to use Git commands to clone down the source files needed for this lab and push them up to your repo. 293 | 294 | 1. Using the TERMINAL in VS Code or Git Bash 295 | 2. Run the following Git command to clone this Github Repo
296 | 297 | ```Bash 298 | 299 | git clone https://github.com/microsoft/SuperchargeAzureSQLDeployments.git c:/SuperchargeAzureSQL 300 | 301 | ``` 302 | 3. In a browser navagate to your Azure DevOps Project that you created above. 303 | 1. Click on **Repos** 304 | 2. Click **Files** 305 | 3. Click the **Clone** button 306 | 307 | ![](./imgs/Clone.png)
308 | 309 | 1. Copy the Command line **HTTPS** URL for your repo by clicking on the copy icon 310 | 311 | ![](./imgs/CloneCopy.png) 312 | 313 | 2. Back in VS Code hit the **F1** key to open the command pallet 314 | 3. Type **Git: Clone** and hit enter 315 | 4. Paste the Repository URL for your Azure DevOps Repo > Press Enter on your keyboard 316 | 5. Navigate to your **C:\\** drive 317 | 6. Click the **Select Repository Location** button 318 | 1. You may be asked to provide your Microsoft account 319 | 2. Use your Microsoft account used to login to Azure DevOps 320 | 3. Open that repository in VS Code, if prompted 321 | 322 | ![](./imgs/clone-cdrive.png) 323 | 324 | 7. Using windows explore navigate to the the **source** directory in the cloned GitHub repo 325 | * **C:\\SuperchargeAzureSQL\\source\\**
326 | 327 | ![](./imgs/sourcedir.png) 328 | 329 | 8. Copy both directories: DatabaseProjects & Deployments 330 | 9. Using windows explore navigate to your cloned Azure DevOps repo 331 | * **C:\\SuperchargeSQLDeployment**
332 | 10. Paste the copied directories from step 11 into your cloned Azure DevOps repo 333 | 11. The above steps should result with the following: 334 | 335 | ![](./imgs/copiedsource.png) 336 | 337 | 12. Copy the **.gitignore** file from: 338 | - **C:\\SuperchargeAzureSQL\\** 339 | 340 | :exclamation: Note that **SuperchargeAzureSQL** is the name of your project in Azure DevOps, you do not create this directory when you clone a repo. Git creates the directory as the root of your local repository. It uses the name of your project from Azure DevOps. If you named your project something different, your path will be: **C:\\{your DevOps Project name}** 341 | 342 | ![](./imgs/gitignore.png) 343 | 344 | > If you do not see the file enable: **File name extensions** and **Hidden items** from the **View** menu in explorer 345 | 346 | ![](./imgs/explore-hidden.png) 347 | 348 | 13. Paste the file into: 349 | - **C:\\SuperchargeSQLDeployments** 350 | 351 | ![](./imgs/explore-gitignore.png) 352 | 353 | ## Performing your initial Commit using VS Code 354 | 355 | 1. In VS Code from the menu click **File** > **Open Folder** 356 | 2. Navigate to your Cloned Azure DevOps Repo: **C:\SuperchargeSQLDeployments** (If not already in this directory) 357 | 3. Click on the Git icon from the left side menu 358 | 1. Notice that is shows a number on the icon 359 | 2. This is the number file files that have not been committed to your local Git repository for your Azure DevOps project 360 | 4. Make sure your are working off of the Dev branch 361 | 1. Click on **master** from the bottom left of VS Code
362 | 363 | ![](./imgs/master.png) 364 | 365 | 2. Select **dev**
366 | 1. If you haven’t previously selected the dev branch you may need to choose **origin/dev** 367 | 368 | ![](./imgs/devSelect.png) 369 | 370 | 3. You should now be in your *dev* branch
371 | 372 | ![](./imgs/dev.png) 373 | 374 | 5. Click on the + that shows up when you hover over **CHANGES** 375 | * This will **stage** all changes in your repo to be committed 376 | * You can also pick and choose which files you want to stage, for this workshop we want all of the initial files staged to be committed
377 | 378 | ![](./imgs/stagefiles.png) 379 | 380 | 6. Type a message for the initial commit in the **Message** box (ie. initial commit) 381 | 7. Click the Check mark to perform the commit. 382 | 383 | ![](./imgs/vscode-check.png) 384 | 385 | :exclamation: If you receive an error message **Make sure you configure your 'user.name' and 'user.email' in git.** Click Cancel on the error message 386 | 387 | - Open the Terminal in VS Code 388 | - Run the following commands, **filling in your own name and email address** 389 | 390 | > git config --global user.name "Your Name"
391 | > git config --global user.email "you@example.com"
392 | 393 | - Run your commit again (Step 6.) 394 | 7. You now have commited all of the changes to your local Git Repo, notice that the Git icon in the left side menu does not show any numbers. 395 | 8. Notice that you have changes to push up to your remote Git repo (Azure DevOps Repo
396 | 397 | ![](./imgs/push.png) 398 | 399 | 1. Click on the **sync** icon in the bottom left to perform a Git pull & Git push 400 | * You can also run the following Git command 401 | >git push 402 | 2. You may see a *Visual Studio Code* pop up window that says: *This action will push and pull commits to and from 'origin/dev'.* 403 | - Click **OK** 404 | 405 | ![](./imgs/vscode-sync-message.png) 406 | 407 | 3. After the push completes you may receive the following message dialog: 408 | 409 | ![](./imgs/vs-git-fetch.png) 410 | 411 | - This is an option setting, when working on a team with multiple developers it is recommend to set this to **Yes** 412 | 413 | 4. Using a browser navigate to your Azure DevOps project 414 | 5. Click on **Repos** > **Files** 415 | 6. You should now see all of the files in your repo 416 | 1. You may need to select the ‘dev’ branch to see the new files 417 | 418 | ![](./imgs/remotefiles.png) 419 | ___ 420 | - [Next Lab](/docs/labs/3-AzureResourceDeployment.md) 421 | - [Back to all modules](/docs/labs/README.md) 422 | ___ 423 | ___ 424 | **Azure subscriptions** 425 | 426 | TRIAL SUBSCRIPTIONS ARE NOT SUPPORTED FOR THIS WORKSHOP 427 | -------------------------------------------------------------------------------- /docs/labs/4-DatabaseLifecycleManagement.md: -------------------------------------------------------------------------------- 1 | ## Lab 4 - Database life cycle management (DLM) 2 | -------------------------------- 3 | 4 | [Back to all modules](/docs/labs/README.md) 5 | 6 | [comment]: <> (Lab header table provide values for lab) 7 | 8 | | Lab Description: | This lab covers database life cycle management. | 9 | | :------------ | :-------------- | 10 | | Estimated Time to Complete: | 60 | 11 | | Key Takeaways: |By the end of this lab, you should understand how to implement database life cycle management. Having a good grasp on the key princples of DLM:| 12 | | |SSDT Database projects | 13 | | |Create & configure build & release pipelines (CI/CD) for database change management | 14 | | Author(s): | Frank Garofalo | 15 | 16 | [comment]: <> (Write up purpose for this lab, provide some info on the what and why) 17 | ### Purpose 18 | 19 | This module is designed to build upon the skills you have learned thus far, and apply them to Database Life cycle Management (DLM). It walks through all of the core concept of DLM, providing you will a full working DLM PoC. 20 | 21 | **Summary** 22 | - [Initial SSDT project setup](/docs/labs/4-DatabaseLifecycleManagement.md#initial-ssdt-project-setup) 23 | - [Get to know SSDT database projects](/docs/labs/4-DatabaseLifecycleManagement.md#get-to-know-ssdt-database-projects) 24 | - [Build your database project](/docs/labs/4-DatabaseLifecycleManagement.md#build-your-database-project) 25 | - [Load data to your local DB](/docs/labs/4-DatabaseLifecycleManagement.md#load-data-your-local-db) 26 | - [Dev Database build pipeline (CI)](/docs/labs/4-DatabaseLifecycleManagement.md#exercise---dev-database-build-pipeline-ci) 27 | - [Dev Database Release Pipeline (CD)](/docs/labs/4-DatabaseLifecycleManagement.md#exercise---dev-database-release-pipeline-cd) 28 | - [Configure Azure SQL DacpacTask](/docs/labs/4-DatabaseLifecycleManagement.md#configure-azure-sql-dacpactask) 29 | - [Challenge - Firewall rule](/docs/labs/4-DatabaseLifecycleManagement.md#challenge---firewall-rule) 30 | - [Postdeployment Script (CI)](/docs/labs/4-DatabaseLifecycleManagement.md#exercise---postdeployment-script-ci) 31 | - [Configure prod CI/CD - Challenge](/docs/labs/4-DatabaseLifecycleManagement.md#exercise---postdeployment-script-ci) 32 | 33 | [comment]: <> (Main Exercise format) 34 | ##
Exercise - Review SSDT database project
35 | 36 | In this exercise you are going to review a database project for a simple demo style database. 37 | 38 | ### Initial SSDT project setup 39 | 40 | 1. Launch Visual Studio 2019 41 | 1. If this is the first time launching Visual Studio it may ask you to sign in. If you have an MSDN account we recommend signing in. If not, feel free to select *Not now, maybe later.* 42 | 2. You maybe asked select the development Settings, and a color theme. We recommend General, and the theme of your choice. 43 | 2. Click on **Open a project or solution** 44 | 3. Navigate to: **C:\SuperchargeSQLDeployments\DatabaseProjects\trainingDW** 45 | 4. Select the solution file: **trainingDW.sln** 46 | 5. Click on **master** in the bottom right corner > **Manage Branches** 47 | 48 | ![](./imgs/ssdt-master.png) 49 | 50 | 6. Ensure you are working with the **dev** local branch. 51 | 1. Expand **remotes/origin** > select **dev** (you may need to dbl click to select it) 52 | The **dev** branch should now be in your local Git dir 53 | 54 | ![](./imgs/ssdt-dev.png) 55 | 56 | :bulb: Just like in VS Code you will want to develop & edit in the **dev** branch. **Master** is configured only to be updated from pull requests. 57 | 58 | ### Get to know SSDT database projects 59 | 1. In the **Solution Explorer** right click on **trainingDW** > **Properties** 60 | 1. From here you can set and configure settings for your project 61 | 2. Notice your **Target platform:** is set to **Microsoft Azure SQL Database** 62 | 3. Click on the arrow to view other Target platforms available (leave it as Azure SQL DB) 63 | 2. Click on the **Database Settings...** button 64 | 65 | ![](./imgs/ssdt-db-settings.png) 66 | 67 | 3. Click through the **Common**, **Operational**, and **Miscellaneous** tabs 68 | 1. Notice that **Database collation** is the only setting you can change. This is because your target platform is set to **Microsoft Azure SQL Database** 69 | 2. Spend a couple minutes changing the Target Platform and then reviewing the **Database Settings...** that are available to configure 70 | 3. Make sure to set **Target platform:** back to **Microsoft Azure SQL Database** 71 | 4. Close the **trainingDW Project Setting** 72 | 5. In the **Solution Explorer** expand **trainingDW** 73 | 6. Expand folder **dim** 74 | 1. Notice the folder structure: Tables, Views 75 | 2. Database projects are designed to work in a folder structure to organize your schema, similar to what you see via SSMS 76 | 3. Expand **dim** > **Tables** 77 | 4. Notice how each file is named: **schema.tableName.sql** (each database object is stored as a SQL script) 78 | 5. Click on **dim.Attendee.sql** to open it. 79 | 6. Spend a minute to review (you can edit in the designer or T-SQL) 80 | 81 | ![](./imgs/ssdt-tablescript.png) 82 | 83 | 7. Close **dim.Attendee.sql** 84 | 8. Right click on **dim.Attendee.sql** > Hover over Refactor 85 | 86 | ![](./imgs/ssdt-refactor1.png) 87 | 88 | 9. Note the options you can use to refractor your scripts 89 | 10. Click on **Fully-qualify Names..** 90 | 11. Review how this option can quickly refactor your script to use *Fully Qualified Names* 91 | 12. Click **Cancel** 92 | 93 | ![](./imgs/ssdt-refactor2.png) 94 | 95 | 13. From the main Visual Studio menu bar click **View** > **SQL Server Object Explorer** 96 | 97 | ![](./imgs/ssdt-sqlexplorer.png) 98 | 99 | 14. Expand **Projects - trainingDW** > **Tables** > Right click on: **dim.Attendee** 100 | 15. Hover over **Refactor** 101 | 16. Notice you have additional refactoring options 102 | 1. Feel free to click through each to see how they work (**do not apply the changes**) 103 | 104 | ![](./imgs/ssdt-refactor3.png) 105 | 106 | 17. Close any open windows 107 | 18. Open file: **trainingDW.refactorlog** from **Solution Explorer** 108 | 1. Note that all refactored changes are logged and can be reviewed. This is a nice option to have if you need to check what changed in your database quickly from the last deployment. 109 | 2. Close **trainingDW.refactorlog** 110 | 111 | ### Build your database project 112 | 113 | 1. From the **Solution Explorer** right click on **trainingDW** > Click on **Build** 114 | 115 | ![](./imgs/ssdt-build.png) 116 | 117 | 2. Expected Result 118 | 119 | ![](./imgs/ssdt-build-result.png) 120 | 121 | :exclamation: In order to deploy database projects it has to be able to build. When the project builds it generates a **dacpac** which is used by sqlpackage.exe to deploy schema. 122 | 123 | 3. In the **SQL Server Object Explorer** expand **SQL Server** > (localdb)\ProjectsV13... > **Databases** 124 | 4. After a successfully **build** you will have a local version of your database which you can use for local testing. 125 | 126 | :exclamation: If your database does not get added you can right click on Database and create new database. Name it **trainingDW** or hit F5 to deploy the full code package with all objects. 127 | 128 | 129 | ![](./imgs/ssdt-localdb.png) 130 | 131 | 1. Expand **trainingDW** > **Tables** 132 | 1. Notice there are no tables or any schema in this local version. 133 | 2. The build process only creates a blank database 134 | 2. From the **Solution Explorer** > Right click on **trainingDW** > **Schema Compare...** 135 | 3. Your source should be pre-populated with the DB project 136 | 4. Click on the drop down arrow next to ***Select Target*** > **Select Target** 137 | 138 | ![](./imgs/ssdt-compare-target.png) 139 | 140 | 9. Select Target Schema > Database: > Select Connection 141 | 142 | ![](./imgs/ssdt-select-target.png) 143 | 144 | 10. Click on the **Browse** Tab 145 | 11. Expand **Local** > **ProjectsV13** 146 | 12. Set Database Name: **trainingDW** 147 | 13. Click **Connect** 148 | 149 | ![](./imgs/ssdt-localdb-connection.png) 150 | 151 | 13. Click **OK** on **Select Target Schema** window 152 | 14. Click on the **Gear** icon from the Compare menu 153 | 154 | ![](./imgs/ssdt-compare-gear.png) 155 | 156 | 15. Clink on the **General** and **Object Types** tabs and review the options you can enable/disable for your schema compare. 157 | 16. Leave all values default > Click **Cancel** 158 | 17. Click **Compare** 159 | 18. Review results 160 | 19. Click the **Update** button > **Yes** 161 | 20. From **SQL Server Object Explorer** review the **trainingDW** 162 | 1. Notice that now all of your schema changes from your DB project is updated in your local version of **trainingDW** 163 | 2. This is a light weight way to test your development before committing changes to Git and pushing to Azure DevOps 164 | 21. Close **SQLSchemaCompare** > **Don't Save** 165 | 166 | ### Load data your local DB 167 | 168 | 1. From **Solution Explore** 169 | 2. Expand the **Scripts** folder > dbl Click on **LoadDateDim.sql** 170 | 3. Notice you are connected to the local copy of **trainingDW** 171 | 172 | ![](./imgs/ssdt-load-data.png) 173 | 174 | 4. Execute script 175 | 176 | ![](./imgs/ssdt-execute-script.png) 177 | 178 | 5. Close **LoadDateDim.sql** 179 | 6. From **SQL Server Object Explorer** > right click on **trainingDW** > **New Query** 180 | 181 | ![](./imgs/ssdt-localdb-query.png) 182 | 183 | 7. Execute the below T-SQL to test that your script loaded the dim.date 184 | 185 | ```T-SQL 186 | 187 | Select count(*) as dimDateCount From dim.Date 188 | 189 | Select top 10 * From dim.Date 190 | 191 | ``` 192 | 193 | :bulb: This is an easy way to test scripts locally before you deploy changes to your Azure dev environment. 194 | 195 | 1. Close **SQLQuery1.sql** > **Don't Save** 196 | 197 | ##
Exercise - Dev Database Build Pipeline (CI)
198 | 199 | 1. Using a browser navigate to your Azure DevOps project 200 | 2. Navigate to **Pipelines** > **Pipelines** 201 | 3. Click the **New pipeline** button 202 | 4. Click on **Use the classic editor** 203 | 5. Select a source: **Azure Repos Git** 204 | 6. Set **Default branch for manual and scheduled builds** to **dev** 205 | 7. Click **Continue** 206 | 8. Click **Empty job** 207 | 9. Name: **Dev - Azure SQL Deployments-CI** 208 | 209 | ![](./imgs/db-dev-ci.png) 210 | 211 | 10. Click on the Agent job 1 and update the following setting: 212 | 1. Display name: **Build trainingDW database** 213 | 11. Click on the **+** icon to add a new task 214 | 1. Search for: **Visual Studio build** 215 | 2. Click the **Add** button on the Visual Studio build 216 | 217 | ![](./imgs/db-dev-vsbuild.png) 218 | 219 | 12. Click on the newly added **Visual Studio build** task and update the following settings: 220 | 1. Display name: **Build solution trainingDW/trainingDW.sln** 221 | 2. Solution: **DatabaseProjects/trainingDW/trainingDW.sln** 222 | 3. Platform: **$(BuildPlatform)** 223 | 4. Configuration: **$(BuildConfiguration)** 224 | 5. Check mark **Clean** 225 | 226 | 13. Click on the **+** icon to add a new task 227 | 1. Search for: **Publish build artifacts** 228 | 2. Click **Add** 229 | 230 | ![](./imgs/db-dev-ci-publisharts.png) 231 | 232 | 14. Click on the newly added **Publish build artifacts** task and update the following settings: 233 | 1. Display name: **Publish Artifact: trainingDW-drop** 234 | 2. Path to publish: **DatabaseProjects** 235 | 3. Artifact name: **trainingDW** 236 | 15. Click on **Variables** > add the following: 237 | 1. **BuildConfiguration**: **release** 238 | 2. **BuildPlatform**: **any cpu** 239 | 240 | ![](./imgs/db-dev-build-vars.png) 241 | 242 | 16. Click **Triggers** to configure continuos integration 243 | 1. Enable continuous integration 244 | 2. Branch filter: **dev** 245 | 3. Add Path filter: **Include**: **DatabaseProjects** 246 | 4. Add Path filter: **Exclude**: **Deployments** 247 | 248 | ![](./igs/../imgs/db-dev-triggers.png) 249 | 250 | :bulb: The include and exclude filters set to make sure that continuous integration only kicks off when there has been changes committed for the database project. 251 | 252 | 17. Click **Options** 253 | 18. Update Build number format to: 254 | ``` 255 | $(date:yyyyMMdd)_$(BuildDefinitionName)_$(SourceBranchName)$(rev:.r) 256 | ``` 257 | 258 | 19. Click **Save & queue** > **Save** (Comment optional) > **Save** 259 | 20. Click **Queue** > **Run** 260 | 21. Click into **Build trainingDW database** in the jobs section to view the status of your build 261 | 262 | **Expected result** 263 | 264 | ![](./imgs/db-dev-build.png) 265 | 266 | **You now have a working CI Pipeline to build your SSDT Database project** 267 | 268 | ##
Exercise - Dev Database Release Pipeline (CD)
269 | 270 | ### Setup Key Vault Library 271 | 272 | 1. In your Azure DevOps project click on **Pipelines** > **Library** 273 | 2. Click **+ Variable group** 274 | 275 | ![](./imgs/dlm-lb-keys.png) 276 | 277 | 3. Variable group name: **SuperchargeSQL-KeyVault-dev** 278 | 4. Description: **Dev Key Vault linked secrets** 279 | 5. Enable **Link secrets from an Azure key vault as variables** 280 | 1. Select Azure subscription: **Use your Service Connection** (created when you setup Azure DevOps) 281 | 2. Key vault name: **Select your dev vault** 282 | 3. Click **+ Add** under the Variables section 283 | 284 | ![](./imgs/dlm-lb-keys2.png) 285 | 286 | 4. Select both secrets: **SQLadminLogin** & **SQLadminPass** 287 | 5. Click **Ok** button 288 | 289 | ![](./imgs/dlm-lb-keys3.png) 290 | 291 | 6. Click **Save** 292 | 293 | ![](./imgs/dlm-lb-keys4.png) 294 | 295 | ### Dev Release pipeline 296 | 297 | 1. In your Azure DevOps project click on **Pipelines** > **Releases** 298 | 2. Click on the **Create release** 299 | 300 | ![](./imgs/dlm-cd-new.png) 301 | 302 | 3. Click **Empty job** 303 | 304 | ![](./imgs/dlm-cd-emptyjob.png) 305 | 306 | 4. Update **Stage name**: **Dev: trainingDW DB** 307 | 5. Click on the **X** to close Stage 308 | 309 | ![](./imgs/dlm-rename-dev.png) 310 | 311 | 6. Click on **New release pipeline** to rename to: **dev-AzSQLDatabase-CD** 312 | 313 | ![](./imgs/dlm-cd-rename.png) 314 | 315 | 7. Click **+ Add** next to Artifacts 316 | 8. Source type: **Build** 317 | 9. Source (build pipeline): **Dev - Azure SQL Deployments-CI** 318 | 10. Click **Add** 319 | 320 | ![](./imgs/dlm-dev-cd-artifact.png) 321 | 322 | 11. Click on the **Lighting bolt** icon to configure Continuous deployment 323 | 1. Set to **Enabled** 324 | 2. Add Build branch filterers: 325 | - Type: **Include** 326 | - Build branch: **dev** 327 | - Click on **X** to close CD trigger 328 | 329 | ![](./imgs/dlm-dev-cd-trigger.png) 330 | 331 | 12. Click on the **1 job 0 task** and then the **Tasks** tab 332 | 13. Click the **+** icon next to Agent job 333 | 334 | ![](./imgs/dlm-cd-add-task.png) 335 | 336 | 14. Search for **Azure Sql Database** 337 | 15. Click **Add** from the **Azure SQL Database deployment** task 338 | 339 | ![](./imgs/dlm-dev-cd-sql.png) 340 | 341 | ### Configure Azure SQL DacpacTask 342 | 343 | 1. Click on your newly added Azure SQL to configure 344 | 2. Display name: **Azure SQL Deployment Report** 345 | 3. Azure Subscription: **Your service Connection** 346 | 4. Azure SQL Server: 347 | 348 | ``` 349 | "$(sql.serverName)-$(rEnv).$(endpoint)" 350 | ``` 351 | 5. Database: **trainingDW** 352 | 6. Login: **$(SQLadminLogin)** 353 | 7. Password: **$(SQLadminPass)** 354 | 355 | :exclamation: Note the the SQL auth credentials are populdate form the linked Key Vault Values. This keeps your credentials from being exposed. 356 | 357 | 8. Deployment type: **SQL DACPAC File** 358 | 9. Action: **Deploy Report** 359 | 360 | :bulb: Note that you are creating a deployment report with this task. **Deploy Report** creates an XML report of the changes that would be made by a publish action. This can be used for change tracking, deployment approval, ect. 361 | 362 | 10. DACPAC File: 363 | 364 | ``` 365 | $(System.DefaultWorkingDirectory)/_Dev - Azure SQL Deployments-CI/trainingDW/trainingDW/trainingDW/bin/Release/trainingDW.dacpac 366 | ``` 367 | 11. Click **Save** > (Comment optional) > **Save** 368 | 12. Settings should look similar to this: 369 | 370 | ![](./imgs/dlm-cd-sql-task.png) 371 | 372 | 14. Right click on **Azure SQL Deployment Report** task > Select **Clone task(s)** 373 | 374 | ![](./imgs/dlm-cd-dev-clonetask.png) 375 | 376 | 15. Click on the newly cloned task **Azure SQL Deployment Report copy** and update the following settings: 377 | 1. Display name: **Azure SQL Schema change script** 378 | 2. Action: **Script** 379 | 380 | :bulb: Note that action type of **Script** creates the SQL script of all changes that will be deployed. This can be treated like a schema compare script for your logs, change tracking, approval flows, ect.. 381 | 382 | 14. Right click on the **Azure SQL Schema change script** task > Select **Clone task(s)** 383 | 15. Click on the newly cloned task **Azure SQL Schema change script copy** and update the following settings: 384 | 1. Display name: **Azure SQL DB deployment** 385 | 2. Action: **Publish** 386 | 387 | :bulb: Note that action type of **Publish** updates the target database to match the schema of the source .dacpac file generated from your build (CI) pipeline. 388 | 389 | 16. Click **Save** > (Comment optional) > **OK** 390 | 391 | **Your pipeline tasks should look similar to this:** 392 | 393 | ![](./imgs/dlm-cd-dev-tasksall.png) 394 | 395 | 17. Click on the **Variables** tab of your pipeline 396 | 18. Click **+ Add** 397 | - Name: **rEnv** 398 | - Value: **dev** 399 | - Scope: **Release** 400 | 19. Click **+ Add** 401 | - Name: **endpoint** 402 | - Value: **database.windows.net** 403 | - *If your SQL logical server is in Azure Gov use: **database.usgovcloudapi.net*** 404 | - Scope: **Release** 405 | 406 | ![](./imgs/dlm-cd-dev-rEnv.png) 407 | 408 | 1. Click on **Variable groups** 409 | 1. Click on **Link variable group** 410 | 2. Select: **SuperchargeSQL-KeyVault-dev** 411 | 3. Click the **Link** button 412 | 4. Click on **Link variable group** again 413 | 5. Select: **SuperchargeSQL-Vars** 414 | 6. Click the **Link** button 415 | 416 | ![](./imgs/dlm-cd-linked-vars.png) 417 | 418 | 20. Click **Save** > (Comment optional) > **OK** 419 | 21. Click on the **Pipeline** tab, your pipeline should look similar to: 420 | 421 | ![](./imgs/dlm-cd-dev-CD.png) 422 | 423 | :exclamation: At this point you have a fully configured release pipeline for your **development** work. 424 | 425 | 1. Using the skills you have learned to this point perform the following: 426 | 1. Manually create a release from Azure DevOps 427 | 2. Review all logs from the release 428 | 1. You will need to **Download all logs** to review 429 | 3. Spend some time looking at the Deployment Report (trainingDW_DeployReport.xml) 430 | 1. You will need to **Download all logs** to review 431 | 4. Spend some time reviewing schema change script (trainingDW_Script.sql) 432 | 433 | ### Challenge - Firewall rule 434 | 435 | If you try to connect to your SQL Database with SSMS or Azure Data Studio using AAD auth, you will notice that there is no firewall rule configured. 436 | 437 | 1. Try to connect to your SQL Database using SSMS or Azure Data Studio 438 | 1. Using your AAD account 439 | 2. Do not create the firewall rule when asked > click **Cancel** 440 | 441 | ![](./imgs/ssms-firewall.png) 442 | 443 | **Create a new firewall rule, no cheating with the portal** 444 | 445 | 1. Create a firewall rule by updating file: **sql_db.parameters.dev.json** 446 | 1. To find your current IP in a browser navigate to: http://ifconfig.me/ip 447 | 448 | 2. Commit your changes and sync or push them up your Azure DevOps dev branch 449 | 3. Review your dev Build and dev release pipelines 450 | 1. Notice the build pipeline ran right after pushing your changes to your dev branch 451 | 2. Your release should be triggered, once the build pipeline completes 452 | 4. Connect using SSMS or Azure Data Studio 453 | 1. You should now be able to connect 454 | 455 | ##
Exercise - Postdeployment Script (CI)
456 | 457 | With SSDT DB projects you can make use of **predeployment** and **postdeployment** scripts. This is very useful if you need to move data around before and after schema changes. You can also use this type of process for your *DataOps* processes 458 | 459 | 1. Inside of your Visual Studio SSDT project 460 | 2. From the Solution Explorer, right click **Scripts** folder 461 | 3. Click **Add** > **Script...** 462 | 4. Select **Post-Deployment Script** 463 | 1. Name: **postLoad-dimDate.sql** 464 | 2. Click **Add** 465 | 5. Add the following to the script, right below the comments: 466 | 467 | ```SQL 468 | TRUNCATE TABLE [DIM].[DATE] 469 | GO 470 | 471 | ``` 472 | 6. Open **LoadDateDim.sql** 473 | 7. Copy contents of file and paste it below your *TRUNCATE* statement 474 | 475 | ![](./imgs/postload-datedim.png) 476 | 477 | - postLoad-dimDate.sql should look like this: 478 | 479 | ![](./imgs/postload-script.png) 480 | 481 | 1. Save and close file: **Post-Deployment Script** 482 | 2. Close the **LoadDateDim.sql** file 483 | 3. In SSMS or Azure Data Studio query **dim.Date** notice no values are returned 484 | 4. Back in your Visual Studio SSDT project 485 | 5. Click on the **pencil** icon on the bottom of SSDT (Visual Studio) 486 | 487 | ![](./imgs/commit-ssdt.png) 488 | 489 | 13. Click the **+** icon next to **Changes** to stage all changes 490 | - If prompted to Save changes click **Yes** 491 | 492 | ![](./imgs/ssdt-stage.png) 493 | 494 | 14. Enter commit: **post load script** 495 | 15. Click **Commit Staged** button 496 | 497 | ![](./imgs/ssdt-commit-staged.png) 498 | 499 | 16. Click **Sync** 500 | 501 | ![](./imgs/ssdt-Synce.png) 502 | 503 | 17. Click **Push** under **Outgoing Commits** 504 | 505 | ![](./imgs/ssdt-git-push.png) 506 | 507 | 18. Navigate to your Azure DevOps project 508 | 19. Review your CI/CD pipelines checking status and logs 509 | 20. Once completed query **dim.Date** again 510 | 21. You should now have values in **dim.Date** 511 | 512 | At this point you now have a fulling working CI/CD pipeline for database development. 513 | 514 | ##
Exercise - Configure prod CI/CD - Challenge
515 | 516 | Using all your new skills learned in this workshop, create and configure the following: 517 | 518 | 1. Create & configure a prod build pipeline (CI) for your SSDT Project 519 | 1. using your **master** branch 520 | 2. Create & configure a prod release pipeline (CD) 521 | 1. Include both: **dev** & **prod** stages 522 | 2. Add an approval gate after the **dev** stage before the **prod** stage. (You need to approve prod before it processes) 523 | 3. use your **master** branch 524 | 4. it should be triggered from a **pull request** dev to prod 525 | 3. Review the status and logs of your prod pipeline 526 | 4. Verify schema changes made it all they way through to prod Azure SQL DB 527 | 528 | :bulb: Use the past labs and your already built pipelines for reference if you get stuck. 529 | 530 | ### Congratulations you have completed Supercharge your Azure SQL deployments by operationalizing Azure with DevOps 531 | ___ 532 | - [Home](/README.md) 533 | - [Back to all modules](/docs/labs/README.md) 534 | ___ 535 | ___ 536 | -------------------------------------------------------------------------------- /docs/labs/README.md: -------------------------------------------------------------------------------- 1 | ![](./imgs/SuperchargeAzureSQL.png) 2 | ### **Supercharge your Azure SQL deployments by operationalizing Azure with DevOps** 3 | 4 | ## ![](../graphics/modules.png) Workshop Modules 5 | - [1. Configure your Local Environment](/docs/labs/1-ConfigLocalEnvironment.md) 6 | - [1.1. Azure PowerShell](/docs/labs/1-ConfigLocalEnvironment.md#exercise---setup-az-powershell-module) 7 | - [1.2. Setup Git for Windows](/docs/labs/1-ConfigLocalEnvironment.md#exercise---setup--git-for-windows) 8 | - [1.3 Setup Visual Studio Code](/docs/labs/1-ConfigLocalEnvironment.md#exercise---setup--visual-studio-code) 9 | - [1.4 Visual Studio - SSDT](/docs/labs/1-ConfigLocalEnvironment.md#exercise---setup--visual-studio---ssdt) 10 | - [1.5 SSMS (optional)](/docs/labs/1-ConfigLocalEnvironment.md#-exercise---setup-sql-server-management-studio-ssms-) 11 | - [1.6 Azure Data Studio (optional)](/docs/labs/1-ConfigLocalEnvironment.md#-exercise---setup--azure-data-studio-) 12 | - [1.7 Install sqlpackage for Windows](/docs/labs/1-ConfigLocalEnvironment.md#-exercise---install-sqlpackage-for-windows) 13 | - [1.8 Version Check and Configuration](/docs/labs/1-ConfigLocalEnvironment.md#exercise---version-check-and-configuration) 14 | 15 | - [2. Configure your DevOps Environment](/docs/labs/2-Configure_your_DevOps_Environment.md) 16 | - [2.1. Azure Resource groups](/docs/labs/2-Configure_your_DevOps_Environment.md#create-azure-resource-groups) 17 | - [2.2. Azure AD Service Principles](/docs/labs/2-Configure_your_DevOps_Environment.md#create-service-principal) 18 | - [2.3. Access Control (IAM)](/docs/labs/2-Configure_your_DevOps_Environment.md#access-control-iam-for-the-resource-group) 19 | - [2.4. Azure DevOps Organizations](/docs/labs/2-Configure_your_DevOps_Environment.md#azure-devops-organizations) 20 | - [2.5. Azure DevOps Project](/docs/labs/2-Configure_your_DevOps_Environment.md#azure-devops-project---clone-project-repo) 21 | - [2.7. Branching](/docs/labs/2-Configure_your_DevOps_Environment.md#branching) 22 | - [2.8. DevOps Service connections - Azure Resource Manager](/docs/labs/2-Configure_your_DevOps_Environment.md#devops-service-connection-with-azure-resource-manager) 23 | - [2.9. Push files to Repository](/docs/labs/2-Configure_your_DevOps_Environment.md#exercise---push-files-to-your-repo) 24 | - [2.10. Performing your initial Commit using VS Code](/docs/labs/2-Configure_your_DevOps_Environment.md#performing-your-inital-commit-using-vs-code) 25 | 26 | - [3. Deploy Azure Resources](/docs/labs/3-AzureResourceDeployment.md#lab-3---deploy-azure-resources) 27 | - [3.1 Advanced ARM template](/docs/labs/3-AzureResourceDeployment.md#exercise---advanced-arm-template) 28 | - [3.2. Build dev pipeline (CI)](/docs/labs/3-AzureResourceDeployment.md#exercise---build-dev-pipeline-ci) 29 | - [3.2.1 Configure dev continuous integration](/docs/labs/3-AzureResourceDeployment.md#configure-dev-continuous-integration) 30 | - [3.2.2 Testing dev Azure resource CI pipeline](/docs/labs/3-AzureResourceDeployment.md#testing-dev-azure-resource-ci-pipeline) 31 | - [3.3 Dev release pipeline (CD)](/docs/labs/3-AzureResourceDeployment.md#exercise---build-dev-pipeline-ci) 32 | - [3.3.1 Configure Key Vault deployment task](/docs/labs/3-AzureResourceDeployment.md#configure-key-vault-deployment-task) 33 | - [3.3.2 Configure SQL DB deployment task](/docs/labs/3-AzureResourceDeployment.md#configure-sql-db-deployment-task) 34 | - [3.3.3 Configure PowerShell task](/docs/labs/3-AzureResourceDeployment.md#configure-powershell-task) 35 | - [3.3.4 Configure Azure PowerShell task](/docs/labs/3-AzureResourceDeployment.md#configure-azure-powershell-task) 36 | - [3.3.5 Configure prod CI/CD pipelines](/docs/labs/3-AzureResourceDeployment.md#exercise---configure-prod-cicd-pipelines) 37 | - [3.3.6 Create & configure Prod build pipeline (CI)](/docs/labs/3-AzureResourceDeployment.md#create--configure-prod-build-pipeline-ci) 38 | - [3.3.7 Create & configure Prod release pipeline (CD)](/docs/labs/3-AzureResourceDeployment.md#create--configure-prod-release-pipeline-cd) 39 | - [3.4 Pull request](/docs/labs/3-AzureResourceDeployment.md#exercise---pull-request) 40 | - [3.4.1 Review Prod CI/CD](/docs/labs/3-AzureResourceDeployment.md#review-prod-cicd) 41 | 42 | - [4. Database life cycle Management](/docs/labs/4-DatabaseLifecycleManagement.md) 43 | - [4.1 Initial SSDT project setup](/docs/labs/4-DatabaseLifecycleManagement.md#initial-ssdt-project-setup) 44 | - [4.2 Get to know SSDT database projects](/docs/labs/4-DatabaseLifecycleManagement.md#get-to-know-ssdt-database-projects) 45 | - [4.3 Build your database project](/docs/labs/4-DatabaseLifecycleManagement.md#build-your-database-project) 46 | - [4.4 Load data your local DB](/docs/labs/4-DatabaseLifecycleManagement.md#load-data-your-local-db) 47 | - [4.5 Dev Database Build Pipeline (CI)](/docs/labs/4-DatabaseLifecycleManagement.md#exercise---dev-database-build-pipeline-ci) 48 | - [4.6 Dev Database Release Pipeline (CD)](/docs/labs/4-DatabaseLifecycleManagement.md#exercise---dev-database-release-pipeline-cd) 49 | - [4.6.1 Configure Azure SQL DacpacTask](/docs/labs/4-DatabaseLifecycleManagement.md#configure-azure-sql-dacpactask) 50 | - [4.6.2 Challenge - Firewall rule](/docs/labs/4-DatabaseLifecycleManagement.md#challenge---firewall-rule) 51 | - [4.7 Postdeployment Script (CI)](/docs/labs/4-DatabaseLifecycleManagement.md#exercise---postdeployment-script-ci) 52 | - [4.8 Configure prod CI/CD - Challenge](/docs/labs/4-DatabaseLifecycleManagement.md#exercise---postdeployment-script-ci) 53 | -------------------------------------------------------------------------------- /docs/labs/UnitTests.md: -------------------------------------------------------------------------------- 1 | ## Unit Tests(Optional) 2 | 3 | > Visual Studio 2019 Community does not support the features below. 4 | 5 | 1. Navigate to **SQL Server Object Explorer** > **Projects - trainingDW** > **trainingDW** > **Programmability** > **Stored Procedures** 6 | 1. Right-click **Add New Stored Procedure** 7 | 2. Name the SP: **AttendeeSP** 8 | 3. Enter the following: 9 | ``` 10 | CREATE PROCEDURE [dbo].[AttendeeSP] 11 | @FirstName AS VARCHAR(30), 12 | @LastName AS VARCHAR(50), 13 | @LastUpdated AS DATETIME 14 | AS 15 | INSERT INTO dim.Attendee (FirstName ,LastName, LastUpdated) 16 | VALUES(@FirstName,@LastName, @LastUpdated) 17 | 18 | ``` 19 | 20 | 4. Press **F5** to deploy the update 21 | 2. Right click the **AttendeeSP** Stored Procedure 22 | 3. Create Unit Tests... 23 | 4. Fill in the following: 24 | 1. New project name: **SQLSPTest** 25 | 2. Create new class: **SqlServerUnitTestSP.cs** 26 | 5. Select the Connection 27 | 1. Click on **Browse** and **Local** 28 | 2. Select **ProjectsV13** and then the **Database Name** 29 | 3. Click Connect 30 | 6. The **SQL Server Unit Test Designer** should open 31 | 7. Make sure **Test** is selected 32 | 8. Insert the following 33 | ``` 34 | DECLARE @FirstName AS VARCHAR(30),@LastName AS VARCHAR,@LastUpdated AS DATETIME ; 35 | SELECT @FirstName = 'Joe', 36 | @LastName = 'Smith', 37 | @LastUpdated = GETDATE(); 38 | 39 | EXECUTE [dbo].[AttendeeSP] @FirstName, @LastName, @LastUpdated; 40 | SELECT * FROM [dim].[Attendee] WHERE FirstName = @FirstName 41 | 42 | ``` 43 | 44 | 9. Select **Inconclusive** in the **Test Conditions:** 45 | 10. Click the red x to delete this test. 46 | 11. Then select **Row Count** and add the test 47 | 12. Right click the test and click on **properties** 48 | 12. In the properties menu in the bottom right corner, change row count from **0** to **1** 49 | 50 | Add the following scripts: 51 | 52 | **PRE-Test** 53 | ``` 54 | DECLARE @FirstName AS VARCHAR(30); 55 | SELECT @FirstName = 'Joe'; 56 | IF EXISTS(SELECT * FROM [dim].[Attendee] WHERE FirstName= @FirstName) 57 | BEGIN 58 | DELETE FROM [dim].[Attendee] WHERE FirstName = @FirstName; 59 | END 60 | 61 | ``` 62 | **Post-test** 63 | ``` 64 | DECLARE @FirstName AS VARCHAR = 'Joe' 65 | 66 | IF EXISTS(SELECT * FROM [dim].[Attendee] WHERE FirstName= @FirstName) 67 | BEGIN 68 | DELETE FROM [dim].[Attendee] WHERE [FirstName] = @FirstName; 69 | END 70 | ``` 71 | 72 | 1. Click on **Test** > **Run All** 73 | 2. Commit the new project and SP 74 | 3. Navigate to the DevOps Build Pipeline 75 | 4. Add **Visual Studio Test** task before the Publish Artifact task 76 | > If the tests fail, then the Artifact is not published 77 | 5. Save and Queue 78 | 79 | The build fails because the connection string is your localdb. This will need to be updated for your Azure database in the app.config. 80 | 81 | >Right-click on the project > **SQL Server Test Configuration** > Select Azure Connection. 82 | 83 | [More to Come] Remember the Firewall settings and re-deploy the database for modifications. 84 | -------------------------------------------------------------------------------- /docs/labs/imgs/AzureDataStudioLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/AzureDataStudioLogo.png -------------------------------------------------------------------------------- /docs/labs/imgs/CI-AgentStepRename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/CI-AgentStepRename.png -------------------------------------------------------------------------------- /docs/labs/imgs/Clone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/Clone.png -------------------------------------------------------------------------------- /docs/labs/imgs/CloneCopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/CloneCopy.png -------------------------------------------------------------------------------- /docs/labs/imgs/Git-Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/Git-Icon.png -------------------------------------------------------------------------------- /docs/labs/imgs/GitImport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/GitImport.png -------------------------------------------------------------------------------- /docs/labs/imgs/PS1filetype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/PS1filetype.png -------------------------------------------------------------------------------- /docs/labs/imgs/PS1filetype2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/PS1filetype2.png -------------------------------------------------------------------------------- /docs/labs/imgs/PS1filetype3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/PS1filetype3.png -------------------------------------------------------------------------------- /docs/labs/imgs/PS1filetype4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/PS1filetype4.png -------------------------------------------------------------------------------- /docs/labs/imgs/PSextension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/PSextension.png -------------------------------------------------------------------------------- /docs/labs/imgs/RepoBranchPolicies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/RepoBranchPolicies.png -------------------------------------------------------------------------------- /docs/labs/imgs/RepoInitialize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/RepoInitialize.png -------------------------------------------------------------------------------- /docs/labs/imgs/RepoMasterBranchPolicies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/RepoMasterBranchPolicies.png -------------------------------------------------------------------------------- /docs/labs/imgs/RepoMasterBranchPoliciesIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/RepoMasterBranchPoliciesIcon.png -------------------------------------------------------------------------------- /docs/labs/imgs/ReposBranchs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ReposBranchs.png -------------------------------------------------------------------------------- /docs/labs/imgs/ServiceConnection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ServiceConnection.png -------------------------------------------------------------------------------- /docs/labs/imgs/SuperchargeAzureSQL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/SuperchargeAzureSQL.png -------------------------------------------------------------------------------- /docs/labs/imgs/ad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ad.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/cd-artifacts-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-artifacts-delete.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-artifacts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-artifacts.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-azpowershell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-azpowershell.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-deploy.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-emptyjob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-emptyjob.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-new-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-new-pipeline.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-powershell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-powershell.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-prod-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-prod-rename.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-release-vars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-release-vars.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-release.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-release.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-result1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-result1.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-result2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-result2.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-tasks.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-trigger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-trigger.png -------------------------------------------------------------------------------- /docs/labs/imgs/cd-variablegroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/cd-variablegroup.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-ARM-task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-ARM-task.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-agent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-agent.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-clone-task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-clone-task.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-filter-build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-filter-build.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-publish-build-artfacts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-publish-build-artfacts.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-publish-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-publish-path.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-run-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-run-pipeline.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-run-pipeline2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-run-pipeline2.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-run-pipeline3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-run-pipeline3.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-save-build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-save-build.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-save-build2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-save-build2.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-sources-prod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-sources-prod.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-sqldb-validate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-sqldb-validate.png -------------------------------------------------------------------------------- /docs/labs/imgs/ci-view-logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ci-view-logs.png -------------------------------------------------------------------------------- /docs/labs/imgs/classiceditor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/classiceditor.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/clone-cdrive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/clone-cdrive.png -------------------------------------------------------------------------------- /docs/labs/imgs/commit-ssdt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/commit-ssdt.png -------------------------------------------------------------------------------- /docs/labs/imgs/copiedsource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/copiedsource.png -------------------------------------------------------------------------------- /docs/labs/imgs/db-dev-build-vars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/db-dev-build-vars.png -------------------------------------------------------------------------------- /docs/labs/imgs/db-dev-build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/db-dev-build.png -------------------------------------------------------------------------------- /docs/labs/imgs/db-dev-ci-publisharts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/db-dev-ci-publisharts.png -------------------------------------------------------------------------------- /docs/labs/imgs/db-dev-ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/db-dev-ci.png -------------------------------------------------------------------------------- /docs/labs/imgs/db-dev-triggers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/db-dev-triggers.png -------------------------------------------------------------------------------- /docs/labs/imgs/db-dev-vsbuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/db-dev-vsbuild.png -------------------------------------------------------------------------------- /docs/labs/imgs/dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dev.png -------------------------------------------------------------------------------- /docs/labs/imgs/devSelect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/devSelect.png -------------------------------------------------------------------------------- /docs/labs/imgs/devops-signup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/devops-signup.png -------------------------------------------------------------------------------- /docs/labs/imgs/dl_VS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dl_VS.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-add-task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-add-task.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-dev-CD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-dev-CD.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-dev-clonetask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-dev-clonetask.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-dev-rEnv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-dev-rEnv.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-dev-tasksall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-dev-tasksall.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-emptyjob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-emptyjob.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-linked-vars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-linked-vars.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-new.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-rename.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-cd-sql-task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-cd-sql-task.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-dev-cd-artifact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-dev-cd-artifact.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-dev-cd-sql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-dev-cd-sql.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-dev-cd-trigger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-dev-cd-trigger.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-lb-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-lb-keys.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-lb-keys2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-lb-keys2.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-lb-keys3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-lb-keys3.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-lb-keys4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-lb-keys4.png -------------------------------------------------------------------------------- /docs/labs/imgs/dlm-rename-dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/dlm-rename-dev.png -------------------------------------------------------------------------------- /docs/labs/imgs/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/email.png -------------------------------------------------------------------------------- /docs/labs/imgs/emptyjob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/emptyjob.png -------------------------------------------------------------------------------- /docs/labs/imgs/explore-gitignore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/explore-gitignore.png -------------------------------------------------------------------------------- /docs/labs/imgs/explore-hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/explore-hidden.png -------------------------------------------------------------------------------- /docs/labs/imgs/fullserviceconnection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/fullserviceconnection.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/gitignore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/gitignore.png -------------------------------------------------------------------------------- /docs/labs/imgs/icon-lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/icon-lock.png -------------------------------------------------------------------------------- /docs/labs/imgs/icon-unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/icon-unlock.png -------------------------------------------------------------------------------- /docs/labs/imgs/importrepo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/importrepo.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/installSSDT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/installSSDT.png -------------------------------------------------------------------------------- /docs/labs/imgs/master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/master.png -------------------------------------------------------------------------------- /docs/labs/imgs/newproject.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/newproject.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/parameters.png -------------------------------------------------------------------------------- /docs/labs/imgs/parmAdmin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/parmAdmin.png -------------------------------------------------------------------------------- /docs/labs/imgs/pipelines.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/pipelines.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/postload-datedim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/postload-datedim.png -------------------------------------------------------------------------------- /docs/labs/imgs/postload-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/postload-script.png -------------------------------------------------------------------------------- /docs/labs/imgs/pr-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/pr-active.png -------------------------------------------------------------------------------- /docs/labs/imgs/pr-clone-dev-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/pr-clone-dev-rename.png -------------------------------------------------------------------------------- /docs/labs/imgs/pr-clone-dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/pr-clone-dev.png -------------------------------------------------------------------------------- /docs/labs/imgs/pr-compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/pr-compare.png -------------------------------------------------------------------------------- /docs/labs/imgs/pr-complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/pr-complete.png -------------------------------------------------------------------------------- /docs/labs/imgs/pr-prod-pipline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/pr-prod-pipline.png -------------------------------------------------------------------------------- /docs/labs/imgs/pr-rename-prod-stage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/pr-rename-prod-stage.png -------------------------------------------------------------------------------- /docs/labs/imgs/prod-approve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/prod-approve.png -------------------------------------------------------------------------------- /docs/labs/imgs/prod-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/prod-email.png -------------------------------------------------------------------------------- /docs/labs/imgs/prod-release1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/prod-release1.png -------------------------------------------------------------------------------- /docs/labs/imgs/projectsettings.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/projectsettings.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/ps_vscode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ps_vscode.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/push.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/push.png -------------------------------------------------------------------------------- /docs/labs/imgs/remotefiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/remotefiles.png -------------------------------------------------------------------------------- /docs/labs/imgs/repo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/repo.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/reposource.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/reposource.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/resourcegoup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/resourcegoup.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/resourcegoup2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/resourcegoup2.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/rgDeployment1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/rgDeployment1.png -------------------------------------------------------------------------------- /docs/labs/imgs/rgDeployment2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/rgDeployment2.png -------------------------------------------------------------------------------- /docs/labs/imgs/rgResources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/rgResources.png -------------------------------------------------------------------------------- /docs/labs/imgs/serverAdmin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/serverAdmin.png -------------------------------------------------------------------------------- /docs/labs/imgs/serviceconnection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/serviceconnection.jpg -------------------------------------------------------------------------------- /docs/labs/imgs/sourcecode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/sourcecode.png -------------------------------------------------------------------------------- /docs/labs/imgs/sourcedir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/sourcedir.png -------------------------------------------------------------------------------- /docs/labs/imgs/sql_db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/sql_db.png -------------------------------------------------------------------------------- /docs/labs/imgs/srvName.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/srvName.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-Synce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-Synce.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-build-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-build-result.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-build.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-commit-staged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-commit-staged.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-compare-gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-compare-gear.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-compare-target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-compare-target.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-createdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-createdb.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-db-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-db-settings.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-dev.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-execute-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-execute-script.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-git-push.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-git-push.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-load-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-load-data.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-localdb-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-localdb-connection.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-localdb-query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-localdb-query.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-localdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-localdb.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-master.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-refactor1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-refactor1.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-refactor2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-refactor2.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-refactor3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-refactor3.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-select-target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-select-target.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-sqlexplorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-sqlexplorer.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-stage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-stage.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssdt-tablescript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssdt-tablescript.png -------------------------------------------------------------------------------- /docs/labs/imgs/ssms-firewall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/ssms-firewall.png -------------------------------------------------------------------------------- /docs/labs/imgs/stagefiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/stagefiles.png -------------------------------------------------------------------------------- /docs/labs/imgs/variable-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/variable-group.png -------------------------------------------------------------------------------- /docs/labs/imgs/visualstudio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/visualstudio.png -------------------------------------------------------------------------------- /docs/labs/imgs/vs-git-fetch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/vs-git-fetch.png -------------------------------------------------------------------------------- /docs/labs/imgs/vsCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/vsCode.png -------------------------------------------------------------------------------- /docs/labs/imgs/vscode-check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/vscode-check.png -------------------------------------------------------------------------------- /docs/labs/imgs/vscode-sync-message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/SuperchargeAzureSQLDeployments/3dbbe582d6a77702f7fab8e8ac0cbd5934dfabea/docs/labs/imgs/vscode-sync-message.png -------------------------------------------------------------------------------- /docs/labs/zz-labTemplate.md: -------------------------------------------------------------------------------- 1 | ## {Enter Lab Number - Name} 2 | -------------------------------- 3 | 4 | [comment]: <> (Link back to main lab README) 5 | [Back to all modules](/docs/labs/README.md) 6 | 7 | [comment]: <> (Lab header table provide values for lab) 8 | 9 | | Lab Description: | {Enter description of lab} | 10 | | :------------ | :-------------- | 11 | | Estimated Time to Complete: | {time in minutes} | 12 | | Key Takeaways: | {enter key takeaway} | 13 | | | {enter key takeaway} | 14 | | | {enter key takeaway} | 15 | | Author(s): | {enter authors} | 16 | 17 | [comment]: <> (Write up purpose for this lab, provide some info on the what and why) 18 | ### Purpose 19 | {provide brief purpose of this lab} 20 | 21 | [comment]: <> (Create a link to the main topics of this lab add as many as needed) 22 | **Summary** 23 | * [{summary link}]({summerylinke}) 24 | * [{summary link}]({summerylinke}) 25 | * [{summary link}]({summerylinke}) 26 | 27 | [comment]: <> (Main Exercise format) 28 | ##
Exercise - {Enter exercise name}
29 | 30 | [comment]: <> (Exercise main action) 31 | ### {Heading for section of exercise} 32 | 33 | [comment]: <> (Use ordered bullets, code blocks, images ect for the steps) 34 | [comment]: <> (MD cheetsheet: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#links ) 35 | 36 | [comment]: <> (End labe with link to all labs, next lab) 37 | ___ 38 | - [Next Lab](/docs/labs/{enter next labe .md}) 39 | - [Back to all modules](/docs/labs/README.md) 40 | ___ 41 | ___ 42 | **Azure subscriptions** 43 | 44 | TRIAL SUBSCRIPTIONS ARE NOT SUPPORTED FOR THIS WORKSHOP -------------------------------------------------------------------------------- /source/DatabaseProjects/Deployment/FindSQLPackage.ps1: -------------------------------------------------------------------------------- 1 | function Get-SqlPackageOnTargetMachine 2 | { 3 | try 4 | { 5 | $sqlDacPath, $sqlVersion = Locate-HighestVersionSqlPackageWithSql 6 | $sqlVersionNumber = [decimal] $sqlVersion 7 | } 8 | catch [System.Exception] 9 | { 10 | Write-Verbose ("Failed to get Dac Framework (installed with SQL Server) location with exception: " + $_.Exception.Message) 11 | $sqlVersionNumber = 0 12 | } 13 | 14 | try 15 | { 16 | $sqlMsiDacPath, $sqlMsiVersion = Locate-HighestVersionSqlPackageWithDacMsi 17 | $sqlMsiVersionNumber = [decimal] $sqlMsiVersion 18 | } 19 | catch [System.Exception] 20 | { 21 | Write-Verbose ("Failed to get Dac Framework (installed with DAC Framework) location with exception: " + $_.Exception.Message) -verbose 22 | $sqlMsiVersionNumber = 0 23 | } 24 | 25 | try 26 | { 27 | $vsDacPath, $vsVersion = Locate-HighestVersionSqlPackageInVS 28 | $vsVersionNumber = [decimal] $vsVersion 29 | } 30 | catch [System.Exception] 31 | { 32 | Write-Verbose ("Failed to get Dac Framework (installed with Visual Studio) location with exception: " + $_.Exception.Message) 33 | $vsVersionNumber = 0 34 | } 35 | 36 | $maximumVersion = [decimal]$(@($vsVersionNumber, $sqlVersionNumber, $sqlMsiVersionNumber) | Measure-Object -Maximum).Maximum 37 | 38 | if ($sqlMsiVersion -eq $maximumVersion) 39 | { 40 | $dacPath = $sqlMsiDacPath 41 | } 42 | elseif ($vsVersionNumber -eq $maximumVersion) 43 | { 44 | $dacPath = $vsDacPath 45 | } 46 | elseif ($sqlVersionNumber -eq $maximumVersion) 47 | { 48 | $dacPath = $sqlDacPath 49 | } 50 | 51 | if ($dacPath -eq $null) 52 | { 53 | throw "Unable to find the location of Dac Framework (SqlPackage.exe) from registry on machine $env:COMPUTERNAME" 54 | } 55 | else 56 | { 57 | return $dacPath 58 | } 59 | } 60 | 61 | function Get-RegistryValueIgnoreError 62 | { 63 | param 64 | ( 65 | [parameter(Mandatory = $true)] 66 | [Microsoft.Win32.RegistryHive] 67 | $RegistryHive, 68 | 69 | [parameter(Mandatory = $true)] 70 | [System.String] 71 | $Key, 72 | 73 | [parameter(Mandatory = $true)] 74 | [System.String] 75 | $Value, 76 | 77 | [parameter(Mandatory = $true)] 78 | [Microsoft.Win32.RegistryView] 79 | $RegistryView 80 | ) 81 | 82 | try 83 | { 84 | $baseKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey($RegistryHive, $RegistryView) 85 | $subKey = $baseKey.OpenSubKey($Key) 86 | if($subKey -ne $null) 87 | { 88 | return $subKey.GetValue($Value) 89 | } 90 | } 91 | catch 92 | { 93 | } 94 | return $null 95 | } 96 | 97 | function Get-RegistrySubKeysIgnoreError 98 | { 99 | param 100 | ( 101 | [parameter(Mandatory = $true)] 102 | [Microsoft.Win32.RegistryHive] 103 | $RegistryHive, 104 | 105 | [parameter(Mandatory = $true)] 106 | [System.String] 107 | $Key, 108 | 109 | [parameter(Mandatory = $true)] 110 | [Microsoft.Win32.RegistryView] 111 | $RegistryView 112 | ) 113 | 114 | try 115 | { 116 | $baseKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey($RegistryHive, $RegistryView) 117 | $subKey = $baseKey.OpenSubKey($Key) 118 | return $subKey 119 | } 120 | catch 121 | { 122 | } 123 | 124 | return $null 125 | } 126 | 127 | function Get-SubKeysInFloatFormat($keys) 128 | { 129 | $targetKeys = @() 130 | foreach ($key in $keys) 131 | { 132 | try { 133 | $targetKeys += [decimal] $key 134 | } 135 | catch {} 136 | } 137 | 138 | $targetKeys 139 | } 140 | 141 | function Get-SqlPackageForSqlVersion([int] $majorVersion, [bool] $wow6432Node) 142 | { 143 | $sqlInstallRootRegKey = "SOFTWARE", "Microsoft", "Microsoft SQL Server", "$majorVersion" -join [System.IO.Path]::DirectorySeparatorChar 144 | 145 | if ($wow6432Node -eq $true) 146 | { 147 | $sqlInstallRootPath = Get-RegistryValueIgnoreError LocalMachine "$sqlInstallRootRegKey" "VerSpecificRootDir" Registry64 148 | } 149 | else 150 | { 151 | $sqlInstallRootPath = Get-RegistryValueIgnoreError LocalMachine "$sqlInstallRootRegKey" "VerSpecificRootDir" Registry32 152 | } 153 | 154 | if ($sqlInstallRootPath -eq $null) 155 | { 156 | return $null 157 | } 158 | 159 | Write-Verbose "Sql Version Specific Root Dir for version $majorVersion as read from registry: $sqlInstallRootPath" 160 | 161 | $DacInstallPath = [System.IO.Path]::Combine($sqlInstallRootPath, "Dac", "bin", "SqlPackage.exe") 162 | 163 | if (Test-Path $DacInstallPath) 164 | { 165 | Write-Verbose "Dac Framework installed with SQL Version $majorVersion found at $DacInstallPath on machine $env:COMPUTERNAME" 166 | return $DacInstallPath 167 | } 168 | else 169 | { 170 | return $null 171 | } 172 | } 173 | 174 | function Locate-HighestVersionSqlPackageWithSql() 175 | { 176 | $sqlRegKey = "HKLM:", "SOFTWARE", "Wow6432Node", "Microsoft", "Microsoft SQL Server"-join [System.IO.Path]::DirectorySeparatorChar 177 | $sqlRegKey64 = "HKLM:", "SOFTWARE", "Microsoft", "Microsoft SQL Server"-join [System.IO.Path]::DirectorySeparatorChar 178 | 179 | if (-not (Test-Path $sqlRegKey)) 180 | { 181 | $sqlRegKey = $sqlRegKey64 182 | } 183 | 184 | if (-not (Test-Path $sqlRegKey)) 185 | { 186 | return $null, 0 187 | } 188 | 189 | $keys = Get-Item $sqlRegKey | %{$_.GetSubKeyNames()} 190 | $versions = Get-SubKeysInFloatFormat $keys | Sort-Object -Descending 191 | 192 | Write-Verbose "Sql Versions installed on machine $env:COMPUTERNAME as read from registry: $versions" 193 | 194 | foreach ($majorVersion in $versions) 195 | { 196 | $DacInstallPathWow6432Node = Get-SqlPackageForSqlVersion $majorVersion $true 197 | $DacInstallPath = Get-SqlPackageForSqlVersion $majorVersion $false 198 | 199 | if ($DacInstallPathWow6432Node -ne $null) 200 | { 201 | return $DacInstallPathWow6432Node, $majorVersion 202 | } 203 | elseif ($DacInstallPath -ne $null) 204 | { 205 | return $DacInstallPath, $majorVersion 206 | } 207 | } 208 | 209 | Write-Verbose "Dac Framework (installed with SQL) not found on machine $env:COMPUTERNAME" 210 | 211 | return $null, 0 212 | } 213 | 214 | function Locate-HighestVersionSqlPackageWithDacMsi() 215 | { 216 | $sqlDataTierFrameworkRegKeyWow = "HKLM:", "SOFTWARE", "Wow6432Node", "Microsoft", "Microsoft SQL Server", "Data-Tier Application Framework" -join [System.IO.Path]::DirectorySeparatorChar 217 | $sqlDataTierFrameworkRegKey = "HKLM:", "SOFTWARE", "Microsoft", "Microsoft SQL Server", "Data-Tier Application Framework" -join [System.IO.Path]::DirectorySeparatorChar 218 | 219 | if (-not (Test-Path $sqlDataTierFrameworkRegKey)) 220 | { 221 | $sqlDataTierFrameworkRegKey = $sqlDataTierFrameworkRegKeyWow 222 | } 223 | 224 | if ((Test-Path $sqlDataTierFrameworkRegKey)) 225 | { 226 | $keys = Get-Item $sqlDataTierFrameworkRegKey | %{$_.GetSubKeyNames()} 227 | $versions = Get-SubKeysInFloatFormat $keys | Sort-Object -Descending 228 | $installedMajorVersion = 0 229 | 230 | foreach ($majorVersion in $versions) 231 | { 232 | $sqlInstallRootRegKey = "SOFTWARE", "Microsoft", "Microsoft SQL Server", "Data-Tier Application Framework", "$majorVersion" -join [System.IO.Path]::DirectorySeparatorChar 233 | $sqlInstallRootPath64 = Get-RegistryValueIgnoreError LocalMachine "$sqlInstallRootRegKey" "InstallDir" Registry64 234 | $sqlInstallRootPath32 = Get-RegistryValueIgnoreError LocalMachine "$sqlInstallRootRegKey" "InstallDir" Registry32 235 | if ($sqlInstallRootPath64 -ne $null) 236 | { 237 | $sqlInstallRootPath = $sqlInstallRootPath64 238 | break 239 | } 240 | if ($sqlInstallRootPath32 -ne $null) 241 | { 242 | $sqlInstallRootPath = $sqlInstallRootPath32 243 | break 244 | } 245 | } 246 | 247 | $DacInstallPath = [System.IO.Path]::Combine($sqlInstallRootPath, "SqlPackage.exe") 248 | 249 | if (Test-Path $DacInstallPath) 250 | { 251 | Write-Verbose "Dac Framework installed with SQL Version $majorVersion found at $DacInstallPath on machine $env:COMPUTERNAME" 252 | return $DacInstallPath, $majorVersion 253 | } 254 | } 255 | 256 | $sqlRegKeyWow = "HKLM:", "SOFTWARE", "Wow6432Node", "Microsoft", "Microsoft SQL Server", "DACFramework", "CurrentVersion" -join [System.IO.Path]::DirectorySeparatorChar 257 | $sqlRegKey = "HKLM:", "SOFTWARE", "Microsoft", "Microsoft SQL Server", "DACFramework", "CurrentVersion" -join [System.IO.Path]::DirectorySeparatorChar 258 | 259 | $sqlKey = "SOFTWARE", "Microsoft", "Microsoft SQL Server", "DACFramework", "CurrentVersion" -join [System.IO.Path]::DirectorySeparatorChar 260 | 261 | if (Test-Path $sqlRegKey) 262 | { 263 | $dacVersion = Get-RegistryValueIgnoreError LocalMachine "$sqlKey" "Version" Registry64 264 | $majorVersion = $dacVersion.Substring(0, $dacVersion.IndexOf(".")) + "0" 265 | } 266 | 267 | if (Test-Path $sqlRegKeyWow) 268 | { 269 | $dacVersionX86 = Get-RegistryValueIgnoreError LocalMachine "$sqlKey" "Version" Registry32 270 | $majorVersionX86 = $dacVersionX86.Substring(0, $dacVersionX86.IndexOf(".")) + "0" 271 | } 272 | 273 | if ((-not($dacVersion)) -and (-not($dacVersionX86))) 274 | { 275 | Write-Verbose "Dac Framework (installed with DAC Framework) not found on machine $env:COMPUTERNAME" 276 | return $null, 0 277 | } 278 | 279 | if ($majorVersionX86 -gt $majorVersion) 280 | { 281 | $majorVersion = $majorVersionX86 282 | } 283 | 284 | $dacRelativePath = "Microsoft SQL Server", "$majorVersion", "DAC", "bin", "SqlPackage.exe" -join [System.IO.Path]::DirectorySeparatorChar 285 | $programFiles = $env:ProgramFiles 286 | $programFilesX86 = "${env:ProgramFiles(x86)}" 287 | 288 | if (-not ($programFilesX86 -eq $null)) 289 | { 290 | $dacPath = $programFilesX86, $dacRelativePath -join [System.IO.Path]::DirectorySeparatorChar 291 | 292 | if (Test-Path("$dacPath")) 293 | { 294 | Write-Verbose "Dac Framework (installed with DAC Framework Msi) found on machine $env:COMPUTERNAME at $dacPath" 295 | return $dacPath, $majorVersion 296 | } 297 | } 298 | 299 | if (-not ($programFiles -eq $null)) 300 | { 301 | $dacPath = $programFiles, $dacRelativePath -join [System.IO.Path]::DirectorySeparatorChar 302 | 303 | if (Test-Path($dacPath)) 304 | { 305 | Write-Verbose "Dac Framework (installed with DAC Framework Msi) found on machine $env:COMPUTERNAME at $dacPath" 306 | return $dacPath, $majorVersion 307 | } 308 | } 309 | 310 | return $null, 0 311 | } 312 | 313 | function Locate-SqlPackageInVS_15_0() 314 | { 315 | $vs15 = Get-VisualStudio_15_0 316 | if ($vs15 -and $vs15.installationPath) { 317 | # End with "\" for consistency with old ShellFolder values. 318 | $shellFolder15 = $vs15.installationPath.TrimEnd('\'[0]) + "\" 319 | 320 | # Test for the DAC directory. 321 | $dacParentDir = [System.IO.Path]::Combine($shellFolder15, 'Common7', 'IDE', 'Extensions', 'Microsoft', 'SQLDB', 'DAC') 322 | $dacInstallPath, $dacInstallVersion = Get-LatestVersionSqlPackageInDacDirectory -dacParentDir $dacParentDir 323 | 324 | if($dacInstallPath) 325 | { 326 | return $dacInstallPath, $dacInstallVersion 327 | } 328 | } 329 | 330 | return $null, 0 331 | } 332 | 333 | function Locate-SqlPackageInVS([string] $version) 334 | { 335 | $vsRegKeyForVersion = "SOFTWARE", "Microsoft", "VisualStudio", $version -join [System.IO.Path]::DirectorySeparatorChar 336 | 337 | $vsInstallDir = Get-RegistryValueIgnoreError LocalMachine "$vsRegKeyForVersion" "InstallDir" Registry64 338 | 339 | if ($vsInstallDir -eq $null) 340 | { 341 | $vsInstallDir = Get-RegistryValueIgnoreError LocalMachine "$vsRegKeyForVersion" "InstallDir" Registry32 342 | } 343 | 344 | if ($vsInstallDir) 345 | { 346 | Write-Verbose "Visual Studio install location: $vsInstallDir" 347 | 348 | $dacExtensionPath = [System.IO.Path]::Combine("Extensions", "Microsoft", "SQLDB", "DAC") 349 | $dacParentDir = [System.IO.Path]::Combine($vsInstallDir, $dacExtensionPath) 350 | $dacInstallPath, $dacInstallVersion = Get-LatestVersionSqlPackageInDacDirectory -dacParentDir $dacParentDir 351 | 352 | if($dacInstallPath) 353 | { 354 | return $dacInstallPath, $dacInstallVersion 355 | } 356 | } 357 | 358 | return $null, 0 359 | } 360 | 361 | function Get-LatestVersionSqlPackageInDacDirectory([string] $dacParentDir) 362 | { 363 | if (Test-Path $dacParentDir) 364 | { 365 | $dacVersionDirs = Get-ChildItem $dacParentDir | Sort-Object @{e={$_.Name -as [int]}} -Descending 366 | 367 | foreach ($dacVersionDir in $dacVersionDirs) 368 | { 369 | $dacVersion = $dacVersionDir.Name 370 | $dacFullPath = [System.IO.Path]::Combine($dacVersionDir.FullName, "SqlPackage.exe") 371 | 372 | if(Test-Path $dacFullPath -pathtype leaf) 373 | { 374 | Write-Verbose "Dac Framework installed with Visual Studio found at $dacFullPath on machine $env:COMPUTERNAME" 375 | return $dacFullPath, $dacVersion 376 | } 377 | else 378 | { 379 | Write-Verbose "Unable to find Dac framework installed with Visual Studio at $($dacVersionDir.FullName) on machine $env:COMPUTERNAME" 380 | } 381 | } 382 | } 383 | 384 | return $null, 0 385 | } 386 | 387 | function Locate-HighestVersionSqlPackageInVS() 388 | { 389 | # Locate SqlPackage.exe in VS 15.0 390 | $dacFullPath, $dacVersion = Locate-SqlPackageInVS_15_0 391 | 392 | if ($dacFullPath -ne $null) 393 | { 394 | return $dacFullPath, $dacVersion 395 | } 396 | 397 | #Locate SqlPackage.exe in older version 398 | $vsRegKey = "HKLM:", "SOFTWARE", "Wow6432Node", "Microsoft", "VisualStudio" -join [System.IO.Path]::DirectorySeparatorChar 399 | $vsRegKey64 = "HKLM:", "SOFTWARE", "Microsoft", "VisualStudio" -join [System.IO.Path]::DirectorySeparatorChar 400 | 401 | if (-not (Test-Path $vsRegKey)) 402 | { 403 | $vsRegKey = $vsRegKey64 404 | } 405 | 406 | if (-not (Test-Path $vsRegKey)) 407 | { 408 | Write-Verbose "Visual Studio not found on machine $env:COMPUTERNAME" 409 | return $null, 0 410 | } 411 | 412 | $keys = Get-Item $vsRegKey | %{$_.GetSubKeyNames()} 413 | $versions = Get-SubKeysInFloatFormat $keys | Sort-Object -Descending 414 | 415 | Write-Verbose "Visual Studio versions found on machine $env:COMPUTERNAME as read from registry: $versions" 416 | 417 | foreach ($majorVersion in $versions) 418 | { 419 | $dacFullPath, $dacVersion = Locate-SqlPackageInVS $majorVersion 420 | 421 | if ($dacFullPath -ne $null) 422 | { 423 | return $dacFullPath, $dacVersion 424 | } 425 | } 426 | 427 | Write-Verbose "Dac Framework (installed with Visual Studio) not found on machine $env:COMPUTERNAME " 428 | 429 | return $null, 0 430 | } 431 | 432 | function Get-VisualStudio_15_0 { 433 | [CmdletBinding()] 434 | param() 435 | 436 | $visualStudioInstallDir = $null 437 | try { 438 | # Query for the latest 15.* version. 439 | # 440 | # Note, the capability is registered as VisualStudio_15.0, however the actual version 441 | # may be something like 15.2. 442 | Write-Verbose "Getting latest Visual Studio 15 setup instance." 443 | $output = New-Object System.Text.StringBuilder 444 | Invoke-VstsTool -FileName "$PSScriptRoot\vswhere.exe" -Arguments "-version [15.0,17.0) -latest -format json" -RequireExitCodeZero 2>&1 | 445 | ForEach-Object { 446 | if ($_ -is [System.Management.Automation.ErrorRecord]) { 447 | Write-Verbose "STDERR: $($_.Exception.Message)" 448 | } 449 | else { 450 | Write-Verbose $_ 451 | $null = $output.AppendLine($_) 452 | } 453 | } 454 | $visualStudioInstallDir = (ConvertFrom-Json -InputObject $output.ToString()) | 455 | Select-Object -First 1 456 | if (!$visualStudioInstallDir) { 457 | # Query for the latest 15.* BuildTools. 458 | # 459 | # Note, whereas VS 15.x version number is always 15.0.*, BuildTools does not follow the 460 | # the same scheme. It appears to follow the 15..* versioning scheme. 461 | Write-Verbose "Getting latest BuildTools 15 setup instance." 462 | $output = New-Object System.Text.StringBuilder 463 | Invoke-VstsTool -FileName "$PSScriptRoot\vswhere.exe" -Arguments "-version [15.0,17.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json" -RequireExitCodeZero 2>&1 | 464 | ForEach-Object { 465 | if ($_ -is [System.Management.Automation.ErrorRecord]) { 466 | Write-Verbose "STDERR: $($_.Exception.Message)" 467 | } 468 | else { 469 | Write-Verbose $_ 470 | $null = $output.AppendLine($_) 471 | } 472 | } 473 | $visualStudioInstallDir = (ConvertFrom-Json -InputObject $output.ToString()) | 474 | Select-Object -First 1 475 | } 476 | } catch { 477 | Write-Verbose ($_ | Out-String) 478 | $visualStudioInstallDir = $null 479 | } 480 | 481 | return $visualStudioInstallDir 482 | } 483 | 484 | function Get-SQLPackagePath 485 | { 486 | 487 | $sqlPackage = Get-SqlPackageOnTargetMachine 488 | 489 | return $sqlPackage 490 | } -------------------------------------------------------------------------------- /source/DatabaseProjects/Deployment/SqlPackage.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | $TenantId, 3 | $ServicePrincipalId, 4 | $AppKey, 5 | $SqlSrv, 6 | $SqlDb, 7 | $ReportPath, 8 | $dacpacPath, 9 | $sqlpackagePath, 10 | $PackageAction, 11 | $ResourceGroupName, 12 | $CreateFirewallRule 13 | ); 14 | 15 | #To Test Script Local provide values for the Params and Login to Azure as this script is meant to run in Azure Power Shell 16 | # Login-AzAccount 17 | 18 | <# 19 | $TenantId = '' 20 | $ServicePrincipalId = '' 21 | $AppKey = '' 22 | $SqlSrv = '' 23 | $SqlDb = '' 24 | $ReportPath = '' 25 | $dacpacPath = '' 26 | $sqlpackagePath = '' 27 | $PackageAction = '' 28 | $ResourceGroupName = '' 29 | $CreateFirewallRule = '' 30 | #> 31 | 32 | #Create Deployment Firewall Rule 33 | If ($CreateFirewallRule) { 34 | $RuleName = "DevOpsDeploymentIP" 35 | #Local IP Address 36 | # $ipAddress = (Test-Connection -ComputerName (hostname) -Count 1 | Select IPV4Address).IPV4Address.IPAddressToString 37 | ## Old ##(Invoke-RestMethod -Uri https://ipinfo.io).ip 38 | $ipAddress = (Invoke-WebRequest -uri "http://ifconfig.me/ip").Content 39 | 40 | #Get Current Firewall Rules 41 | #Get-AzSqlServerFirewallRule not on Buile Server 42 | $Firewall = (Get-AzSqlServerFirewallRule -ResourceGroupName $ResourceGroupName -ServerName $SqlSrv).FirewallRuleName | Select-String -Pattern $RuleName 43 | 44 | #Set Params for New Deployment Firewall Rule. 45 | $params = @{ 46 | ResourceGroupName = $ResourceGroupName 47 | ServerName = $SqlSrv 48 | FirewallRuleName = $RuleName 49 | StartIpAddress = $ipAddress 50 | EndIpAddress = $ipAddress 51 | Verbose = $true 52 | } 53 | 54 | #Check if there is already a firewall rule from past Deploymnets 55 | if ($Firewall -eq $RuleName) { 56 | Write-Host "Removeing Old Deployment Firewall Rule." 57 | #Remove-AzSqlServerFirewallRule 58 | Remove-AzqlServerFirewallRule -FirewallRuleName $RuleName -ResourceGroupName $ResourceGroupName -ServerName $SqlSrv 59 | Write-Host "Creating Firewall Rule for IP: $ipAddress" 60 | #New-AzSqlServerFirewallRule 61 | New-AzSqlServerFirewallRule @params 62 | } 63 | Else { 64 | Write-Host "Creating Firewall Rule for IP: $ipAddress" 65 | #New-AzSqlServerFirewallRule 66 | New-AzSqlServerFirewallRule @params 67 | } 68 | } 69 | Else { Write-Host "Rule Not Created. CreateFirewallRule: $CreateFirewallRule" } 70 | 71 | #Token Function 72 | Function Get-AADToken { 73 | [CmdletBinding()] 74 | [OutputType([string])] 75 | PARAM ( 76 | [String]$TenantID, 77 | [string]$ServicePrincipalId, 78 | [securestring]$ServicePrincipalPwd 79 | ) 80 | Try { 81 | # Set Resource URI to Azure Database 82 | #To Do --- Update to make for MAG and Commerical 83 | $resourceAppIdURI = 'https://database.windows.net' 84 | 85 | dlm-sqlsrv-dev.database.windows.net 86 | 87 | # Set Authority to Azure AD Tenant 88 | $authority = 'https://login.windows.net/' + $TenantId 89 | $ClientCred = [Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential]::new($ServicePrincipalId, $ServicePrincipalPwd) 90 | $authContext = [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext]::new($authority) 91 | $authResult = $authContext.AcquireTokenAsync($resourceAppIdURI, $ClientCred) 92 | $Token = $authResult.Result.AccessToken 93 | } 94 | Catch { 95 | Throw $_ 96 | $ErrorMessage = 'Failed to aquire Azure AD token.' 97 | Write-Error -Message 'Failed to aquire Azure AD token' 98 | } 99 | $Token 100 | } 101 | 102 | #region Connect to db using SPN Account 103 | $SecureStringPassword = ConvertTo-SecureString -String $AppKey -AsPlainText -Force 104 | $AccessToken = Get-AADToken -TenantID $TenantId -ServicePrincipalId $ServicePrincipalId -ServicePrincipalPwd $SecureStringPassword -OutVariable SPNToken -Verbose 105 | 106 | # Set sqlpackage.exe dir: "C:\Program Files\Microsoft SQL Server\150\DAC\bin\sqlpackage.exe" 107 | $sqlpackage = "$sqlpackagePath\sqlpackage.exe" 108 | 109 | # set params 110 | $dacpac = "$dacpacPath\$SqlDb.dacpac" 111 | $srv = "$SqlSrv.database.windows.net" 112 | $action = $PackageAction 113 | $targetDB = $SqlDb 114 | $OutputPath = "$ReportPath\DeploymentReports" 115 | $ReportName = "DeployReport.xml" 116 | 117 | #Create Deployment Report 118 | #Ref for sqlpackage: https://docs.microsoft.com/en-us/sql/tools/sqlpackage?view=sql-server-2017#script-parameters-and-properties 119 | 120 | If ($PackageAction -eq "DeployReport") { 121 | #Create Deployment Report Directory 122 | If (Test-Path $OutputPath) { 123 | Write-Host "$OutputPath Already Exists" 124 | } 125 | Else { 126 | New-Item -Path $OutputPath -ItemType Directory 127 | } 128 | 129 | Write-Host "Creating Deployment Report" 130 | &$sqlpackage ` 131 | /a:$action ` 132 | /sf:$dacpac ` 133 | /op:"$OutputPath\$ReportName" ` 134 | /tsn:$srv ` 135 | /TargetDatabaseName:$targetDB ` 136 | /AccessToken:$AccessToken 137 | 138 | #Create Schema Compare Script 139 | Write-Host "Creating Schema Compare Script" 140 | $action = "Script" 141 | $ReportName = "DeployScript.sql" 142 | &$sqlpackage ` 143 | /a:$action ` 144 | /sf:$dacpac ` 145 | /op:"$OutputPath\$ReportName" ` 146 | /tsn:$srv ` 147 | /TargetDatabaseName:$targetDB ` 148 | /AccessToken:$AccessToken 149 | 150 | #Format XML Function 151 | function Format-Xml { 152 | <# 153 | .SYNOPSIS 154 | Format the incoming object as the text of an XML document. 155 | #> 156 | param( 157 | ## Text of an XML document. 158 | [Parameter(ValueFromPipeline = $true)] 159 | [string[]]$Text 160 | ) 161 | 162 | begin { 163 | $data = New-Object System.Collections.ArrayList 164 | } 165 | process { 166 | [void] $data.Add($Text -join "`n") 167 | } 168 | end { 169 | $doc = New-Object System.Xml.XmlDataDocument 170 | $doc.LoadXml($data -join "`n") 171 | $sw = New-Object System.Io.Stringwriter 172 | $writer = New-Object System.Xml.XmlTextWriter($sw) 173 | $writer.Formatting = [System.Xml.Formatting]::Indented 174 | $doc.WriteContentTo($writer) 175 | $sw.ToString() 176 | } 177 | } 178 | 179 | Write-Host " 180 | ================================================================================================= 181 | ================================================================================================= 182 | ================================================================================================= 183 | 184 | Deploymnet Report 185 | Report Format: XML 186 | Report Location: $OutputPath\DeployReport.xml 187 | Target Server: $srv 188 | Target Database: $SqlDb 189 | 190 | ================================================================================================= 191 | ================================================================================================= 192 | ================================================================================================= 193 | " 194 | Format-Xml (Get-Content "$OutputPath\DeployReport.xml") 195 | 196 | Write-Host " 197 | ================================================================================================= 198 | ================================================================================================= 199 | ================================================================================================= 200 | 201 | Deploymnet Script 202 | Description: The following script outputs what changes will deploy via SQL script. 203 | Scipt Location: $OutputPath\DeployScript.sql 204 | Report Format: SQL 205 | Target Server: $srv 206 | Target Database: $SqlDb 207 | 208 | ================================================================================================= 209 | ================================================================================================= 210 | ================================================================================================= 211 | " 212 | Get-Content "$OutputPath\DeployScript.sql" 213 | } 214 | 215 | If ($PackageAction -eq "Publish") { 216 | Write-host "Publishing DACPAC to Server: $srv Database: $targetDB" 217 | &$sqlpackage ` 218 | /a:$action ` 219 | /sf:$dacpac ` 220 | /tsn:$srv ` 221 | /TargetDatabaseName:$targetDB ` 222 | /AccessToken:$AccessToken 223 | } 224 | else { 225 | Write-host "Set action paramater to DeployReport or Publish" 226 | } 227 | 228 | #Remove Deployment Firewall Rule 229 | If ($CreateFirewallRule) { 230 | Write-Host "Removeing Deployment Firewall Rule." 231 | #Remove-AzSqlServerFirewallRule 232 | Remove-AzSqlServerFirewallRule -FirewallRuleName $RuleName -ResourceGroupName $ResourceGroupName -ServerName $SqlSrv 233 | } 234 | 235 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.902 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "trainingDW", "trainingDW\trainingDW.sqlproj", "{2B8CC657-8C68-478C-A0F7-36BDCA9ADDDA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2B8CC657-8C68-478C-A0F7-36BDCA9ADDDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2B8CC657-8C68-478C-A0F7-36BDCA9ADDDA}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2B8CC657-8C68-478C-A0F7-36BDCA9ADDDA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 17 | {2B8CC657-8C68-478C-A0F7-36BDCA9ADDDA}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {2B8CC657-8C68-478C-A0F7-36BDCA9ADDDA}.Release|Any CPU.Build.0 = Release|Any CPU 19 | {2B8CC657-8C68-478C-A0F7-36BDCA9ADDDA}.Release|Any CPU.Deploy.0 = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(SolutionProperties) = preSolution 22 | HideSolutionNode = FALSE 23 | EndGlobalSection 24 | GlobalSection(ExtensibilityGlobals) = postSolution 25 | SolutionGuid = {E78B9F59-071B-4861-9920-CB87C913E5B5} 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/Scripts/LoadMIP.sql: -------------------------------------------------------------------------------- 1 | --Insert Values into MIP Dim Table 2 | 3 | TRUNCATE TABLE dim.MIP 4 | SELECT * FROM dim.MIP 5 | 6 | INSERT INTO [dim].MIP (MipName,ShortDescription, ShortName, MipType, DeliveryDays, BilledHours, Notes, LastUpdated) VALUES ('Visual Studio ALM','Three-day instructor-led training','TFS Essentials - Azure Super Powers','WorkshopPLUS',3,24,'Azure Super Powers Delivery',GETDATE()) 7 | INSERT INTO [dim].MIP (MipName,ShortDescription, ShortName, MipType, DeliveryDays, BilledHours, Notes, LastUpdated) VALUES ('Windows PowerShell', 'Introduction to using PowerShell', 'PowerShell Foundation Skils', 'WorkshopPLUS', 4, 32, '', GETDATE()) 8 | INSERT INTO [dim].MIP (MipName,ShortDescription, ShortName, MipType, DeliveryDays, BilledHours, Notes, LastUpdated) VALUES ('Office 365', 'Developing Application with PowerApps', 'Developing Business Applications with PowerApps', 'WorkshopPLUS', 1, 8, '', GETDATE()) 9 | INSERT INTO [dim].MIP (MipName,ShortDescription, ShortName, MipType, DeliveryDays, BilledHours, Notes, LastUpdated) VALUES ('Office 365 SharePoint Online', 'manage and support Power Apps', 'PowerApps and Flow for Admins', 'WorkshopPLUS', 3, 24, '', GETDATE()) 10 | INSERT INTO [dim].MIP (MipName,ShortDescription, ShortName, MipType, DeliveryDays, BilledHours, Notes, LastUpdated) VALUES ('Data Platform Modernization for SQL', 'Data Platform Modernization Assessment for SQL', 'Data Platform Modernization for SQL', 'Assessment', 3, 24, '', GETDATE()) 11 | INSERT INTO [dim].MIP (MipName,ShortDescription, ShortName, MipType, DeliveryDays, BilledHours, Notes, LastUpdated) VALUES ('Azure SQL Database Essentials', 'Azure SQL Database Essentials provides you the knowledge and tools necessary to understand the capabilites', 'Azure SQL Database Essentials', 'WorkshopPLUS', 3, 24, '', GETDATE()) 12 | INSERT INTO [dim].MIP (MipName,ShortDescription, ShortName, MipType, DeliveryDays, BilledHours, Notes, LastUpdated) VALUES ('DevOps Fundamentals', 'Introduces the business value of DevOps', 'DevOps Fundamentals', 'DevOps Fundamentals', 4, 32, '', GETDATE()) 13 | 14 | 15 | SELECT * FROM dim.MIP 16 | 17 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/Security/Schemas/dim.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA [dim] 2 | AUTHORIZATION [dbo]; 3 | 4 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/Security/Schemas/fact.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA [fact] 2 | AUTHORIZATION [dbo] -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/Security/Schemas/stg.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA [stg] 2 | AUTHORIZATION [dbo] -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Tables/dim.Attendee.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [dim].[Attendee] ( 2 | [AttendeeId] INT IDENTITY (1, 1) NOT NULL, 3 | [FirstName] VARCHAR (30) NOT NULL, 4 | [LastName] VARCHAR (50) NOT NULL, 5 | [FullName] AS [FirstName] + ' ' + [LastName], 6 | [Area] VARCHAR (15) NULL, 7 | [StateEmail] VARCHAR (50) NULL, 8 | [DoSDevEmail] VARCHAR (50) NULL, 9 | [MSLiveEmail] VARCHAR (50) NULL, 10 | [LastUpdated] DATETIME NULL 11 | ); 12 | 13 | GO 14 | CREATE UNIQUE CLUSTERED INDEX [cix_Attendee_AttendeeID] ON [dim].[Attendee]([AttendeeId] ASC); 15 | 16 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Tables/dim.AttendeeNotes.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [dim].[AttendeeNotes] 2 | ( 3 | [AttendeeNotesId] INT IDENTITY (1, 1) NOT NULL, 4 | [AttendeeId] Int NOT NULL, 5 | [Notes] VARCHAR(255), 6 | [LastUpdated] DATE NULL 7 | ) 8 | 9 | GO 10 | 11 | CREATE UNIQUE CLUSTERED INDEX [cix_AttendeeNotes_AttendeeNotesId] ON [dim].[AttendeeNotes] ([AttendeeNotesId]) 12 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Tables/dim.Date.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [dim].[Date] 2 | ( 3 | [DateId] INT IDENTITY (1, 1) NOT NULL , 4 | [Date] DATE NOT NULL, 5 | [Day] TINYINT NOT NULL, 6 | DaySuffix CHAR(2) NOT NULL, 7 | [Weekday] TINYINT NOT NULL, 8 | WeekDayName VARCHAR(10) NOT NULL, 9 | IsWeekend BIT NOT NULL, 10 | IsHoliday BIT NOT NULL, 11 | HolidayText VARCHAR(64) SPARSE, 12 | DOWInMonth TINYINT NOT NULL, 13 | [DayOfYear] SMALLINT NOT NULL, 14 | WeekOfMonth TINYINT NOT NULL, 15 | WeekOfYear TINYINT NOT NULL, 16 | ISOWeekOfYear TINYINT NOT NULL, 17 | [Month] TINYINT NOT NULL, 18 | [MonthName] VARCHAR(10) NOT NULL, 19 | [Quarter] TINYINT NOT NULL, 20 | QuarterName VARCHAR(6) NOT NULL, 21 | [Year] INT NOT NULL, 22 | MMYYYY CHAR(6) NOT NULL, 23 | MonthYear CHAR(7) NOT NULL, 24 | FirstDayOfMonth DATE NOT NULL, 25 | LastDayOfMonth DATE NOT NULL, 26 | FirstDayOfQuarter DATE NOT NULL, 27 | LastDayOfQuarter DATE NOT NULL, 28 | FirstDayOfYear DATE NOT NULL, 29 | LastDayOfYear DATE NOT NULL, 30 | FirstDayOfNextMonth DATE NOT NULL, 31 | FirstDayOfNextYear DATE NOT NULL 32 | ) 33 | 34 | GO 35 | 36 | CREATE UNIQUE CLUSTERED INDEX [cix_Date_DateId] ON [dim].[Date](DateId ASC); 37 | 38 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Tables/dim.DeliveryStatus.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [dim].[DeliveryStatus] 2 | ( 3 | [DeliveryStatusId] INT IDENTITY (1, 1) NOT NULL, 4 | [Status] varchar(15), 5 | [LastUpdated] DATE NULL 6 | ) 7 | Go 8 | 9 | CREATE UNIQUE CLUSTERED INDEX [cix_DeliveryStatus_DeliveryStatusId] ON [dim].[DeliveryStatus](DeliveryStatusId ASC); -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Tables/dim.Instructor.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [dim].[Instructor] 2 | ( 3 | [InstructorId] INT IDENTITY (1, 1) NOT NULL , 4 | [FirstName] Varchar(30), 5 | [LastName] Varchar(30), 6 | [FullName] AS [FirstName] + ' ' + [LastName], 7 | [MSFTEmail] Varchar(30), 8 | [LastUpdated] DATE NULL 9 | ) 10 | GO 11 | 12 | CREATE UNIQUE CLUSTERED INDEX [cix_Instructor_InstructorId] ON [dim].[Instructor](InstructorId ASC); 13 | 14 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Tables/dim.Location.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [dim].[Location] 2 | ( 3 | [LocationId] INT IDENTITY (1, 1) NOT NULL , 4 | [State] VARCHAR(2) NULL, 5 | [City] VARCHAR(30) NULL, 6 | [OfficeAddress] VARCHAR(30) NULL, 7 | [CustomerSite] BIT NULL, 8 | [LocationNotes] VARCHAR(255) NULL, 9 | [LastUpdated] DATE NULL 10 | ) 11 | 12 | GO 13 | CREATE UNIQUE CLUSTERED INDEX [cix_Location_LocationId] ON [dim].[Location]([LocationId] ASC); 14 | 15 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Tables/dim.MIP.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [dim].[MIP] ( 2 | [MipId] INT IDENTITY (1, 1) NOT NULL, 3 | [MipName] VARCHAR (100) NULL, 4 | [ShortDescription] VARCHAR (255) NULL, 5 | [ShortName] VARCHAR (75) NULL, 6 | [MipType] VARCHAR (30) NULL, 7 | [DeliveryDays] INT NULL, 8 | [BilledHours] INT NULL, 9 | [Notes] VARCHAR(255) NULL, 10 | [LastUpdated] DATE NULL 11 | ); 12 | 13 | GO 14 | CREATE UNIQUE CLUSTERED INDEX [cix_MIP_MipId] ON [dim].[MIP]([MipId] ASC); 15 | 16 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Tables/dim.deliveredworkshop.sql: -------------------------------------------------------------------------------- 1 |  CREATE TABLE [dim].[deliveredworkshop] 2 | ( 3 | RowId int NOT NULL IDENTITY (1, 1) PRIMARY KEY CLUSTERED, 4 | [MIPName] VARCHAR(75) NULL, 5 | [MIPType] VARCHAR(30) NULL, 6 | [StartDeliveryDate] DATE NULL, 7 | [EndDeliveryDate] DATE NULL, 8 | [Hours] int NULL, 9 | [Attendee] VARCHAR(100) NULL, 10 | [AttendeeArea] VARCHAR(30) NULL, 11 | [AttendeeStateEmail] VARCHAR(40) NULL, 12 | [AttendeeDosDevAccnt] VARCHAR(40) NULL, 13 | [AttendeeMSLiveEmail] VARCHAR(40) NULL, 14 | [AttendedWorkShop] VARCHAR(4) NULL, 15 | [AttendeeNotes] VARCHAR(255) NULL, 16 | [PrimaryInstructor] VARCHAR(30) NULL, 17 | [SecondaryInstructor] VARCHAR(30) NULL, 18 | [DeliveriedCustomerSite] VARCHAR(4) NULL, 19 | [DeliveryOffice] VARCHAR(30) NULL, 20 | [DeliveryOfficeRoom] VARCHAR(15), 21 | [DeliveryLocationState] VARCHAR(2) NULL, 22 | [DeliveryLocationCity] VARCHAR(30) NULL, 23 | [LocationNotes] VARCHAR(255) NULL, 24 | [WorkshopNotes] VARCHAR(255) NULL, 25 | [ROSSId] VARCHAR(50) NULL 26 | ) 27 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/dim/Views/dim.vwWorkshop.sql: -------------------------------------------------------------------------------- 1 | CREATE VIEW [dim].[vwWorkshop] 2 | AS SELECT * FROM dim.deliveredworkshop 3 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/fact/Tables/fact.MIPfact.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [fact].[MIPfact] 2 | ( 3 | [MIPFactId] INT IDENTITY (1, 1) NOT NULL , 4 | MIPId INT, 5 | AttendeeId INT, 6 | AttendeeNotesId INT, 7 | InstructorId INT, 8 | LocationId INT, 9 | DeliveryDateId INT, 10 | DeliveryStatus INT, 11 | Attended bit, 12 | [Count] int NOT NULL DEFAULT 1 13 | 14 | ) 15 | GO 16 | 17 | CREATE UNIQUE CLUSTERED INDEX [cix_Date_DateId] ON [fact].[MIPfact](MIPfactId ASC); 18 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/stg/Programmability/Stored Procedures/stg.ClearStaging.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE [stg].[ClearStaging] 2 | AS 3 | Truncate Table stg.workshop -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/stg/Programmability/Stored Procedures/stg.LoadDims.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE [stg].[LoadDims] 2 | 3 | AS 4 | 5 | --Load Attendee Dim 6 | Print 'Loading Attendee Dim' 7 | insert into dim.Attendee with (tablock) 8 | (FirstName, LastName, Area, StateEmail, DoSDevEmail, MSLiveEmail, LastUpdated) 9 | Select 10 | case when CHARINDEX(' ', w.Attendee) = 0 11 | then w.Attendee 12 | else Left(w.Attendee, CHARINDEX(' ', w.Attendee)-1) 13 | end as FirstName, 14 | case when CHARINDEX(' ', w.Attendee) = 0 15 | then '' 16 | else substring( 17 | Attendee, CHARINDEX(' ', w.Attendee)+1, len(w.Attendee)) 18 | end as LastName, 19 | w.AttendeeArea as Area, 20 | w.AttendeeStateEmail as StateEmail, 21 | w.AttendeeDosDevAccnt as DoSDevEmail, 22 | w.AttendeeMSLiveEmail as MSLiveEmail, 23 | getdate() as UpdateDate 24 | 25 | From stg.workshop w 26 | Left Join dim.Attendee a on a.FirstName + ' ' + a.LastName = ltrim(w.Attendee) 27 | Where a.AttendeeId is null 28 | 29 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/stg/Tables/stg.workshop.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE [stg].[workshop] 2 | ( 3 | RowId int NOT NULL IDENTITY (1, 1) PRIMARY KEY CLUSTERED, 4 | [MIPName] VARCHAR(75) NULL, 5 | [MIPType] VARCHAR(30) NULL, 6 | [StartDeliveryDate] DATE NULL, 7 | [EndDeliveryDate] DATE NULL, 8 | [Hours] int NULL, 9 | [Attendee] VARCHAR(100) NULL, 10 | [AttendeeArea] VARCHAR(30) NULL, 11 | [AttendeeStateEmail] VARCHAR(40) NULL, 12 | [AttendeeDosDevAccnt] VARCHAR(40) NULL, 13 | [AttendeeMSLiveEmail] VARCHAR(40) NULL, 14 | [AttendedWorkShop] VARCHAR(4) NULL, 15 | [AttendeeNotes] VARCHAR(255) NULL, 16 | [PrimaryInstructor] VARCHAR(30) NULL, 17 | [SecondaryInstructor] VARCHAR(30) NULL, 18 | [DeliveriedCustomerSite] VARCHAR(4) NULL, 19 | [DeliveryOffice] VARCHAR(30) NULL, 20 | [DeliveryOfficeRoom] VARCHAR(15), 21 | [DeliveryLocationState] VARCHAR(2) NULL, 22 | [DeliveryLocationCity] VARCHAR(30) NULL, 23 | [LocationNotes] VARCHAR(255) NULL, 24 | [WorkshopNotes] VARCHAR(255) NULL, 25 | [ROSSId] VARCHAR(50) NULL 26 | ) 27 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/trainingDW.refactorlog: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /source/DatabaseProjects/trainingDW/trainingDW/trainingDW.sqlproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | trainingDW 7 | 2.0 8 | 4.1 9 | {2b8cc657-8c68-478c-a0f7-36bdca9addda} 10 | Microsoft.Data.Tools.Schema.Sql.SqlAzureDatabaseSchemaProvider 11 | Database 12 | 13 | 14 | trainingDW 15 | trainingDW 16 | 1033,CI 17 | BySchemaAndSchemaType 18 | True 19 | v4.5 20 | CS 21 | Properties 22 | False 23 | True 24 | True 25 | SQL_Latin1_General_CP1_CI_AS 26 | False 27 | False 28 | None 29 | ReadWrite 30 | 900 31 | 60 32 | 200 33 | 30 34 | 100 35 | Off 36 | 0 37 | Off 38 | Off 39 | DISABLED 40 | False 41 | False 42 | None 43 | True 44 | False 45 | 2049 46 | OFF 47 | 120 48 | SECONDS 49 | False 50 | True 51 | 2 52 | Hours 53 | True 54 | False 55 | False 56 | False 57 | CHECKSUM 58 | EnableBroker 59 | False 60 | SIMPLE 61 | True 62 | False 63 | True 64 | False 65 | 140 66 | False 67 | False 68 | False 69 | False 70 | False 71 | False 72 | False 73 | False 74 | ONLINE 75 | False 76 | GLOBAL 77 | False 78 | True 79 | False 80 | True 81 | False 82 | MULTI_USER 83 | FULL 84 | True 85 | PRIMARY 86 | True 87 | 88 | 89 | bin\Release\ 90 | $(MSBuildProjectName).sql 91 | False 92 | pdbonly 93 | true 94 | false 95 | true 96 | prompt 97 | 4 98 | 99 | 100 | bin\Debug\ 101 | $(MSBuildProjectName).sql 102 | false 103 | true 104 | full 105 | false 106 | true 107 | true 108 | prompt 109 | 4 110 | SQL_Latin1_General_CP1_CI_AS 111 | 112 | 113 | 11.0 114 | 115 | True 116 | 11.0 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | Off 144 | 145 | 146 | Off 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /source/Deployments/ARM/parameters/KeyVault.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "keyVaultName": { 6 | "value": "Enter KeyVaultName" 7 | }, 8 | "location": { 9 | "value": "eastus2" 10 | }, 11 | "sku": { 12 | "value": "Standard" 13 | }, 14 | "accessPolicies": { 15 | "value": [ 16 | { 17 | "objectId": "11111111-1111-1111-1111-111111111111", 18 | "tenantId": "11111111-1111-1111-1111-111111111111", 19 | "metadata": { 20 | "description": "Service Principal - DevOps-DLM" 21 | }, 22 | "permissions": { 23 | "keys": [ 24 | "Get", 25 | "List", 26 | "Update", 27 | "Create", 28 | "Import", 29 | "Delete", 30 | "Recover", 31 | "Backup", 32 | "Restore" 33 | ], 34 | "secrets": [ 35 | "Get", 36 | "List", 37 | "Set", 38 | "Delete", 39 | "Recover", 40 | "Backup", 41 | "Restore" 42 | ], 43 | "certificates": [ 44 | "Get", 45 | "List", 46 | "Update", 47 | "Create", 48 | "Import", 49 | "Delete", 50 | "Recover", 51 | "ManageContacts", 52 | "ManageIssuers", 53 | "GetIssuers", 54 | "ListIssuers", 55 | "SetIssuers", 56 | "DeleteIssuers" 57 | ], 58 | "storage": [ 59 | "Get", 60 | "List", 61 | "Update", 62 | "Set", 63 | "Delete", 64 | "Regeneratekey", 65 | "Recover", 66 | "Backup", 67 | "Restore" 68 | ] 69 | } 70 | } 71 | ] 72 | }, 73 | "tenant": { 74 | "value": "11111111-1111-1111-1111-111111111111" 75 | }, 76 | "enabledForDeployment": { 77 | "value": false 78 | }, 79 | "enabledForTemplateDeployment": { 80 | "value": true 81 | }, 82 | "enabledForDiskEncryption": { 83 | "value": false 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /source/Deployments/ARM/parameters/sql_db.parameters.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "autoSetAdminAccount": { 6 | "metadata": { 7 | "comments": "Auto Set the required SQL Admin account. Defualt is true" 8 | }, 9 | "value": true 10 | }, 11 | "adminUsername": { 12 | "metadata": { 13 | "comments": "Set SQL Auth admin account if you are not auto setting it, cannot use reserved accounts like: admin, sys, dbo, master" 14 | }, 15 | "value": "" 16 | }, 17 | "adminPassword": { 18 | "metadata": { 19 | "comments": "Set SQL Auth admin password if you are not auto setting it" 20 | }, 21 | "value": "" 22 | }, 23 | "serverName": { 24 | "metadata": { 25 | "comments": "SQL TDS Endpoint Name - Logical Server Name for SQL DBs." 26 | }, 27 | "value": "enter name for logical server" 28 | }, 29 | "serverADAdminGroup": { 30 | "metadata": { 31 | "comments": "AAD admin group name, this is the group used for AAD admins of your logical server." 32 | }, 33 | "value": "Enter AAD Name" 34 | }, 35 | "serverADAdminSID": { 36 | "metadata": { 37 | "comments": "SID for AAD group you will use as the AAD SQL Admin. This can be found via AAD or PowerShell" 38 | }, 39 | "value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 40 | }, 41 | "databases": { 42 | "metadata": { 43 | "comments": "Create and Set Tier of Multiple Databases " 44 | }, 45 | "value": [ 46 | { 47 | "databaseName": "trainingDW", 48 | "databaseSku": { 49 | "name": "S1", 50 | "tier": "Standard", 51 | "family": "", 52 | "capacity": 20 53 | }, 54 | "dbCollation": "SQL_Latin1_General_CP1_CI_AS" 55 | } 56 | ] 57 | }, 58 | "createFirewallAllServices": { 59 | "metadata": { 60 | "comments": "Setup Firewall Rule to Allow access from all Azure services: true/false" 61 | }, 62 | "value": true 63 | }, 64 | "CreateVNetFirewall": { 65 | "metadata": { 66 | "comments": "Setup VNetFirewall Rule: true/false" 67 | }, 68 | "value": false 69 | }, 70 | "vNetRule": { 71 | "metadata": { 72 | "comments": "vNet Service end point, enter values for each vNet firewall rule you want to create. Provide: vNetResourceGroup, vNetName, vNetSubNetName for each rule to create. " 73 | }, 74 | "value": [ 75 | { 76 | "subscriptionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 77 | "vNetResourceGroup": "RG Name for vNet", 78 | "vNetName": "VNetName", 79 | "vNetSubNetName": "SubNet Name" 80 | } 81 | ] 82 | }, 83 | "CreateFirewallRangeRule": { 84 | "metadata": { 85 | "comments": "Setup Firewall Range Rule: true/false" 86 | }, 87 | "value": false 88 | }, 89 | "FirewallRangeRule": { 90 | "metadata": { 91 | "comments": "Firewall Range rule, create StartIpAddress and EndIpAddress for each range rule " 92 | }, 93 | "value": [ 94 | { 95 | "Name": "Enter Name for Firewall Range Rule", 96 | "StartIp": "xxx.xxx.xxx.xxx", 97 | "EndIp": "xxx.xxx.xxx.xxx" 98 | } 99 | ] 100 | }, 101 | "createLogAnalyticsWorkspace": { 102 | "metadata": { 103 | "comments": "Create the Log Anlytic's Workspace: true/false" 104 | }, 105 | "value": true 106 | }, 107 | "LogAnalyticsWorkspaceResourceGroup": { 108 | "metadata": { 109 | "comments": "Resource Group name for an existing Log Analytics Workspace, if you are not creating one with this template" 110 | }, 111 | "value": "" 112 | }, 113 | "LogAnalyticsWorkspaceName": { 114 | "metadata": { 115 | "comments": "Log Analytics Workspace name for an existing Workspace, or the name of your new Workspace if createLogAnalyticsWorkspace is set to true" 116 | }, 117 | "value": "LogAnalyticsWorkspaceSQLDB" 118 | }, 119 | "LogAnalyticsServicetier": { 120 | "metadata": { 121 | "description": "Set Log Analytics Service tier: Free, Standalone, or PerNode" 122 | }, 123 | "value": "Standalone" 124 | }, 125 | "LogAnalyticsDataRetention": { 126 | "metadata": { 127 | "description": "Number of days of retention. Free plans can only have 7 days, Standalone and OMS plans include 30 days for free" 128 | }, 129 | "value": 60 130 | }, 131 | "diagnosticName": { 132 | "metadata": { 133 | "description": "Diagnotics name for Azure SQL DB diagnotics to Log Analytics" 134 | }, 135 | "value": "SQL-Diag" 136 | }, 137 | "auditActionsAndGroups": { 138 | "metadata": { 139 | "description": "Audit Settings for Azure SQL DB, for full list of allowed values review the auditActionsAndGroups Allowed Values from the template file." 140 | }, 141 | "value": [ 142 | "BATCH_COMPLETED_GROUP", 143 | "SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP", 144 | "FAILED_DATABASE_AUTHENTICATION_GROUP", 145 | "USER_CHANGE_PASSWORD_GROUP", 146 | "BACKUP_RESTORE_GROUP", 147 | "DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP", 148 | "DATABASE_OBJECT_PERMISSION_CHANGE_GROUP" 149 | ] 150 | }, 151 | "enableAlertPolicies": { 152 | "metadata": { 153 | "description": "Enable Alert Policies: true/false, this uses Azure SQL DB adv. threat detection to email alerts." 154 | }, 155 | "value": true 156 | }, 157 | "emailAddresses": { 158 | "metadata": { 159 | "description": "Threat Detection: Emails addresses to enable the send alerts to " 160 | }, 161 | "value": [ 162 | "xxxxxx@xxxxxxxx.com" 163 | ] 164 | }, 165 | "createStorageAccount": { 166 | "metadata": { 167 | "description": "Create Storage Account for Auditing, if not providing one: true/false" 168 | }, 169 | "value": true 170 | }, 171 | "storageName": { 172 | "metadata": { 173 | "description": "Name for the new Storage Account, or Name of the Existing Storage Account to use" 174 | }, 175 | "value": "sqllogs", 176 | "minLength": 1, 177 | "maxLength": 11 178 | }, 179 | "paramStorageType": { 180 | "metadata": { 181 | "description": "Storage Account Type for the new Storage Account to be used for auditing" 182 | }, 183 | "value": "Standard_LRS" 184 | } 185 | } 186 | } -------------------------------------------------------------------------------- /source/Deployments/ARM/templates/KeyVault.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "keyVaultName": { 6 | "type": "string" 7 | }, 8 | "location": { 9 | "type": "string" 10 | }, 11 | "sku": { 12 | "type": "string", 13 | "defaultValue": "Standard", 14 | "allowedValues": [ 15 | "Standard", 16 | "standard", 17 | "Premium", 18 | "premium" 19 | ], 20 | "metadata": { 21 | "description": "SKU for the vault" 22 | } 23 | }, 24 | "accessPolicies": { 25 | "type": "array", 26 | "defaultValue": [], 27 | "metadata": { 28 | "description": "The access policies defined for this vault." 29 | } 30 | }, 31 | "tenant": { 32 | "type": "string" 33 | }, 34 | "enabledForDeployment": { 35 | "type": "bool" 36 | }, 37 | "enabledForTemplateDeployment": { 38 | "type": "bool" 39 | }, 40 | "enabledForDiskEncryption": { 41 | "type": "bool" 42 | } 43 | }, 44 | "variables": {}, 45 | "resources": [ 46 | { 47 | "name": "[parameters('keyVaultName')]", 48 | "type": "Microsoft.KeyVault/vaults", 49 | "apiVersion": "2015-06-01", 50 | "location": "[parameters('location')]", 51 | "tags": {}, 52 | "properties": { 53 | "tenantId": "[parameters('tenant')]", 54 | "sku": { 55 | "family": "A", 56 | "name": "[parameters('sku')]" 57 | }, 58 | "accessPolicies": "[parameters('accessPolicies')]", 59 | "enabledForDeployment": "[parameters('enabledForDeployment')]", 60 | "enabledForDiskEncryption": "[parameters('enabledForDiskEncryption')]", 61 | "enabledForTemplateDeployment": "[parameters('enabledForTemplateDeployment')]" 62 | }, 63 | "resources": [] 64 | } 65 | ], 66 | "outputs": {} 67 | } -------------------------------------------------------------------------------- /source/Deployments/ARM/templates/empty-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": {}, 5 | "variables": {}, 6 | "resources": [] 7 | } -------------------------------------------------------------------------------- /source/Deployments/Scripts/KeyVault-WriteSecrets.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | $kVaultName, 3 | $ResourceGroup, 4 | $adminLogin, 5 | $adminPass 6 | ) 7 | 8 | Function ToSecret { 9 | Param($val) 10 | $secret = ConvertTo-SecureString -String $val -AsPlainText -Force 11 | $secret 12 | } 13 | 14 | $kvSecrets = @{ 15 | 'SQLadminLogin' = ToSecret -val $adminLogin 16 | 'SQLadminPass' = ToSecret -val $adminPass 17 | } 18 | 19 | ForEach($Key in $kvSecrets.Keys){ 20 | $response = Set-AzKeyVaultSecret -VaultName $kVaultName -Name $Key -SecretValue $kvSecrets[$Key] 21 | Write-Host $response 22 | } 23 | 24 | -------------------------------------------------------------------------------- /source/Deployments/Scripts/Parse-ARMOutputs.ps1: -------------------------------------------------------------------------------- 1 |  2 | param ( 3 | [Parameter(Mandatory=$true)][string]$ARMOutput 4 | ) 5 | 6 | #region Convert from json 7 | $json = $ARMOutput | convertfrom-json 8 | $sqlAdminLogin = $json.administratorLogin.value 9 | $sqlAdminPass = $json.administratorLoginPassword.value 10 | #endregion 11 | 12 | #region Parse ARM Template Output 13 | Write-Host "##vso[task.setvariable variable=sql.Login]$sqlAdminLogin" 14 | Write-Host "##vso[task.setvariable variable=sql.Pass;issecret=true]$sqlAdminPass" 15 | #endregion 16 | 17 | --------------------------------------------------------------------------------