Quantcast
Channel: dotnetthoughts
Viewing all 610 articles
Browse latest View live

Introduction to Microsoft DevSkim

$
0
0

This post is about Microsoft DevSkim. DevSkim is a framework of IDE extensions and Language analyzers that provide inline security analysis in the dev environment as the developer writes code. It is designed to work with multiple IDEs (VS, VS Code, Sublime Text, etc.), and has a flexible rule model that supports multiple programming languages.


Adding Chrome push notifications to web applications

$
0
0

This post is about how to create and consume Chrome push notifications in Web Applications. Push notifications helps application developers to build more engaging apps for the users.

Building mailinator clone using SendGrid and ASP.NET Core

$
0
0

This post is about how to create a mailinator clone using SendGrid Inbound parse webhooks and ASP.NET Core. Mailinator is a service which offers dynamic email inbox for testing purposes. In this post I am creating a similar service using SendGrid Inbound parse webhooks - which helps to listen for incoming emails. To start you need a SendGrid account. Once you create a SendGrid account, you need to authenticate a domain. For this post I have created an SendGrid account from Azure portal. You can create Authenticated domains from this Page. Next open your Inbound parse settings, you can get it from Settings > Inbound Parse or Inbound Parse Settings. Next you need to add your receiving domain and Webhook URL.

Building a Zoom Bot with ASP.NET Core

$
0
0

This post is about how to create a Zoom bot with ASP.NET Core. Zoom is a collaboration solution by Zoom Communications Inc. In the Zoom developer documentation, they are implemented a Chat bot using Nodejs. In this post I am explaining how to implement a simple chatbot using ASP.NET Core.

Building COVID 19 FAQ ChatBot using Azure Cognitive Services and Azure Bot Framework

$
0
0

The whole world is fighting against the Novel Corona Virus or COVID 19. One of the major challenges the world faces is fake news. The WHO Director-General Tedros Adhanom Ghebreyesus had said in February itself, “We are not just fighting an epidemic; we are fighting an infodemic.”. Many organizations like WHO, CDC etc publish information and answers to frequently asked questions that can be accessed through their websites. But most of the times it is hard to find answers to specific questions.

Implementing a Twitter Bot using Azure Cognitive Services and Azure Functions

$
0
0

We can improve our personal branding is creating content and by posting to social media consistently. In this article, I am creating an Azure Serverless function, which helps to fetch news articles using Azure Cognitive Services — Bing News API and post content to Twitter. I am also using Azure Text Analytics service, which will extract key phrases from the news title — which helps to tag the tweets.

How to map custom domain and SSL to Azure app service programmatically

$
0
0

If you’re building SAAS applications, it is a good practise to provide sub domains to tenants. If you’re using Azure VMs it is simple and straight forward. You can configure the A NAME in DNS records and create a wild card CNAME record to the domain name of your Azure VM, so that all the subdomain requests comes to your VM - IIS. And application can decide which tenant based on the HOST header.

ASP.NET Core Social authentication without Identity

$
0
0

This blog post is about how to configure and use ASP.NET Core Social Authentication without ASP.NET Core identity. In this post I am using Google Authentication provider, you can use Facebook or Twitter. Only the authentication provider and associated configuration only will change.


Implementing Health Checks in ASP.NET Core

$
0
0

This blog post is about how to configure health check in ASP.NET Core. Health monitoring an important aspect in case of Micro services. It will help orchestrators to monitor and manage containers.

Deploying Blazor apps to Azure Static Web apps

$
0
0

This blog post is about how to create and deploy Blazor application to Azure Static Web Apps. Azure Static Web Apps is a service that automatically builds and deploys full stack web apps to Azure from a GitHub repository.

Docker compose an ASP NET Core application with SQL Server

$
0
0

This blog post is about containerizing an ASP.NET Core Application with SQL Server. In this blog post I will explain how to run the migrations as part of the deployment process.

RESTful API versioning with ASP.NET Core

$
0
0

This blog post will discuss about the commonly used API Versioning strategies and how to implement them in ASP.NET Core Web API.

Initialize MS SQL Server in Docker container - creating database at startup

$
0
0

Few days back I wrote a blog post about initializing SQL Server while running a docker-compose command. In that implementation I was using another docker image to run the migrations. In this post I am creating a dockerfile, some shell scripts and the SQL Script file which will create the database while running the docker-compose up command.

Create a multi-container app using a Docker Compose to Azure App service

$
0
0

This post is about deploying a multi-container app to azure app service using Docker compose. To get started let us create an App Service with Docker first. In the portal, click on Create New, search for Web App and select the Web App option.

Add natural language understanding to your bot - Part 1

$
0
0

This blog post is about adding natural language understanding to your bot. Language Understanding (LUIS) is a cloud-based API service that helps you to recognize the intent of user input and better direct the conversation flow.


Add natural language understanding to your bot - Part 2

$
0
0

This blog post is about adding natural language understanding to your bot. Language Understanding (LUIS) is a cloud-based API service that helps you to recognize the intent of user input and better direct the conversation flow. In the previous post I configured LUIS and in this post I will explain how we can use the LUIS service in a Bot Application.

How to add a Startup class to Azure Functions

$
0
0

This blog post is about adding a Startup class to Azure Functions. So why we need a startup class for Azure function? For example if you’re building an Azure Function which talks to SQL Server Database or calling an external API, instead of creating the instance of Database Connection or HTTP Client directly in the code it is always recommended to us Dependency Injection, and inject the external dependencies to the functions. As Azure Functions running on top .NET Core, we can use the .NET Core dependency injection techniques.

409 Conflict: Could not write to local resource web.config due to error Access to the path is denied.

$
0
0

This post is about how to fix the issue with 409 Conflict: Could not write to local resource ‘D:\home\site\wwwroot\web.config’ due to error ‘Access to the path is denied.’ when working with Azure App Service.

What is new in ASP.NET Core 5.0 Web API

$
0
0

This post is about Web API application in ASP.NET Core 5.0 - What are the new features, how to create web api using dotnet CLI and Visual Studio. Finally deploying ASP.NET Core 5.0 Web API to Azure App service

How to create a QR Code generator with Azure Functions

$
0
0

This post is about creating a QR Code generator using Azure Functions. A QR code (abbreviated from Quick Response code) is a type of matrix barcode (or two-dimensional barcode) first designed in 1994 for the automotive industry in Japan. QR codes often contain data for a locator, identifier, or tracker that points to a website or application. I will be using a library - QRCoder to generate the QR Code for a URL. So first I have created a function with Http Trigger.

Next I add the QRCode nuget package to the dotnet core project using dotnet add package QRCoder --version 1.4.1

And on the Run() method, I am adding the following code.

[FunctionName("QRGenerator")]publicstaticasyncTask<IActionResult>Run([HttpTrigger(AuthorizationLevel.Anonymous,"get","post",Route=null)]HttpRequestreq,ILoggerlog){log.LogInformation("C# HTTP trigger function processed a request.");stringurl=req.Query["url"];stringrequestBody=awaitnewStreamReader(req.Body).ReadToEndAsync();dynamicdata=JsonConvert.DeserializeObject(requestBody);url=url??data?.url;if(string.IsNullOrEmpty(url)){returnnewBadRequestResult();}varisAbsoluteUrl=Uri.TryCreate(url,UriKind.Absolute,outUriresultUrl);if(!isAbsoluteUrl){returnnewBadRequestResult();}vargenerator=newUrl(resultUrl.AbsoluteUri);varpayload=generator.ToString();using(varqrGenerator=newQRCodeGenerator()){varqrCodeData=qrGenerator.CreateQrCode(payload,QRCodeGenerator.ECCLevel.Q);varqrCode=newPngByteQRCode(qrCodeData);varqrCodeAsPng=qrCode.GetGraphic(20);returnnewFileContentResult(qrCodeAsPng,"image/png");}}

Now you can run the function using func start. It will start the function and expose the endpoint.

QR Code generator Function running

Open the URL in the browser with a URL parameter like this - http://localhost:7071/api/QRGenerator?url=https://dotnetthoughts.net, now it will execute the code and it will generate the QR code and display it in the browser.

Here is the QR Code of https://dotnetthoughts.net.

QR Code generator Output

Now we have implemented the whole QR Code generation in 4 lines. You can implement it as a micro service and consume it.

Happy Programming :)

Viewing all 610 articles
Browse latest View live