How can I convert a given Sitecore Package previously created using the Package Designer into a WDP package, so that I can create a script to deploy it on my Azure instances?
2 Answers
Prerequisites
- Download the AzureToolkit from Sitecore.
- Powershell 4.x or newer ($PSVersionTable.PSVersion to check your current version)
- Download and install MSDeploy.
- SQL Server (The express version is enough)
- Microsoft SQL Server Data-Tier Application Framework (DacFX) for SQL server 2012 or later.
Steps
1 - Import the methods you will need from AzureToolkit to the current PowerShell session.
Import-Module "AzureToolkitFolderPath\tools\Sitecore.Cloud.Cmdlets.dll" -Verbose
2 - Convert the input package using the ConvertTo-SCModuleWebDeployPackage
method.
ConvertTo-SCModuleWebDeployPackage -Path "yourPackagePath.zip" -Destination "wdpOutputDirectoryPath" -force -verbose
The above response is correct for the straight up conversion of the package to a WDP (scwdp.zip).
In case it helps, there are quite a few goodies that make use of the Azure Toolkit to generate WDPs and to then deploy to Azure in the HabitatHome.Platform repo
The main PS scripts are in /Azure and a lot of it is called / used by build.cake. It's not for the faint of heart and needs some work but as I say it would contain some nuggets that you could probably make use of / learn from.