Doesnt Upload Blob to Azure Blob Storage C#

Frends.Community.Azure.Hulk

FRENDS Community Task for Azure Hulk related operations.

Task operations that use Azure DataMovement library for managing blobs. https://github.com/Azure/azure-storage-net-data-movement

Actions Status MyGet License: MIT

  • Installing
  • Tasks
    • UploadFileAsync
    • ListBlobs
    • DownloadBlobAsync
    • ReadBlobContentAsync
    • DeleteBlobAsync
    • DeleteContainerAsync
  • Building
  • Contributing
  • Modify Log

Installing

You tin can install the job via FRENDS UI Task View or you tin can find the NuGet package from the following NuGet feed https://www.myget.org/F/frends-community/api/v3/alphabetize.json and in Gallery view in MyGet https://www.myget.org/feed/frends-community/package/nuget/Frends.Community.Azure.Blob

Tasks

UploadFileAsync

Uploads file to a target container. If the container doesn't exist, it will exist created before the upload performance.
This feature does not piece of work with .netStandard 2.0

Backdrop

Property Type Clarification Example
Source File string Full path to file that is uploaded. 'c:\temp\uploadMe.xml'
Contents Simply bool Reads file content equally string and treats content equally selected Encoding true
Compress bool Applies gzip pinch to file or file content true
Connexion Cord string Connexion string to Azure storage 'UseDevelopmentStorage=truthful'
Container Name string Name of the azure blob storage container where the information will exist uploaded. If the container doesn't exist, then information technology will exist created. Come across Naming and Referencing Containers for naming conventions. 'my-container'
Create container if it does not exist bool Tries to create the container if information technology does not exist. false
Blob Type enum: Append, Cake or Folio Azure blob type to upload. Cake
Rename To string If value is set, uploaded file will be renamed to this. 'newFileName.xml'
Overwrite bool Should upload functioning overwrite existing file with same name. true
ParallelOperations int The number of the concurrent operations. 64
Content-Type string Forces any content-type to file. If empty, tries to estimate based on extension and MIME-blazon text/xml
Content-Encoding string File content is treated as this. Does not affect file encoding when Contents Just is truthful. If compression is enabled, Content-Blazon is set as 'gzip' utf8

Returns

Task returns an object with following backdrop

Property Type Description Example
SourceFile string Full path of file uploaded
Uri string Uri to uploaded hulk

ListBlobs

List blobs in a container.

Belongings Type Description Case
Connexion String string Connection string to Azure storage 'UseDevelopmentStorage=true'
Container Proper noun string Proper noun of the azure hulk storage container from where the data volition be downloaded. 'my-container'
Flat hulk listing bool Specifies whether to listing blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. true
Prefix string Blob prefix used while searching container

Returns

Result is a listing of object with following backdrop

Property Type Description Instance
Name string Blob Name. With Directories, this is empty.
Uri string Hulk Uri
BlobType string Blazon of the blob. Either 'Block','Page' or 'Directory' 'Block'
ETag string Value that is updated everytime blob is updated

DownloadBlobAsync

Downloads a blob to a file.

Properties

Belongings Type Description Example
Connection Cord cord Connection string to Azure storage 'UseDevelopmentStorage=true'
Container Name cord Name of the azure hulk storage container from where the information will be downloaded. 'my-container'
Blob Proper noun cord Name of the hulk to exist downloaded. 'donwloadMe.xml'
Blob Type enum: Append, Cake or Page Azure blob type to download. Block
Directory string Download destination directory. 'c:\downloads'
FileExistsOperation enum: Error, Rename, Overwrite Action to accept if destination file exists. Error: throws exception, Overwrite: writes over existing file, Rename: Renames file past adding '(1)' at the stop (instance: myFile.txt --> myFile(ane).txt) Error

Returns

Job returns an object with following properties

Holding Blazon Clarification Example
FileName string Downloaded file name.
Directory string Download directory.
FullPath string Full path to downloaded file.

ReadBlobContentAsync

Reads contents of a blob.

Properties

Property Type Clarification Example
Connectedness Cord string Connection string to Azure storage 'UseDevelopmentStorage=true'
Container Name cord Name of the azure blob storage container from where hulk data is located. 'my-container'
Blob Proper name cord Name of the blob which content is read. 'donwloadMe.xml'
Blob Type enum: Append, Block or Page Azure blob type to read. Block
Encoding string Encoding name in which blob content is read. 'UTF-8'

Returns

Chore returns an object with post-obit backdrop

Property Type Description Example
Content string Blob content.

DeleteBlobAsync

Deletes a blob from a target container. Operation result is seen as succesful fifty-fifty if the blob or the container doesn't be.

Properties

Belongings Blazon Clarification Case
Connection Cord string Connection cord to Azure storage 'UseDevelopmentStorage=truthful'
Container Name string Name of the container where delete blob exists. 'my-container'
Hulk Name string Name of the blob to delete. 'deleteMe.xml'
Verify ETag when deleting string Delete hulk simply if the ETag matches. Leave empty if verification is not needed. Used for concurrency. 0x9FE13BAA3234312
Blob Type enum: Append, Cake or Folio Azure blob type to read. Block
Snapshot delete option enum: None, IncludeSnapshots or DeleteSnapshotsOnly Defines what should be washed with hulk snapshots

Returns

Task returns an object with following properties

Property Blazon Description Instance
Success bool Indicates whether the operation was succesful or not. true

DeleteContainerAsync

Deletes a whole container from blob storage.

Backdrop

Property Type Description Case
Connection Cord string Connectedness string to Azure storage 'UseDevelopmentStorage=true'
Container Proper noun string Name of the container to delete. 'my-container'

Returns:

Property Type Description Example
Success bool Indicates whether the operation was succesful or not. true

Building

Clone a copy of the repo

git clone https://github.com/CommunityHiQ/Frends.Community.Azure.Blob

Restore dependencies

nuget restore Frends.Community.Azure.Hulk

Rebuild the projection

Run Tests with nunit3. Tests can be found under

Frends.Customs.Azure.Blob\bin\Release\Frends.Community.Azure.Blob.Tests.dll

Create a nuget package

nuget pack nuspec/Frends.Community.Azure.Blob.nuspec

Contributing

When contributing to this repository, delight first discuss the change y'all wish to make via issue, electronic mail, or any other method with the owners of this repository before making a change.

  1. Fork the repo on GitHub
  2. Clone the project to your own motorcar
  3. Commit changes to your ain co-operative
  4. Push your piece of work back up to your fork
  5. Submit a Pull asking so that we can review your changes

Annotation: Be sure to merge the latest from "upstream" before making a pull request!

Change Log

Version Changes
one.2.0 Wrote documentation according to development quide lines. Added DownloadBlobAsync, ReadBlobContentAsync and ListBlobs tasks.
one.three.0 New parameters in multiple tasks. New render value in list task. Tasks now apply System.ComponentModel.DataAnnotations
1.4.0 Updated dependencies due potential security vulnerabilities.
1.5.0 File upload now uses stream. Added options to shrink or read file as cord with Contents Only. Added Content-Blazon and Content-Encoding fields.
one.6.0 Added encoding selection to ReadBlobContentAsync task.
ii.0.0 Added support for both .netStandard 2.0 and net471.

pumashopplaunt.blogspot.com

Source: https://github.com/CommunityHiQ/Frends.Community.Azure.Blob

0 Response to "Doesnt Upload Blob to Azure Blob Storage C#"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel