AzureSolutions.Helpers
2.1.0-beta.1
See the version list below for details.
dotnet add package AzureSolutions.Helpers --version 2.1.0-beta.1
NuGet\Install-Package AzureSolutions.Helpers -Version 2.1.0-beta.1
<PackageReference Include="AzureSolutions.Helpers" Version="2.1.0-beta.1" />
paket add AzureSolutions.Helpers --version 2.1.0-beta.1
#r "nuget: AzureSolutions.Helpers, 2.1.0-beta.1"
// Install AzureSolutions.Helpers as a Cake Addin #addin nuget:?package=AzureSolutions.Helpers&version=2.1.0-beta.1&prerelease // Install AzureSolutions.Helpers as a Cake Tool #tool nuget:?package=AzureSolutions.Helpers&version=2.1.0-beta.1&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 | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Azure.AI.OpenAI (>= 2.1.0-beta.1)
- 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.Storage (>= 1.3.0)
- Azure.Search.Documents (>= 11.6.0)
- Azure.Security.KeyVault.Secrets (>= 4.7.0)
- Microsoft.TeamFoundationServer.Client (>= 19.225.1)
- Octokit (>= 13.0.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.0 | 38 | 11/21/2024 |
2.1.0-beta.4 | 39 | 11/21/2024 |
2.1.0-beta.3 | 39 | 11/21/2024 |
2.1.0-beta.2 | 34 | 11/21/2024 |
2.1.0-beta.1 | 36 | 11/21/2024 |
2.0.4-beta.1 | 33 | 11/20/2024 |
2.0.3 | 51 | 11/6/2024 |