public void CopyFromFile2SASFile() { CopyFromFile2SASFile((sourceShare) => { string connectionString = (new CloudStorageAccount(sourceShare.ServiceClient.Credentials, null, null, null, sourceShare.ServiceClient.StorageUri.PrimaryUri)).ToString(true); if (lang == Language.PowerShell) { PowerShellAgent.SetStorageContext(connectionString); } else { NodeJSAgent.SetStorageContext(connectionString); } }); CopyFromFile2SASFile((sourceShare) => { string sasToken = sourceShare.GetSharedAccessSignature(new SharedAccessFilePolicy() { Permissions = SharedAccessFilePermissions.Read, SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddHours(1) }); CommandAgent.SetStorageContextWithSASToken(StorageAccount.Credentials.AccountName, sasToken); }); }
public void CopyFromBlob2SASFile() { CopyFromBlob2SASFile((sourceContainer) => { if (lang == Language.PowerShell) { PowerShellAgent.SetStorageContext(StorageAccount.ToString(true)); } else { NodeJSAgent.SetStorageContext(StorageAccount.ToString(true)); }; }); CopyFromBlob2SASFile((sourceContainer) => { string sasToken = sourceContainer.GetSharedAccessSignature(new SharedAccessBlobPolicy() { Permissions = SharedAccessBlobPermissions.Read, SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddHours(1) }); CommandAgent.SetStorageContextWithSASToken(StorageAccount.Credentials.AccountName, sasToken); }); }