Friday, June 9, 2023

GraphQL in.NET

 GraphQL is a query language for APIs that enables clients to request and retrieve only the data they need, allowing for more efficient and flexible data fetching. In the .NET ecosystem, there are several libraries and frameworks available to implement GraphQL servers and clients. Here are some popular options for working with GraphQL in .NET:

  1. Hot Chocolate: Hot Chocolate is a GraphQL server implementation for .NET. It provides a high-performance, customizable, and feature-rich GraphQL server. It supports schema-first and code-first approaches for defining your GraphQL schema and provides extensive tooling and middleware support.

  2. GraphQL.NET: GraphQL.NET is a popular GraphQL library for .NET. It allows you to build GraphQL servers using a code-first approach, where you define your GraphQL schema using C# classes and attributes. It supports a wide range of features, including schema stitching, batching, and subscription support.

  3. StrawberryShake: StrawberryShake is a GraphQL client library for .NET. It provides a strongly-typed API for executing GraphQL queries against a server. It generates C# classes for your GraphQL schema, allowing for type safety and compile-time validation of queries and responses.

  4. GraphQL.Client: GraphQL.Client is a lightweight GraphQL client library for .NET. It allows you to send GraphQL queries and mutations to a GraphQL server and retrieve the responses. It provides a simple and easy-to-use API for executing GraphQL requests.

  5. Entity Framework Core with GraphQL: If you are using Entity Framework Core as your data access layer in .NET, you can combine it with GraphQL to expose your database entities as GraphQL types. Libraries like Hot Chocolate and GraphQL.NET provide integration with Entity Framework Core, allowing you to build GraphQL APIs directly from your database models.

These are just a few examples of the GraphQL libraries and frameworks available for .NET. Each library has its own features, benefits, and documentation, so you can choose the one that best fits your requirements and preferences. The GraphQL community in the .NET ecosystem is active, and you can find extensive resources, tutorials, and sample projects to help you get started with GraphQL in .NET.

AKS (Azure Kubernetes Service)

 AKS (Azure Kubernetes Service) is a managed container orchestration service provided by Microsoft Azure. It simplifies the deployment, management, and scaling of containerized applications using Kubernetes. AKS abstracts away the underlying infrastructure complexities, allowing developers to focus on deploying and managing their applications.

The architecture of AKS involves several key components working together:

  1. Master Node: The master node is responsible for managing the Kubernetes control plane components, such as the API server, scheduler, and controller manager. These components handle tasks like accepting and processing API requests, scheduling containers, and monitoring cluster health.

  2. Worker Nodes: Worker nodes are the machines where containers are deployed and run. They form the compute resources of the AKS cluster. Each worker node runs the Kubernetes agent (kubelet), which interacts with the control plane and manages containers on the node.

  3. Pods: Pods are the smallest deployable units in Kubernetes. A pod is a logical group of one or more containers that share the same network and storage resources. Pods are scheduled and managed by the Kubernetes scheduler and can be horizontally scaled.

  4. Kubernetes API Server: The API server exposes the Kubernetes API, which allows users to interact with the cluster. It receives and processes API requests, such as creating or scaling deployments, services, and pods.

  5. etcd: etcd is a distributed key-value store that stores the cluster's configuration data, including information about the cluster's state, such as pod definitions, service configurations, and more. It ensures consistency and fault tolerance in the cluster.

  6. Networking: AKS uses a software-defined networking (SDN) solution to enable communication between pods and services within the cluster. It assigns each pod a unique IP address and manages network routing and load balancing.

  7. Load Balancer: AKS automatically provisions an Azure Load Balancer to distribute incoming traffic across the pods in a service. The load balancer helps ensure high availability and scalability of applications.

  8. Storage: AKS provides integration with Azure storage solutions, such as Azure Disk or Azure Files, to enable persistent storage for applications running in the cluster. This allows data to be preserved even if containers are restarted or rescheduled.

  9. Container Registry: AKS integrates with Azure Container Registry (ACR) to store and manage container images. ACR provides a secure and private repository to store and distribute container images used by the AKS cluster.

Overall, AKS architecture combines the power of Kubernetes with the simplicity of a managed service, enabling developers to focus on their applications' logic while benefiting from the scalability, reliability, and flexibility of container orchestration.

Monday, March 9, 2020

What is Blazor

What is Blazor

Blazor is a new framework in ASP.NET Core that allows to create interactive web applications using c# and HTML. 

Blazor comes with two different editions: Blazor Server and Blazor WebAssembly



Image Source :  .NET conference 2019 presentation


Blazor Web Assembly : This allows application to run under client browser using web assemblies. Blazor tries to resolve the browser runtime like Javascript, active x , flash , silverlight , Dart etc. Web Assembly is announced around June 2015. It supports most of web browsers and 

Blazor Server:  This comes with .NET core 3.0, this allows web application using Razor component to be hosted in ASP.Net core servers . This uses web socket to set up connection with client side using Signal R.


Features of Blazor
  • In Blazor interactive UI can be build using C# instead of JavaScript.
  • Blazor supports mobile browsers as well as all the latest browsers.
  • Client side scripting languages add complexity and cost but when you write code in Blazor this share .NET code with both the client and server.
  • Blazor helps you to write res-usable web UI components with C# and Razor Blazor is client side web UI framework.
  • With Blazor you can call into JavaScript libraries & browser APIs as needed. To achieve this you can use JavaScript interop  which help to use client side JavaScript libraries.
  • Blazor take care real time changes in client side and do rendering execution on server and rendering on client side.
  • Blazor uses thin client which executes on very low powered devices and older browsers.
  • App size doesn't grows as all the code resides on server

Partner tools and controls for Blazor

1. DevExpress

2. Ingragistics

3. Progress Telrik

4. radzen

5. Syncfusion



Thursday, September 26, 2019

Cloud - KSA

Kubernetes Service Architecture

Kubernetes uses Services to logically group a set of pods together and expose your application for external network connectivity. There are three types of services, or ServiceTypes.

  • ClusterIP
  • NodePort
  • LoadBalancer

LoadBalancer

A LoadBalancer service is the standard way to expose a service to the internet. On GKE, this will spin up a Network Load Balancer that will give you a single IP address that will forward all traffic to your service

NodePort 


This creates a Port mapping on the underlying node that allow application to accessed directly with node address IP and port.


Cluster IP


This creates a internal IP address for use within the AKS cluster. This helps to manage internal workload within cluster.


Ingress

Ingress is actually NOT a type of service. Instead, it sits in front of multiple services and act as a “smart router” or entrypoint into your cluster.

Ingress is probably the most powerful way to expose your services, but can also be the most complicated. There are many types of Ingress controllers, from the 

  • Google Cloud Load Balancer, 
  • Nginx, 
  • Contour, 
  • Istio, and more.

UI development technologies for web applications


Technologies: ASP.NET MVC with HTML5 support

ASP.NET MVC with HTML5 support
·         Use for flexible modern and mobile web apps, cross-browser compatibility, mobile web clients that can run on any modern device, and to take advantage of the ASP.NET MVC mobile features (such as using different pages and rendering based on detection of the current browser user agent).
·         Offers a full HTML rendering control, better unit testing support, and faking capabilities.
·         HTML5: Use libraries like Modernizer for detecting HTML5 features support and workarounds.
·         Use CSS3 for less script and more maintainable code.
·         Use JavaScript and jQuery for client-side programming.
·         MVC allows Search Engine Optimizations (SEO) customizations.
·         Restful URLs are an integral part of MVC.

ASP.NET SPA

Single Page Application (SPA) based on ASP.NET MVC, HTML5/JavaScript, Knockout, and Breeze
·         SPA is not a framework but a design pattern that can be implemented by using ASP.NET MVC and heavy use of JavaScript libraries like Knockout (for supporting the MVVM pattern within JavaScript) and like the Breeze JavaScript library for advanced data management and JavaScript frameworks like Durandal.
·         Use it for highly interactive web applications and smooth UI updates (minimum server page reload and visible round trips) and when including significant client-side interactions using HTML5, CSS3, and JavaScript.
·         Take advantage of the open-source SignalR JavaScript client library for bi-directional communication between the client and server.
·         Consume ASP.NET Web API services from JavaScript.

HTML5 client for LightSwitch projects

LightSwitch HTML5 client
·         Use if your web application or module is mostly data-driven (CRUD [Create, Read, Update, and Delete]).
·         The LightSwitch HTML5 client is the easiest way to create data-centric, cross-browser, and mobile web applications that can run on any modern device, take advantage of automatic HTML rendering, and adapt to different form factors
·         Take advantage of CSS3, JavaScript, and OSS JavaScript libraries like jQuery Mobile and themes.
·         Coupled to the end-to-end LightSwitch runtime server engine which is built on top of ASP.NET.

ASP.NET Web Pages

ASP.NET Web Pages
·         ASP.NET Web Pages and the Razor syntax provide a fast, approachable, and lightweight way to combine server code with HTML to create dynamic web content. 

Tuesday, September 10, 2019

ASP.NET Web API Security



Authentication validates the identity of a user who is accessing the system to see if that end user has valid credentials. A quick view of some of the ways to Authenticate

  • Forms Authentication
  • Basic Authentication
  • Digest Authentication
  • Windows Authentication
  • Preshared Key or API Key-Based Authentication: Use API keys if you have to build internal application that don't need to access more than single user's data.
  • X.509 Client Certificate-Based Authentication
  • SWT-Based Authentication and Authorization
  • JWT-Based Authentication and Authorization
  • Google Authenticator OTP-Based Authentication
  • OAuth 2.0 Access Token-Based Authentication and Authorization: OAuth has been designed for use with applications on the internet, primarily for delegated authorization of internet resources. OAuth is designed for Internet Scale
  • SMS-Delivered OTP-Based Authentication
  • SAML Token-Based Authentication and Authorization : SAML was designed to be applicable openly, it is typically used in Enterprise SSO scenarios
    • within an enterprise or
    • enterprise to partner or
    • Enterprise to cloud scenarios.

Monday, April 22, 2019

Basics for Python


Python is (programming language) high level, Scripting, dynamic, strongly typed, Object Oriented, Open Source.
Python software, contains over 117,000 packages with a wide range of functionality, including:
·         Graphical user interfaces
·         Web frameworks
·         Multimedia
·         Databases
·         Networking
·         Test frameworks
·         Automation
·         Web scraping
·         Documentation
·         System administration
·         Scientific computing
·         Text processing
·         Image processing

IDE’s used for Python

·         PyCharm
·         Visual Studio + Python Tools
·         Spyder
·         Eclipse + PyDev /Aptana Studio
Editors
  • IDLE
  • SublimeText + PyLint/Anaconda/PythonAutoComplete
  • VIM + PyLint + PEP
  • PythonScriptEditor

Azure Cloud shell commands cheetsheet

  Certainly! Here's a cheat sheet of commonly used Azure Cloud Shell commands: Azure Account az login : Authenticate and log in to your ...