Skip to main content

Posts

How to resolve "The access level is set to private because anonymous access is disabled on this storage account." while creating a new Azure Blob Storage container

If you want to create a new Azure Blob Storage container and see the following "Anonymous access level" restriction, below are the steps that you can follow to resolve this restriction. Problem I can not add a container due to the following access level restriction.  Solution This restriction is due to the "Allow Blob anonymous access" setting being set to Disabled. After selecting the Enabled option and saving the changes, I can add my new container with the access level setting that I want.
Recent posts

Solutions Architect Notes: Key Responsibilities

A Software Solutions Architect is responsible for designing and overseeing the implementation of software solutions that align with business needs and technical requirements .  Solution Architects often take on various roles depending on the projects they're involved in. However, for many of these projects, there are some key responsibilities that remain consistent. Key Responsibilities Solution Design and Architecture Define the overall structure and components of software solutions. Choose appropriate technologies, frameworks, and platforms. Ensure scalability, security, and performance in system design. Requirement Analysis Work with stakeholders to understand business needs. Translate requirements into technical specifications. Identify potential risks and constraints. Technology Selection and Integration Evaluate and recommend suitable technologies and tools.  Ensure seamless integration with existing systems and third-party services. Optimise software for future scalabi...

How to find all ModelState errors of a submitted form in ASP.NET Core MVC and Razor Pages

The ModelState class in ASP.NET encapsulates the state of model binding to a property of an action-method argument or to the argument itself, and ModelState.IsValid check is commonly used by the .NET Developers to check whether a web user has submitted a form with all of the necessary details and if they haven't, then the "check" can be used to return some validation errors.  public async Task < IActionResult > OnPostAsync () {     if ( ! ModelState . IsValid )     {         return Page ();     }     _context . Movies . Add ( Movie );     await _context . SaveChangesAsync ();     return RedirectToPage ( "./Index" ); } When you have a big form, which you shouldn't have as it is not a great experience for the end users, and if you need to check the model state errors, below is a way to do exactly that.  ModelState . Values . SelectMany ( x => x . Errors . Select ( x => x . ErrorMes...

Umbraco Tip: How to enable Umbraco redirect tracking for a specific document type

Recently, I was working on an Umbraco case with my colleague, Harry Buxton, and the issue was that even though we were updating the names of certain content pages, the links to those pages were not updated correctly. As a result, we couldn't access those pages on the front end. Furthermore, they were not visible in the "Redirect URL Management" dashboard either.  Problem Umbraco CMS has a built-in URL Redirect Management feature for routing and URL tracking. Whenever a document is published, and this causes changes to its URL (and any of its decendants' URLs), Umbraco makes a note of the old URLs and whenever an incoming request is served and the default content finders cannot find a matching published document, Umbraco checked whether the URL matches on of these saved URLs. If a match is found, Umbraco returns a "301 Redirect" response pointing to the new URL of the document.  The issue was that this was not happening with our content pages; after updating...

Umbraco Tip: How to securely fix "SurfaceController POST not allowed outside Umbraco due to missing antiforgery token"

Today, I was working on a v8 to v13 upgrade project, and I realised that I couldn't access my [HttpPost] actions in a SurfaceController from an Ajax POST call. After trying some solutions without any luck, including Route attributes to the SurfaceController and actions, I found out that starting from Umbraco v9, the SurfaceControllers have the anti-forgery check by default as SurfaceControllers are primarily made for POSTing forms within Umbraco.  To resolve this issue, I added the following  beforeSend bit to my Ajax call and also added the [ValidateAntiForgeryToken] attribute to my actions in my SurfaceController. During tests, I also realised that I could ignore the anti-forgery token completely by adding the [IgnoreAntiforgeryToken] attribute to my actions, but this is not an option that anybody should go for as this option skips the anti-forgery token validation and makes your website more vulnerable for things like Cross-site request forgery attacks.   $ . ajax...

How to fix "System.InvalidOperationException: Sequence contains no matching element" error after upgrading your v7/v8 project to v13+

 As part of my job, I get involved in quite a few Umbraco upgrade projects, and recently, after upgrading an Umbraco v8 project to the latest LTS version of Umbraco (v13), I saw a new error which blocked a piece of content from being rendered correctly.  Problem The problem was happening with one Special CTA content block and all other blocks were looking good.  System.InvalidOperationException: Sequence contains no matching element    at System.Linq.ThrowHelper.ThrowNoMatchException()    at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)    at Our.Umbraco.DocTypeGridEditor.Helpers.DocTypeGridEditorHelper.ConvertValue(String id, String contentTypeAlias, String dataJson)    at Our.Umbraco.DocTypeGridEditor.Helpers.DocTypeGridEditorHelper.RenderDocTypeGridEditorItem(IViewComponentHelper helper, IHtmlHelper htmlHelper, Object model)    at AspNetCore.App_Plugins_DocTypeGridEdito r_Render_DocTypeGr...

How to build a Scalable, Secure, and Performant Umbraco Website on Azure

Umbraco is a highly flexible, open-source content management system (CMS) that allows developers to easily build powerful websites. Hosting Umbraco websites on Microsoft Azure provides numerous benefits, such as scalability, security, and seamless integration with other Azure services.  In this guide, we’ll explore one of the recommended architectures for hosting an Umbraco website on Azure, including key services, configurations, and best practices to ensure performance, reliability, and ease of management. Architecture Diagram and Breakdown of Primary Azure Components Microsoft Azure is a robust cloud platform with a broad set of services that align well with the needs of a modern web application. Azure can offer hosting, storage, monitoring, security, and automatic scaling for an Umbraco website, among other features. With the right architecture, Azure enables Umbraco websites to serve traffic seamlessly, adapt to changing loads, and provide a secure environment for content ma...