Blog posts by Andrew Pohto2019-11-07T21:15:24.0000000Z/blogs/andrew-pohto/Optimizely WorldEpi best practices checklist/blogs/andrew-pohto/dates/2019/11/epi-audit-checklist/2019-11-07T21:15:24.0000000Z<p>Temporarily removed sorry.</p>Summary extension for rich text fields/blogs/andrew-pohto/dates/2019/8/summary-extension-for-rich-text-fields/2019-08-01T20:15:16.0000000Z<p>Here is an extension that allows you to take a subsection of a rich text field and display it as a string.</p>
<pre class="language-csharp"><code>public static string GetSummary(this XhtmlString input, int? summaryLength = null)
{
if (input != null)
{
var summary = TextIndexer.StripHtml(input.ToString(), summaryLength ?? 0);
summary = HttpUtility.HtmlDecode(summary);
return summary + "...";
}
return null;
}</code></pre>
<p>I've found this extension useful, especially for displaying search results.</p>
<p>Just a quick example so folks don't have to keep reinventing the wheel.</p>Deploying Your Episerver Site to Azure via Kudu/blogs/andrew-pohto/dates/2019/7/deploying-your-episerver-site-to-azure-via-kudu/2019-08-01T18:09:16.0000000Z<p>I will preface this by saying that this is an alternative deployment option for when Azure DevOps CI/CD isn't an option for you. That being said if that isn't an option for you I hope this helps.</p>
<p>
<p>Kudu is the engine that the Azure App Service uses for Git deployments.</p>
<p><a href="https://github.com/projectkudu/kudu/wiki">https://github.com/projectkudu/kudu/wiki</a></p>
<p>You can access Kudu by logging into <a href="https://www.portal.azure.com">https://www.portal.azure.com</a> but, before we get to accessing Kudu in order to deploy, first we need to produce a zipped up copy of the site code we want to deploy.</p>
<p>In order to do this, I'm going to open up the solution in Visual Studio. From here I'm going to set up a publish profile to publish the site locally where I can zip it up for deployment.</p>
<p>To set up a publish profile look in the toolbar for where it says "Publish" with a drop down next to it.</p>
<p><img src="/link/39bbd261576e44849785a05769c5bf8f.aspx" /></p>
<p>Click on that drop down and select the "New Custom Profile" option.</p>
<p>In the window that opens up select Folder as the publish target type and then provide the path to where you want to publish making sure that the path ends with ".../wwwroot".</p>
<p>Next click on "Advanced" and ensure that the proper configuration is selected so the correct transforms are applied. Then click save to close that window and press the publish button.</p>
<p>Navigate to where you published your code and confirm that everything is there.</p>
<p>Once you've confirmed everything is present and accounted for zip up the wwwroot directory. This is what you'll be providing to Kudu for deployment.</p>
<p>Now that you have your zip file open up <a href="https://www.portal.azure.com">https://www.portal.azure.com</a> in your browser.</p>
<p>Login and then click on your account in the upper right once you are on the dashboard.</p>
<p>Confirm that you have the proper directory for the site you want to deploy to selected. If not select "Switch Directories" and choose the correct one.</p>
<p>Next go to the toolbar on the left of the page and select "App Services".</p>
<p><img src="/link/27e929516e50497cb3de25bf12ccacca.aspx" /></p>
<p>Click on the app service for the site you are deploying to and the scroll down in the toolbar of the window that opens to the "Development Tools" section and select "Advanced Tools" and then "Go". This will open up Kudu in a new tab.</p>
<p><img src="/link/0a006445ee204d14a161b7959820629e.aspx" /></p>
<p>At the top of the screen click on the "Debug Console" dropdown and select "CMD".</p>
<p>You are now presented with a screen that has a file explorer listing the home directories for the server at the top and a command line at the bottom.</p>
<p>Click on the "Site" directory and then scroll down to the bottom where you should see the wwwroot folder on the server.</p>
<p>Go grab the zip file from where you created it and drag it over the top right of the file explorer window. When you are over the right spot a blue box that says "Drag here to upload and unzip".</p>
<p><img src="/link/dda6ee10367b4cf6bfec52b9c9983010.aspx" /></p>
<p>Drop the file there and the file will be uploaded to the server and Kudu will unzip it for you.</p>
<p>Open up the wwwroot folder and confirm that it contains your new code.</p>
<p>Congratulations! You have successfully now deployed using Kudu!</p>
<p>You can now use <a href="http://paasportal.episerver.net/">http://paasportal.episerver.net</a> to deploy to higher environments.</p></p>