AzureSolutions.Helpers 2.1.4

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package AzureSolutions.Helpers --version 2.1.4                
NuGet\Install-Package AzureSolutions.Helpers -Version 2.1.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AzureSolutions.Helpers" Version="2.1.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AzureSolutions.Helpers --version 2.1.4                
#r "nuget: AzureSolutions.Helpers, 2.1.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AzureSolutions.Helpers as a Cake Addin
#addin nuget:?package=AzureSolutions.Helpers&version=2.1.4

// Install AzureSolutions.Helpers as a Cake Tool
#tool nuget:?package=AzureSolutions.Helpers&version=2.1.4                

Azure Solutions.Helpers

This class library streamlines interactions with Azure services, including AI Search, Event Hub, KeyVault, Open AI and Storage. Related solution documentation can be found at: https://richchapler.github.io/AzureSolutions/

Installation

Install the AzureSolutions.Helpers NuGet package using the following command:

Install-Package AzureSolutions.Helpers 

Features

The AISearch class provides methods to interact with Azure Cognitive Search service. It helps create, manage, and delete data sources, indexes, synonym maps, skillsets, and indexers.

// Initialize AISearch 
AISearch aisearch = new(KeyVault_Name: "YourKeyVaultName"); 
 
// Delete existing resources 
await aisearch.deleteExisting(); 
 
// Create a data source 
await aisearch.createDataSource_SDK(); 
 
// Create an index 
await aisearch.createIndex_SDK(); 
 
// Create a synonym map 
await aisearch.createSynonymMap_SDK(); 
 
// Create a skillset 
await aisearch.createSkillset_SDK(); 
 
// Create an indexer 
await aisearch.createIndexer_SDK();

// Query the search index
string results = await aisearch.Query(prompt: "YourSearchPrompt", type: "YourQueryType"); 

Event Hub

The EventHub class simplifies sending and receiving messages from Azure EventHub. It includes Sender and Receiver nested classes for sending and processing messages respectively.

var eventHub = new EventHub("YourKeyVaultName"); 
var sender = new EventHub.Sender(eventHub); 
await sender.Send("YourJsonString"); 
 
var receiver = new EventHub.Receiver(eventHub); 
await receiver.Process(); 

Key Vault

The KeyVault class provides methods to interact with Azure KeyVault service. It helps retrieve secret values stored in KeyVault using secret names.

KeyVault.SetName("YourKeyVaultName"); 
string secretValue = KeyVault.GetSecret("YourSecretName"); 

Log

Open AI

The OpenAI class facilitates interaction with the OpenAI API. It provides a method Prompt that you can use to send prompts to the OpenAI and retrieve the response.

var openAI = new OpenAI("YourKeyVaultName"); 
string result = await openAI.Prompt("Simple", "User message", "System message"); 

Storage

The Storage class allows you to interact with Azure Blob Storage. It provides a BlobContainerClient instance that you can use to manage blobs in a container.

var blobContainerClient = Storage.Client; 

Prerequisites

To use AzureSolutions.Helpers, you need to generate relevant secrets in your Azure KeyVault:

AI Search

  • AISearch-Key
  • AISearch-Name
  • AISearch-SemanticConfiguration-Name
  • AISearch-SynonymMap-Name

AI Services

  • AIServices-Key
  • AIServices-Name

Event Hub

  • EventHub-ConnectionString
  • EventHub-Name
  • EventHub-SchemaRegistry-Group
  • EventHub-SchemaRegistry-Name

Open AI

  • OpenAI-Deployment-Name
  • OpenAI-Key
  • OpenAI-Name

Resource Group

  • ResourceGroup-Name

Storage

  • Storage-ConnectionString
  • Storage-ContainerName

SQL

  • SQL-Database-Name
  • SQL-Server-Name
  • SQL-Server-Password
  • SQL-Server-User

Subscription

  • Subscription-Id

Ensure applicable secrets are set up in your Azure KeyVault before using the AzureSolutions.Helpers library.

Dependencies

The AzureSolutions.Helpers library utilizes several other packages available through NuGet, including:

  • Azure.AI.OpenAI (Version 1.0.0-beta.9)
  • Azure.Identity (Version 1.10.4)
  • Azure.Messaging.EventHubs (Version 5.10.0)
  • Azure.Messaging.EventHubs.Processor (Version 5.10.0)
  • Azure.Search.Documents (Version 11.5.1)
  • Azure.Security.KeyVault.Secrets (Version 4.5.0)
  • Azure.Storage.Blobs (Version 12.19.1)
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.5-beta.81 55 12/14/2024
2.1.5-beta.80 36 12/14/2024
2.1.5-beta.79 42 12/14/2024
2.1.5-beta.78 42 12/13/2024
2.1.5-beta.77 35 12/13/2024
2.1.5-beta.76 37 12/13/2024
2.1.4 53 12/6/2024