Quantcast
Channel: briancaos – Brian Pedersen's Sitecore and .NET Blog
Browsing all 277 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Azure ApplicationInsights track custom metrics using the TelemetryClient

The Microsoft.ApplicationInsights nuget package is your code gateway to the Microsoft Application Insights portal, and also to the Azure Monitor universe. You use these tools as a shared place for your...

View Article


Serilog – Add thread ID to the log file

Serilog is more or less the default file logger when developing .NET Core applications. The simple logger can easily be modified to – for example – add the thread ID. FIRST THINGS FIRST: THE SERILOG...

View Article


Image may be NSFW.
Clik here to view.

Sitecore delete old item versions

Are your Sitecore editors version-trigger-happy? Is your master database items drowning in old versions that will never be used – or is just exact replicas of the previous version? Many versions of the...

View Article

Image may be NSFW.
Clik here to view.

Sitecore disable automatic lock on create items

From Sitecore 9, Sitecore changed the default behavior when creating items in the content editor. As per default, any item is locked when created, and will only be unlocked if the user unlocks it, or...

View Article

Image may be NSFW.
Clik here to view.

Your session ID is being reused and there is nothing you can do about it

In many years we have been used to the fact that the ASP.Net session ID uniquely identifies one session, and one session only. Back in 2006, Margaret Rouse from TechTarget even wrote in the definition...

View Article


Sitecore Pipelines – The great walkthrough

I have previously stated my enthusiasm for the Sitecore Pipeline concept. This article describes how to create your own, how to add parameters, and which properties to use. WHAT IS A SITECORE PIPELINE?...

View Article

Read blob file from Microsoft Azure Storage with .NET Core

In order to read a blob file from a Microsoft Azure Blob Storage, you need to know the following: The storage account connection string. This is the long string that looks like this:...

View Article

Image may be NSFW.
Clik here to view.

Read from Azure Queue with Azure WebJobs 3.0 and .NET Core

From WebJobs 2.0 to WebJobs 3.0 Microsoft have completely rewritten the way Azure WebJobs is used. The reasons are probably noble, but they require you to redo your work when upgrading. So I made this...

View Article


Deserialize XML array to string[] and how to allow JSON to be deserialized...

How do you deserialize the classic XML array to an string[] type? The XML representation of an array is a list of elements: <?xml version="1.0" encoding="UTF-8"?> <root> <MyXml>...

View Article


Sitecore get Context from fully qualified URL

One of the basic Sitecore concepts is the concept of a context. The context is resolved from the HTTP Context to Sitecore and determines the database, language, user domain, content start item etc. The...

View Article

Create Sitecore items using PowerShell

You can use the Sitecore PowerShell Extensions for many trivial tasks. This script creates a “components” folder below all items from a root item: // Get the root item $root = Get-ChildItem -Path...

View Article

Image may be NSFW.
Clik here to view.

Sitecore start scheduled task manually

Sitecore scheduled tasks are background tasks running on a schedule. But never when you need it, especially when developing the tasks. You can trigger these tasks manually if you please. THE EASY WAY:...

View Article

Image may be NSFW.
Clik here to view.

Sitecore Item Clones is only a thing in the master database

The Sitecore item cloning is a technique in which you can create a copy of an item that inherits the field values of the original items. In the latest versions of Sitecore (at least from 9.0 and...

View Article


Image may be NSFW.
Clik here to view.

Azure Functions CRON expressions

When creating Microsoft Azure Functions, you can have a timer that triggers your function. The time for when the function should run is specified in a CRON expression: Microsoft Azure CRON Expression...

View Article

Image may be NSFW.
Clik here to view.

Calling Azure Functions from JavaScript – The CORS configuration

You cannot call Azure Functions from JavaScript unless you configure the CORS settings for your Function Apps: Azure Functions CORS Settings This is because Microsoft have by default enabled CORS and...

View Article


Change date format using .NET Regular Expressions

You can use Regex.Replace to change the format of a date string. For example if your input string is YYYY/MM/DD but you need to change it to YYYY-MM-DD, you can use this small method: public static...

View Article

Image may be NSFW.
Clik here to view.

200 OK vs 202 Accepted – Whats the difference?

When working with Azure cloud services like Azure Logic Apps or Azure Automation (Runbooks), you often come across that service endpoints return 202 Accepted instead of 200 OK on success. But why do...

View Article


Sitecore remove “Job started” and “Job ended” from log files

In large Sitecore installations with many background tasks you will find the following log lines over and over again: ManagedPoolThread #1 10:26:05 INFO Job started: xxxxx ManagedPoolThread #5 10:26:05...

View Article

Sitecore logging – Create new log file every day

Sitecore have since forever used Log4Net as it’s logging platform. Log4Net is nicely extensible and can be configured to log in many ways. As per default, Sitecore is configured to start writing to a...

View Article

Image may be NSFW.
Clik here to view.

Sitecore use Application Insights Metrics and Telemetry

Although Sitecore have an integration for Application Insights (which is part of Azure Monitor), you can implement the TelemetryClient yourself. This is useful if you wish to log Metrics or Trace your...

View Article
Browsing all 277 articles
Browse latest View live


Latest Images