London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Tomek Juranek
Mar 15, 2025
  532
(4 votes)

Optimizely CMS Developer Tools for macOS

Running Optimizely CMS on macOS presents unique challenges, as the platform was traditionally primarily designed for Windows environments. However, with the right setup-leveraging tools like Docker, .NET Framework, VS Code, Azure Storage Explorer and Azure Data Studio developers can create a smooth and efficient workflow for building and testing Optimizely projects on macOS. This article explores the necessary configurations, step-by-step installation processes to ensure a seamless development experience.

Installation

First of all you need to install Powershell on your Mac, there are couple of different methods to install it as described here. After the installation run pwsh in macOS terminal. Majority of CLI commands in this article should be run from Powershell.

To host PaaS CMS database on macOS you need Docker Desktop. After the installation, create docker-compose-yml file with:

version: "3.9"
services:
mssql:
image: mcr.microsoft.com/azure-sql-edge/developer
container_name: "mssql"
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "MySecretPassword"
ports:
- "1433:1433"
volumes:
- ./data:/var/opt/mssql/data
- ./log:/var/opt/mssql/log
- ./secrets:/var/opt/mssql/secrets

Start the container with SQL database by running docker compose up command from the folder with .yml file.

To run Optimizely CMS locally you also need to install .Net framework for macOS. You may also need Node.js if you have headless front-end.

If you haven't install Optimizely PaaS CMS yet, you need to run few commands from Powershell CLI:
dotnet dev-certs https --trust

dotnet nuget add source http://nuget.episerver.com/feed/packages.svc -n Optimizely

dotnet new -i EPiServer.Templates

dotnet tool install EPiServer.Net.Cli --global --add-source https://nuget.optimizely.com/feed/packages.svc/
 
You can create a new project using Optimizely CLI commands. To create new database run from your project folder:
dotnet-episerver create-cms-database {You project}.csproj -S localhost -dn {You db name} -U sa -P {You SA password from docker-compose.yml}

dotnet-episerver add-admin-user {Your project}.csproj -u [username] -e [email] -p [password] -c EPiServerDB

Working with Code

To run and debug your Optimizely CMS project use Visual Studio Code with C# Dev Kit (for PaaS CMS). Other helpful extensions are ESLint to analyze javascript code and Prettier to help keeping the code formatting clean, but you may find more extensions for your use case. TIP: can create /{Your project root}/.vscode/extensions.json file with recommented VS Code extensions for your team.

Database Management

To manage local database server and migrate the database backup exported from DXP PaaS portal use Azure Data Studio for macOS with SQL Server dacpac extension.

First connect to your local SQL instance on Docker (use localhost server):

Then right click on Databases and select "Data-tier Application Wizard". Select "Create a database from a .backpac file". Choose a backpac file exported from PaaS Portal and import it under new name.

After the import is done, select new database and navigate to 'Security'->'Users', right click on the 'Users' folder and click on 'New User'. In 'User name' use the same name as you had before in your local instance, in 'Login name' use the same login as you had before, in 'Default schema' select dbo, in 'Owned schemas' use db_owner, in 'Membership' select db_owner.

Update connection string in your {You web project folder}\appsettings.Development.json so it points to new database name. After login to Optimizely on your local, go to settings sections: "Manage Websites" and "Open ID Connect" and update hostnames to point to your localhost.

Assets Management

To import assets from Optimizely DXP you need Powershell CLI and Azure Storage Explorer.

Using Powershell command line install EpiCloud Powershell CLI: Install-Module -Name EpiCloud
Then connect to the cloud on DXP environment by running Powershell: Connect-EpiCloud -ClientKey {your client key} -ClientSecret {your client secret} -ProjectId {your project id} you can find all necessary connection details in PaaS Portal under API tab.

Finally generate your sasLink to media storage by calling Powershell: Get-EpiStorageContainerSasLink -Environment "{name of the envionment for example: Integration}" -StorageContainer "mysitemedia" -RetentionHours 1 | Format-Table sasLink -AutoSize -Wrap.

In Azure Storage Explorer click "Open Connection Dialog", select 'Blob Container or directory' and use 'Shared access signature URL (SAS)' option. In 'Blob container or directory SAS URL' paste sasLink from previous command.
 
 
Open Blob Container and expand 'Download' button and use 'Download All' to download entire storage to local folder. Move the downloaded folder content to {You web project folder}\App_Data\blobs\.
Mar 15, 2025

Comments

cherr
cherr Apr 16, 2025 05:07 AM

Thank you for this Tomek, definitely will try this out.

How would you recommend the approach to a current setup? Currently our team is using Windows, but want to use an ubuntu/linux version. Which part of the steps above should we start on? Any help would be appreciated. Thank you!!

Please login to comment.
Latest blogs
Identifying Spike Requests and Issues in Application Insights

Sometimes within the DXP we see specific Azure App Instances having request spikes causing performance degredation and we need to investigate. I fi...

Scott Reed | Apr 25, 2025

Optimizely Frontend Hosting Beta – Early Thoughts and Key Questions

Optimizely has opened the waitlist for its new Frontend Hosting capability. I’m part of the beta programme, but my invite isn’t due until May, whil...

Minesh Shah (Netcel) | Apr 23, 2025

Developer Meetup - London, 21st May 2025

The London Dev Meetup has been rescheduled for Wednesday, 21st May and will be Candyspace 's first Optimizely Developer Meetup, and the first one...

Gavin_M | Apr 22, 2025

Frontend hosting for PaaS & SaaS CMS

Just announced on the DXP, we FINALLY have a front end hosting solution coming as part of the DXP for modern decoupled solutions in both the PaaS a...

Scott Reed | Apr 22, 2025