AzureSolutions.Helpers
2.1.5-beta.80
See the version list below for details.
dotnet add package AzureSolutions.Helpers --version 2.1.5-beta.80
NuGet\Install-Package AzureSolutions.Helpers -Version 2.1.5-beta.80
<PackageReference Include="AzureSolutions.Helpers" Version="2.1.5-beta.80" />
paket add AzureSolutions.Helpers --version 2.1.5-beta.80
#r "nuget: AzureSolutions.Helpers, 2.1.5-beta.80"
// Install AzureSolutions.Helpers as a Cake Addin #addin nuget:?package=AzureSolutions.Helpers&version=2.1.5-beta.80&prerelease // Install AzureSolutions.Helpers as a Cake Tool #tool nuget:?package=AzureSolutions.Helpers&version=2.1.5-beta.80&prerelease
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
AI Search
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
-
net9.0
- Azure.AI.OpenAI (>= 2.1.0)
- Azure.Identity (>= 1.13.1)
- Azure.Messaging.EventHubs (>= 5.11.5)
- Azure.Messaging.EventHubs.Processor (>= 5.11.5)
- Azure.ResourceManager (>= 1.13.0)
- Azure.ResourceManager.Resources (>= 1.9.0)
- Azure.ResourceManager.Storage (>= 1.3.0)
- Azure.Search.Documents (>= 11.6.0)
- Azure.Security.KeyVault.Secrets (>= 4.7.0)
- Microsoft.Data.SqlClient (>= 5.2.2)
- Microsoft.TeamFoundationServer.Client (>= 19.225.1)
- Octokit (>= 13.0.1)
- System.Data.SqlClient (>= 4.9.0)
- System.Formats.Asn1 (>= 9.0.0)
- System.Net.Http (>= 4.3.4)
- System.Text.RegularExpressions (>= 4.3.1)
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 |