While having so much heard about SDL DXA (Digital Experience Accelerator) and being among one of the few community members, I decided to write this blog to walk you through (if you did not get chance to do so) the basic steps and set up we need to run the SDL DXA .Net Application working on your local system.
Please follow this steps to achieve that:
- Prerequisites of this blog : Make sure below environments/Infrastructures are ready for you:
- Content Manager Endpoint: https://your-cm-web-server.dev.tridion.com
- Core Service Endpoint: https://your-cm-web-server.dev.tridion.com/webservices/CoreService201601.svc
- Discovery Staging: https://your-cis-stg-server.dev.tridion.com:8083/discovery.svc
- Presentation Staging: https://your-cd-pres-server.dev.tridion.com
- Make sure DXA publications are imported to CME. And you see 100, 200, 400 publications in Content Explorer.
- Make sure Topology Manager is configured and localhost is set as one of the website in topology manager.
- Download the DXA (SDL Digital Experience Accelerator .NET) from community site or from link given in SDL Docs Here
- Extract the package and copy out SDL DXA .NET 1.5websrc contents to your choice of folder say D:SDLDXAWebappClientsrc
- By default you will see severals dlls under srcSitebin folder.
- Under srcSitebin, Create a folder config.
- srcSitebinconfig should have following set of files:
<?xml version="1.0" encoding="UTF-8"?> <ServiceConfig ConnectionTimeout="10000" CacheEnabled="true" CacheExpirationDuration="1" ServiceAvailabilityCheck="false"> <DiscoveryService ServiceUri="https://<discovery_host_url>:8083/discovery.svc"/> <TokenService ClientId="cduser" ClientSecret="CDUserP@ssw0rd"/> </ServiceConfig>
Note: <discovery_host_url> can be localhost if you are setting up the webapp on the same server where discovery.svc is running or the host_url of the server. i.e something like – https://your-discovery-server:8083/discovery.svc
Use default file came with DXA WebApp under SDL DXA .NET 1.5webweb8web-refconfig
Use this to set your Logs rules. You can set your log location in web.config as well but do remember that log location set in web.config will override the location set in logback.xml
<appSettings> <!-- SDL Web 8 CDaaS configuration settings: --> <add key="discovery-service-uri" value="https://your-discovery-server:8083/discovery.svc" /> . . <add key="log-output" value="C:Tridionlogstoshibastagingcd_client.log" /> <!-- CIL caching can be enabled on Staging; CIL 8.1.1+ will bypass the cache for XPM Session Preview. The service-caching-expiration setting is in seconds. --> . . <add key="oauth-enabled" value="true" /> <!-- toggled from false to True --> <add key="oauth-client-id" value="cduser" /> <add key="oauth-client-secret" value="CDUserP@ssw0rd" /> <!-- "CDUserP@ssw0rd" is nothing but the "ClientSecret" value of <TokenService ClientId="cduser" ClientSecret="bla bla bla"/> of cd_client_conf.xml file. --> </appSettings>
- Make sure port 8083 is open for you so that you can use discovery service.
- Set localhost website in topology manager to use that locally in local computer
Hint: set-ttmwebsite -Id Website2 -BaseUrls @("https://your-cd-pres-server.dev.tridion.com", "http://localhost:60585") Note: Port is what you set or got by default while running the webapp using visual studio.
- Since you have setup everything locally to start debugging your DXA site, you need to publish minimal pages to see your site running.
- Publish below pages to the target you want to test against. To publish the minimal set of items, select and publish the following Pages in turn:
Home/_Error Page Not Found Home/_Navigation Home/000 Home Home/Sitemap Home/_System/Publish Settings Home/_System/Publish HTML Design Home/_System/include/Content Tools Home/_System/include/Footer Home/_System/include/Header Home/_System/include/Left Navigation
- Run “DxaWebApp.sln” using visual studio. Build solution so that all the NuGet packages can be restored.
- Hit rebuild solution and Run the DXA site application and you will see the page at http://localhost:60585/
- That’s it. Everything is set up now. Enjoy 🙂
If you still need help, Please post your question on Tridion Stack Exchange (Trex)