Saturday, October 21, 2023

Azure Active Directory

 All employees in an organization need access to some Azure services to perform their tasks. They can access services like SQL database, machine learning, or Azure container services when the administrator assigns them separate user id and password for each service. Employees, as well as administrators, often find it hard to manage multiple user logins at the same time. It creates more of a hassle for administrators working in an organization that involves more than 1000 employees. 

This is where Azure Active Directory (AD) comes into the picture. With Azure AD, the administrators can handle multiple user logins without any issue. Administrators need to assign a single username and password to access all the services they want. 

What is the Azure Active Directory?

Azure Active Directory is Microsoft’s multi-tenant, cloud-based directory and identity management service. For an organization, Azure AD helps employees sign up to multiple services and access them anywhere over the cloud with a single set of login credentials.

Windows AD vs. Azure AD

Windows Active Directory (AD) was the previous version of Azure AD. Active Directory (AD) is an OS directory service that facilitates working with interconnected, complex, and different network resources in a unified manner. 

Continue Reading →

Azure Key Vault

 Azure Key Vault is a cloud service for securely storing and accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, or cryptographic keys. Key Vault service supports two types of containers: vaults and managed hardware security module(HSM) pools. Vaults support storing software and HSM-backed keys, secrets, and certificates. Managed HSM pools only support HSM-backed keys.

Read more: https://learn.microsoft.comhttps://learn.microsoft.comhttps://learn.microsoft.com

Continue Reading →

Application Insights

Application Insights sends telemetry from your web application to the Azure portal so that you can analyze the performance and usage of your application.  

It provides benefits as:

  1. Exceptions and performance diagnostics.
  2. Interactive data analysis.
  3. Azure diagnostics.
  4. Proactive detection.

References: https://azuredevopslabs.com/




Continue Reading →

Azure WebJobs

 WebJobs is a feature of Azure App Service that enables you to run a program or script in the same instance as a web app, API app, or mobile app. There's no extra cost to use WebJobs.

Azure WebJobs enable you to run programs or scripts in your website as background processes. It runs and scales as part of Azure Web Sites.  WebJobs aren't supported for App Service on Linux yet. 

What Scheduling Options are supported by Azure WebJobs?

Azure WebJobs can run continuously, on demand or on a schedule.

Supported file types for scripts or programs

The following file types are supported:

  • .cmd, .bat, .exe (using Windows cmd)
  • .ps1 (using PowerShell)
  • .sh (using Bash)
  • .php (using PHP)
  • .py (using Python)
  • .js (using Node.js)
  • .jar (using Java)

Read More : https://learn.microsoft.comhttps://www.c-sharpcorner.com


Continue Reading →

Azure API Management (APIM)

 Azure API Management is a fully managed service that helps developers to securely expose their APIs to external and internal customers. It provides a set of tools and services for creating, publishing, and managing APIs, as well as for enforcing security, scaling, and monitoring API usage.

API management includes a range of features and tools, such as an API gateway, a web-based developer portal, API lifecycle management, monitoring and analytics tools, and security features. 

Azure API Management can be used with a variety of back-end services, such as Azure Functions, Azure Logic Apps, and Azure Virtual Machines, as well as with on-premises and third-party systems. It can help developers to build and manage APIs in a way that is secure, scalable, and easy to use.

Azure API Management architecture and components

Azure API Management consists of an API gateway, a developer portal, and a management plane. These components are fully managed and hosted by Azure. API Management is available in several tiers with differing features and capacity.

APIM system consists of following components,

The API gateway is the endpoint that:
  1. Accepts API calls and routes them to your backends.
  2. Verifies API keys, JWT tokens, certificates, and other credentials.
  3. Enforces usage quotas and rate limits.
  4. Transforms your API on the fly without code modifications.
  5. Caches backend responses were set up.
  6. Logs call metadata for analytics purposes.
The Azure portal is the administrative interface where you set up your API program. Use it to:
  1. Define or import API schema.
  2. Package APIs into products.
  3. Set up policies like quotas or transformations on the APIs.
  4. Get insights from analytics.
  5. Manage users.
The Developer portal serves as the main web presence for developers, where they can:
  1. Read API documentation.
  2. Try out an API via the interactive console.
  3. Create an account and subscribe to get API keys.
  4. Access analytics on their own usage.

How Azure API Management works

Azure API Management works by providing a layer between API clients and the back-end API services that they access. When a client makes a request to an API managed by API Management, the request is first sent to the API Management gateway. The gateway is responsible for enforcing security policies, rate limiting, and other policies on the API.

If the request is allowed by the gateway, it is then forwarded to the back-end API service. The back-end API service processes the request and sends a response back to the API Management gateway, which in turn sends the response back to the client.

API consumers

For API consumers, Azure API Management provides a convenient way to access and use APIs that are managed by the service. When an API consumer wants to use an API managed by API Management, they typically follow these steps:

Find the API: The consumer can discover the API by browsing the developer portal, which is a web-based portal provided by API Management that lists all the available APIs. The consumer can also use the API Management REST API to programmatically discover APIs.

Get API credentials: To use an API, the consumer typically needs to provide some form of credentials, such as an API key or an OAuth token. The consumer can obtain these credentials by signing up for an API Management account and creating an application in the developer portal.

Send a request: The consumer can then send a request to the API by making an HTTP request to the API Management gateway, using the API endpoint and the API credentials. The request is forwarded to the back-end API service, which processes the request and sends a response back to the API Management gateway.

Get a response: The API Management gateway then sends the response back to the consumer. If the request was successful, the response will include the requested data or functionality. If there was an error, the response will include an error code and message.

API providers

For API providers, Azure API Management provides a set of tools and services for building, publishing, and managing APIs. When an API provider wants to use API Management to manage their APIs, they typically follow these steps:

Create an API Management service instance: The API provider needs to create an API Management service instance in the Azure portal. This creates a dedicated API Management environment that the provider can use to manage their APIs.

Define the API: The provider needs to specify the API endpoint, the operations that the API supports, and the request and response formats. The provider can use the API Management portal or the API Management REST API to define the API.

Configure security: The provider configures security for the API by specifying the authentication and authorization methods that the API will use. API Management supports a variety of authentication and authorization methods, including API keys, OAuth, and certificates.

Set up policies: The provider can use policies to specify rules and behaviors for the API. For example, the provider can use policies to set rate limits, transform requests and responses, or cache responses.

Publish the API: The provider can make the API available in the developer portal, which allows developers to discover, learn about, and interact with APIs.

Reference: https://www.solo.io/https://www.c-sharpcorner.com


Continue Reading →

Azure Data Factory

Azure Data Factory enables you to move and transform data from various sources to various destinations. It's a managed cloud service designed specifically for handling complex hybrid extract-transform-load (ETL), extract-load-transform (ELT), and data integration projects. This article describes how you can use Azure Data Factory to create, schedule, and manage data pipelines.

Read more:  https://learn.microsoft.com

Continue Reading →

Azure Service Bus With C#

 Azure Service Bus is a fully managed messaging service from Microsoft that allows applications to send messages to each other and receive messages reliably, without having to worry about the underlying infrastructure. This service is often used for scenarios where decoupled communication between applications is required, such as microservices architecture, or for enabling communication between cloud and on-premises systems.

This article will explore Azure Service Bus, what it does, and how it can be used in a C# application.

One of the key features of Azure Service Bus is its ability to support multiple messaging patterns, such as point-to-point messaging, publish/subscribe messaging, and request/reply messaging. This makes it an ideal solution for many use cases, such as enabling communication between microservices, sending and receiving messages between cloud and on-premises systems, and handling background jobs or workflows.

Difference Between an Azure Service Bus and a Queue?

Azure Service Bus provides two primary messaging patterns: queues and topics/subscriptions. Both queues and topics/subscriptions enable the decoupling of the sender and receiver, but they differ in how they handle message delivery.

A queue is a unidirectional channel that holds messages until the recipient retrieves them. When a message is sent to a queue, it is stored in the queue until a consumer actively retrieves it. The queue guarantees that messages will be delivered in the order they were received, and each message will be delivered to a single consumer.

On the other hand, a topic is a publish/subscribe channel that allows multiple subscribers to receive messages that are published to a single topic. Subscribers can filter the messages they receive based on message properties, and messages can be delivered to multiple subscribers at once. Messages sent to a topic are held in a subscription until they are actively consumed, but they are not deleted when a subscriber receives them.

The main difference between an Azure Service Bus queue and a topic is that a queue provides a one-to-one message delivery model, while a topic provides a one-to-many message delivery model. Additionally, topics support message filtering and subscription, while queues do not.

Getting Started with Azure Service Bus in C#

To start using Azure Service Bus in a C# application, you'll need to create a Service Bus namespace and set up an Azure Service Bus Queue or a topic/subscription. A namespace is a container that holds all the messaging entities, such as queues and topics, for a given solution.

Once you have created a namespace, you can use Microsoft.Azure.ServiceBus NuGet package to interact with the Service Bus from your C# application. This package provides a simple and convenient API for sending and receiving messages, as well as managing messaging entities.

Just like connecting to a database, you will need an Azure Service Bus connection string. You can see an example in the code below.

Send and receive a message

Message sending is performed using the ServiceBusSender. Receiving is performed using the ServiceBusReceiver.

string connectionString = "<connection_string>";
string queueName = "<queue_name>";
// since ServiceBusClient implements IAsyncDisposable we create it with "await using"
await using var client = new ServiceBusClient(connectionString);

// create the sender
ServiceBusSender sender = client.CreateSender(queueName);

// create a message that we can send. UTF-8 encoding is used when providing a string.
ServiceBusMessage message = new ServiceBusMessage("Hello world!");

// send the message
await sender.SendMessageAsync(message);

// create a receiver that we can use to receive the message
ServiceBusReceiver receiver = client.CreateReceiver(queueName);

// the received message is a different type as it contains some service set properties
ServiceBusReceivedMessage receivedMessage = await receiver.ReceiveMessageAsync();

// get the message body as a string
string body = receivedMessage.Body.ToString();
Console.WriteLine(body);


Reference: https://learn.microsoft.comhttps://www.c-sharpcorner.com/

Continue Reading →