Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #41 from LuccaSA/fix-azure
Browse files Browse the repository at this point in the history
Fix upload to azure
  • Loading branch information
seguins committed Jun 8, 2022
2 parents 87159d4 + c4cffa2 commit 0f61806
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion TCC.Lib/Options/CompressOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CompressOption : TccOption
public int? CleanupTime { get; set; }
public string AzBlobUrl { get; set; }
public string AzBlobContainer { get; set; }
public string AzSaS { get; set; }
public string AzBlobSaS { get; set; }
public int? AzThread { get; set; }
public string GoogleStorageBucketName { get; set; }
public string GoogleStorageCredential { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions TCC.Lib/Storage/RemoteStorageFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public static async Task<IRemoteStorage> GetRemoteStorageAsync(this CompressOpti
{
if (string.IsNullOrEmpty(option.AzBlobUrl)
|| string.IsNullOrEmpty(option.AzBlobContainer)
|| string.IsNullOrEmpty(option.AzSaS))
|| string.IsNullOrEmpty(option.AzBlobSaS))
{
logger.LogCritical("Configuration error for azure blob upload");
return new NoneRemoteStorage();
}
var client = new BlobServiceClient(new Uri(option.AzBlobUrl + "/" + option.AzBlobContainer + "?" + option.AzSaS));
var client = new BlobServiceClient(new Uri(option.AzBlobUrl + "/" + option.AzBlobContainer + "?" + option.AzBlobSaS));
BlobContainerClient container = client.GetBlobContainerClient(option.AzBlobContainer);
return new AzureRemoteStorage(container);
}
Expand Down
2 changes: 1 addition & 1 deletion TCC.Tests/Upload/BlobStorageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task AzureUploadTest()
{
AzBlobUrl = GetEnvVar("AZ_URL"),
AzBlobContainer = GetEnvVar("AZ_CONTAINER"),
AzSaS = GetEnvVar("AZ_SAS_TOKEN")
AzBlobSaS = GetEnvVar("AZ_SAS_TOKEN")
};
opt.UploadMode = UploadMode.AzureSdk;
var uploader = await opt.GetRemoteStorageAsync(NullLogger.Instance, CancellationToken.None);
Expand Down

0 comments on commit 0f61806

Please sign in to comment.