AzureAndDataverseLibrary 6.0.5.5

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package AzureAndDataverseLibrary --version 6.0.5.5
NuGet\Install-Package AzureAndDataverseLibrary -Version 6.0.5.5
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="AzureAndDataverseLibrary" Version="6.0.5.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AzureAndDataverseLibrary --version 6.0.5.5
#r "nuget: AzureAndDataverseLibrary, 6.0.5.5"
#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 AzureAndDataverseLibrary as a Cake Addin
#addin nuget:?package=AzureAndDataverseLibrary&version=6.0.5.5

// Install AzureAndDataverseLibrary as a Cake Tool
#tool nuget:?package=AzureAndDataverseLibrary&version=6.0.5.5

The base use of this library is for easy connection with azure and dataverse. Below there is a documentation how every using can be used, how to be used and possible errors and fixes.

using AzureAndDataverseLibrary.Authentication;

Possible classes to address :

DataverseAuthConfig ⇒ this class can be used to configure the dataverse connection and authentication.

This can be instantiated with 2 constructors:

  1. public DataverseAuthConfig(string baseUrl, string tenantId, string clientId, string clientSecret, string apiVersion = null, string apiODataVersion = null)

the optional parameters are the versions this will take the standard of :

apiVersion: 9.1

apiODataVersion: 4.0

  1. public DataverseAuthConfig(DataverseConfig config)

this class has the following constructors:

DataverseConfig(string baseUrl, string tenantId, string clientId, string clientSecret, string apiVersion = null, string apiODataVersion = null)

DataverseConfig(string baseUrl, string[] scopes, string apiVersion, string apiODataVersion, string tenantId, string clientId, string clientSecret)

Both wil result in the same configuration, the only difference is you can define scopes in the one constructer, in the other it has the base scope.

the optional parameters are the versions this will take the standard of :

apiVersion: 9.1

apiODataVersion: 4.0

using AzureAndDataverseLibrary.Bootstrappers;

this usings will only be used in the startup class. This method gives the ability to configure all dataverse and azure connection manually or fully automatically.

The method is called : AddDataVerseAndAzureServices();

To use it add it to the services.

Builder will be used when deploying an azure function ⇒

builder.services.AddDataVerseAndAzureServices();

to manually add, or automatically configure there should be added an option inside it.

Like the following example:

3

2

1 alternate text is missing from this package README imagealternate text is missing from this package README imagealternate text is missing from this package README imagealternate text is missing from this package README imagealternate text is missing from this package README imagealternate text is missing from this package README image

  1. If using method 1. This will get all configuration from an azure keyvault, the credentials can be used to authenticate.

    Note: Version 1.1.15 and above allows the following ⇒ if the authentication happens on identity level in azure you can provide the KeyvaultUrl alone.

  2. Adding a DataverseConfig can be done with the Second method in combination with nr1. And or nr3. Or alone.

  3. Adding a DataverseConfig can be done with the Second method in combination with nr1. And or nr2. Or alone.

using AzureAndDataverseLibrary.Configs;

AzureConfig this class is used to configure Azure and create a secure connection to its resources.

public AzureConfig(string azureAdTenantId, string azureAdClientId, string azureAdClientSecret, string azureShareFileStorage = null, string azureBlobStorage = null, string azureBlobStorageContainerName = null, string azureShareFileStorageContainerName = null)

DataverseConfig this class is used to configure Dataverse and create a secure connection to its resources.

public DataverseConfig(string baseUrl, string tenantId, string clientId, string clientSecret, string apiVersion = null, string apiODataVersion = null)

using AzureAndDataverseLibrary.Entities;

This class is used as the base off all DataverseEntities meaning that all autogenerated columns are in this entity, whether desired or not all entities from dataverse can use this.

public abstract class DataverseEntity();

using AzureAndDataverseLibrary.Enums;

  • Only usable with FodJustProjects. This has predefined the name of those projects. And can be used as param to instantiate the DataverseService and AzureService.

using AzureAndDataverseLibrary.Extensions;

DateTimeExtensions ⇒

long long ToEpochTime(this DateTime? dateTime, double daysToAdd = 0) works on nullable and non nullable datetime and a possibility to add days.

This returns the unixTimeMilliseconds.

JTokenExtensions ⇒

bool IsNullOrEmpty(this JToken token) ⇒ check wether the token is null or empty.

string Value(this JToken jObject, string key, ILogger logger = null)

⇒this tries to convert a token to a JObject and get a certain value with the key out of the JObject.

JArray GetValues(this object obj) ⇒ This one is used strongly in the Dataverse (odata) world, every response is a Object, that has a param with the name “value”, this filters out everything not needed and returns the “pure” value. This also always convert everything to a list, even when its one object.

JToken GetFirstValue(this object obj) ⇒ this can be used to return object desired from the GetValues. And will return a Jtoken.

T MapToClass<T>(this object obj) ⇒ This is method heavily used. This makes the possibility to map every result from dataverse to Entity or List<Entity>.

StringExtensions ⇒

string DecodeBase64_UTF(this string x) ⇒ Decodes a base64 string

string EncodeBase64_UTF(this string x) ⇒ encodes a base64 string byte[] BytesFromBase64(this string x) ⇒ gets the bytes from a base64 JObject ConvertToJson(this string x) ⇒ converts a string if possible to an object. string RemoveChar(this string str, char x) ⇒ removes the char everywhere in the sentence.

using AzureAndDataverseLibrary.Parsers;

At the moment there is only a WordParser.

byte[] AddImageAndTxtToWordDocument(byte[] fileBytes, Dictionary<string, string> bodyData, Dictionary<string, byte[]> Imagedata)

byte[] RegexReplacer(Dictionary<string, string> bodyData, byte[] fileBytes)

Both Methods are build to replace text in a word document. The first method also gives you the possibility to add an image (the spot is found with bookmarks)

using AzureAndDataverseLibrary.Services;

DataVerseService ⇒

Task<object> ConfigureDataverseRequestAsync(HttpMethod httpMethod, string table, string filter = null, Dictionary<string, object> content = null);

Task<object> ConfigureDataverseRequestAsync(HttpMethod httpMethod, string table, string filter = null, object costumClass = null);

This is the base Configuration of a Dataverse Call, extremely flexible and accepts all httpmethods, table,filter,dictionary or object

Task<bool> DeleteEntityInDataverse(string tableNameWithGuid);

This wil delete an entity with the given Id

Task<T> GetEntityInDataverse<T>(string table, string filter = null) where T : class;

This gives the wanted Entity or List<Entity> back,there is a possibility to filter your results.

Task<T> PatchEntityInDataverse<T>(string table, Dictionary<string, object> objectToPost = null) where T : class;

Task<T> PatchEntityInDataverse<T>(string table, T objectToPost) where T : class;

This updates the wanted Entity, there is a possibility to send the entiry entity or a dictionary with the wanted properties that need to be updated.

Task<T> PostEntityInDataverse<T>(string table, Dictionary<string, object> objectToPost = null) where T : class;

Task<T> PostEntityInDataverse<T>(string table, T objectToPost) where T : class;

This creates the wanted Entity, there is a possibility to send the entiry entity or a dictionary with the wanted properties that need to be filled in.

AzureStorageService ⇒

Task<byte[]> DownloadBlobFileAsync(string filetoDownload, string containerName = null, string connectionString = null);

This method gives the possibility to download a blobfile, the optional parameters are normally configured with the startup method. This can be overwritten in case its necessary.

Task<byte[]> DownloadShareFileAsync(string fileName, string containerName = null, string connectionString = null);

This method gives the possibility to download a ShareFile, the optional parameters are normally configured with the startup method. This can be overwritten in case its necessary.

string GetBlobFileDownloadUrl(string filetoDownload, string containerName = null, string connectionString = null, int minutesToExpire = 1, int daysToExpire = 0, int yearsToExpire = 0);

This method gives the possibility to download a blobfile sasurl with read persmission, the optional parameters are normally configured with the startup method. This can be overwritten in case its necessary.

string GetBlobFileUploadUrl(string fileName, string containerName = null, string connectionString = null, int minutesToExpire = 1, int daysToExpire = 0, int yearsToExpire = 0);

This method gives the possibility to download a blobfile sasurl with write/replace persmission, the optional parameters are normally configured with the startup method. This can be overwritten in case its necessary.

Task<string> UploadBlobFileAsync(byte[] documentContent, string fileName, string containerName = null, string connectionString = null);

This method gives the possibility to upload a BlobFile, the optional parameters are normally configured with the startup method. This can be overwritten in case its necessary.

Task<string> UploadShareFileAsync(byte[] documentContent, string fileName, string containerName = null, string connectionString = null);

This method gives the possibility to upload a ShareFile, the optional parameters are normally configured with the startup method. This can be overwritten in case its necessary.

string GetShareFileUploadUrl(string fileName, string containerName = null, string connectionString = null, int minutesToExpire = 1, int daysToExpire = 0, int yearsToExpire = 0);

This method gives the possibility to download a ShareFile sasurl with write/replace persmission, the optional parameters are normally configured with the startup method. This can be overwritten in case its necessary.

string GetShareFileDownloadUrl(string fileName, string containerName = null, string connectionString = null, int minutesToExpire = 1, int daysToExpire = 0, int yearsToExpire = 0);

This method gives the possibility to download a ShareFile sasurl with write/replace persmission, the optional parameters are normally configured with the startup method. This can be overwritten in case its necessary.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
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

Migragtion To Net6