Ways to Deploy/Transfer Sitecore Files in Azure
How do you deploy your dev files from your local machine to Azure? There are ways you can do that and I’m gonna share you some simple ways, even the craziest ones that work.
1. Visual Studio Publish
- First, login to the Azure Portal with your credentials
- Open your App Service instance, make sure to target the correct one (e.g. CM/CD servers)
- Get the Publish Profile
This will download a .PublishSettings file - Go to your Visual Studio Solution
- Right-click on the file/project that you would like to deploy, click Publish…
- Select Import Profile
- Browse for the downloaded Publish Settings file
- Click Finish.
- Hit Publish.
The Output window will display the progress.
2. App Service Editor
Let’s discuss this nifty tool a bit. So Azure has this App Service Editor that is based on Visual Studio Code UI that allows you to edit text files on the fly and download even non-text-readable files from it. Just scroll down from the side bar of the App Service, find App Service Editor (Preview) under Development and click Go.
Be VERY careful though when you’re changing some files here, especially the configs and views because this tool automatically saves your changes and when that happens, it might break the site before you even know it, and other people accessing the site can be REALLY pissed off.
3. File Transfer Protocol (FTP)
Yep! The good-ol’-FTP. From the name itself, the goal is to transfer file to the server via this protocol. So how do we use this beast? Simple.
- Just download any FTP client out there. One good free app is the FileZilla. Install it to your machine
- Remember the .PublishSettings file mentioned in option 1? Open it via any text editor.
- Locate the publish profile name with an “- FTP” suffix. Take note of these three important attributes:
- Open your FTP client.
- Paste the credentials onto the input boxes at the top. Hit Quickconnect.
- Now you’ll see the file explorer of your machine on the left and the Azure /site/wwwroot folder on the right.
- You can now double-click any file to transfer it between environments or right-click > Download. It’s just the same.
- NOTE: There are times where you might run into some issues where you can’t start the transfer successfully. Either you ask the Azure admin to allow this kind of protocol, or click Edit > Clear private data in the ribbon, then try it using Administrator Mode.
Deployment Without Azure Access
4. Sitecore Tools
There might be some instances where you are sadly limited to access to Azure, yet you wanted to check and deploy some assembly. Don’t fret because Sitecore has some built-in tools that you can use to accomplish this.
- Sitecore File Explorer – To view some files from Sitecore, open this tool using the following url. This is pretty helpful when verifying an assembly version for example. Just download the file from there and check file Properties > Details. Also note that you can make the view of the File Explorer better by right clicking on the file panel and selecting Details.
/sitecore/shell/default.aspx?xmlcontrol=FileExplorer
- Sitecore Package Designer – You know how this works. Just click the Sitecore start button from desktop shell > Development > Package Designer. Click Files Statically… > Select the file/assembly > Name it > Download as Zipped package.
- The Brute Force Method
“Now what?” you may ask. The technique here is to extract the .zip file, even the package.zip inside of it, open the files folder and replace the downloaded file/assembly that you wanted replaced. Then zip the folders again into package.zip then zip it again to another named file, kinda like “zipception“. Now you can use this to replace the file/assembly in the Sitecore instance via Sitecore Installation Wizard. The key here is that the structure of the zipped file should follow from the ones created via Sitecore Package Designer. This is one crazy method, but, hey, it works!