To deploy a website, an Azure function or a WebJob in Azure, via Azure DevOps, the easiest and most efficient way is to use the Azure Web App Deployment task.
If your Azure DevOps account is the same as the one used in the Azure portal, you will probably have no trouble to select your Azure Subscription from the list of subscriptions displayed on this screen.
However, if you need to deploy to an Azure environment that you don’t own (the customer’s, for example), it becomes much more complicated because you must first register this account in your list of Azure Subscriptions. But once this Subscription is defined, the rest is a piece of cake.
To authenticate a user, Blazor Server uses the same components as ASP.NET Core.
The principle is to inject the service
and call the
HttpContext.SignInAsync method, specifying the appropriate
But the main problem is that Blazor Server uses SignalR to communicate between the web browser and the server. This prevents the correct transfer of cookies. It is therefore necessary to define WebAPIs and to call them using Http.
To help you understand the development of these different steps, I have recorded a video that shows the creation of a Blazor Server project and the integration of all the steps to secure a page or components.
The complete source code is available here.
To capture all routes that do not correspond to any existing page, there are two techniques:
This classic method consists in modifying the NotFound tag of the App.razor page. This works very well, as long as you don’t need the content of the erroneous route.
Since many years now, I have been hosting the french podcast DevApps.ms, which talks about news, development and architecture of .NET technologies. On this occasion, I learned about the hardware and software that allow to produce quality podcasts. Scott Hanselman’s site helped me a lot.
For a few months now, the global pandemic has often forced us to homework. For a few days, talking with colleagues using the laptop’s microphone and camera can probably be enough. But after a few months, you probably want to have better image and sound quality.
These are two of these reasons why I want to share my experiences in choosing audio and video equipment. This equipment is certainly not of professional quality, but it has a lot of assets to improve our daily telework.
In this article, we will create a Microsoft Teams Bot developed in C#, using the Microsoft SDK. Then we will host it in Azure and publish it in your company’s Teams. This way you can easily adapt the C# code to improve the discussion with your Bot.
The steps are :
- Developing a Bot in C#
- Test the Bot locally
- Publish the Bot in Azure
- Create a Bot Channels Registration
- Setting up the Teams channel
- Create a deployment package for Teams
- Install the package in Teams
Recently, Microsoft released a page that explains how to customize Windows Terminal to colour and display GIT status.
In all projects you develop in .NETCore, it is essential to add a test project :-) And then it becomes very simple to complete this project with a code coverage calculation procedure. Developers will be asked to create test procedures that go through all the branches of your source code. A code coverage rate of at least 80% is very often recommended.
This Saturday, I had the chance to participate in the first edition of TechDay Conf, it’s a virtual conference. It includes technical sessions of a few minutes. This conference is dedicated exclusively to application development, cloud transformation and new web framework like Blazor.
My two sessions today are about:
- Avoid Entity Framework. Do Object Relational Mapping: french speaking session.
- Visual Studio 2019 - Code like a ninja: french speaking session.
In a previous article, I showed you how to create a free SSL certificate via Lets’Encrypt.
The main (or only) problem with Let’s Encrypt is that the certificate has a lifetime of maximum 3 months. This means that you have to renew and install it manually or automatically very regularly.
To avoid this it is necessary to purchase a SSL certificate with an expiration date of up to several years.
Several steps are required to create and install an SSL Certificate in Azure.
Today, a developer came to me asking how to test his code that contains a reference to
Indeed, sometimes your application treats its data differently, depending on today’s date.
For example, how do you check the following code, which depends on the current trimester?
int trimester = (DateTime.Today.Month - 1) / 3 + 1; if (trimester <= 2) ... else ...