Skip to content

Commit bdd18d0

Browse files
committed
fix comments
1 parent 04d7e27 commit bdd18d0

File tree

10 files changed

+25
-30
lines changed

10 files changed

+25
-30
lines changed

src/Storage/Storage/Blob/Cmdlet/GetAzureStorageBlobContent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ internal virtual async Task DownloadBlob(long taskId, IStorageBlobManagement loc
215215
|| !System.IO.File.Exists(filePath)
216216
|| ShouldContinue(string.Format(Resources.OverwriteConfirmation, filePath), null))
217217
{
218-
StorageTransferOptions trasnferOption = new StorageTransferOptions()
218+
StorageTransferOptions transferOption = new StorageTransferOptions()
219219
{
220220
MaximumConcurrency = this.GetCmdletConcurrency(),
221221
MaximumTransferSize = size4MB,
222222
InitialTransferSize = size4MB
223223
};
224-
await blob.DownloadToAsync(filePath, BlobRequestConditions, trasnferOption, CmdletCancellationToken).ConfigureAwait(false);
224+
await blob.DownloadToAsync(filePath, BlobRequestConditions, transferOption, CmdletCancellationToken).ConfigureAwait(false);
225225
OutputStream.WriteObject(taskId, new AzureStorageBlob(blob, localChannel is null? null : localChannel.StorageContext, blobProperties, options: ClientOptions));
226226
}
227227
}

src/Storage/Storage/Blob/Cmdlet/NewAzureStorageBlobSasToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public string Policy
109109
[ValidateNotNullOrEmpty]
110110
public string Permission { get; set; }
111111

112-
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user would is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
112+
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user who is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
113113
[ValidateNotNullOrEmpty]
114114
public string DelegatedUserObjectId { get; set; }
115115

src/Storage/Storage/Blob/Cmdlet/NewAzureStorageContainerSasToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public string Policy
6767
[ValidateNotNullOrEmpty]
6868
public string Permission { get; set; }
6969

70-
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user would is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
70+
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user who is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
7171
[ValidateNotNullOrEmpty]
7272
public string DelegatedUserObjectId { get; set; }
7373

src/Storage/Storage/Blob/Cmdlet/SetAzureStorageBlobContent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ internal virtual async Task UploadBlobwithSdk(long taskId, IStorageBlobManagemen
486486
if (string.Equals(blobType, BlockBlobType, StringComparison.InvariantCultureIgnoreCase))
487487
{
488488
outputBlobClient = blobClient;
489-
StorageTransferOptions trasnferOption = new StorageTransferOptions() { MaximumConcurrency = this.GetCmdletConcurrency() };
489+
StorageTransferOptions transferOption = new StorageTransferOptions() { MaximumConcurrency = this.GetCmdletConcurrency() };
490490
BlobUploadOptions uploadOptions = new BlobUploadOptions();
491491
if (this.BlobTag != null)
492492
{
@@ -497,7 +497,7 @@ internal virtual async Task UploadBlobwithSdk(long taskId, IStorageBlobManagemen
497497
uploadOptions.Conditions = this.BlobRequestConditions;
498498
uploadOptions.AccessTier = accesstierToSet;
499499
uploadOptions.ProgressHandler = progressHandler;
500-
uploadOptions.TransferOptions = trasnferOption;
500+
uploadOptions.TransferOptions = transferOption;
501501

502502
await blobClient.UploadAsync(stream, uploadOptions, CmdletCancellationToken).ConfigureAwait(false);
503503
}

src/Storage/Storage/Common/Cmdlet/NewAzureStorageContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ public SwitchParameter Anonymous
184184
[Parameter(HelpMessage = "Use OAuth storage account", Mandatory = false, ParameterSetName = SasTokenParameterSet)]
185185
[Parameter(HelpMessage = "Use OAuth storage account", Mandatory = false, ParameterSetName = SasTokenEnvironmentParameterSet)]
186186
[Parameter(HelpMessage = "Use OAuth storage account", Mandatory = false, ParameterSetName = SasTokenServiceEndpointParameterSet)]
187-
188187
public SwitchParameter UseConnectedAccount
189188
{
190189
get { return isOAuth; }

src/Storage/Storage/DatalakeGen2/Cmdlet/GetAzDataLakeGen2FileContent.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ internal virtual async Task DownloadBlob(long taskId, IStorageBlobManagement loc
165165
|| !System.IO.File.Exists(filePath)
166166
|| ShouldContinue(string.Format(Resources.OverwriteConfirmation, filePath), null))
167167
{
168-
StorageTransferOptions trasnferOption = new StorageTransferOptions()
168+
StorageTransferOptions transferOption = new StorageTransferOptions()
169169
{
170170
MaximumConcurrency = this.GetCmdletConcurrency(),
171171
MaximumTransferSize = size4MB,
172172
InitialTransferSize = size4MB
173173
};
174-
await blob.DownloadToAsync(filePath, BlobRequestConditions, trasnferOption, CmdletCancellationToken).ConfigureAwait(false);
174+
await blob.DownloadToAsync(filePath, BlobRequestConditions, transferOption, CmdletCancellationToken).ConfigureAwait(false);
175175
}
176176

177177
WriteDataLakeGen2Item(localChannel, fileClient, taskId);
@@ -312,8 +312,8 @@ public override void ExecuteCmdlet()
312312
DoBeginProcessing();
313313
}
314314

315-
CloudBlockBlob tr1blob = null;
316-
BlockBlobClient tr2blob = null;
315+
CloudBlockBlob track1Blob = null;
316+
BlockBlobClient track2Blob = null;
317317
if (ParameterSetName == ManualParameterSet)
318318
{
319319
DataLakeFileSystemClient fileSystem = GetFileSystemClientByName(localChannel, this.FileSystem);
@@ -326,12 +326,12 @@ public override void ExecuteCmdlet()
326326
if (Channel.StorageContext.Track2OauthToken != null)
327327
{
328328
var blobServiceClient = Channel.GetBlobServiceClient();
329-
tr2blob = blobServiceClient.GetBlobContainerClient(this.FileSystem).GetBlockBlobClient(this.Path);
329+
track2Blob = blobServiceClient.GetBlobContainerClient(this.FileSystem).GetBlockBlobClient(this.Path);
330330
}
331331
else
332332
{
333333
CloudBlobContainer container = GetCloudBlobContainerByName(Channel, this.FileSystem).ConfigureAwait(false).GetAwaiter().GetResult();
334-
tr1blob = container.GetBlockBlobReference(this.Path);
334+
track1Blob = container.GetBlockBlobReference(this.Path);
335335
}
336336
}
337337
else //BlobParameterSet
@@ -344,16 +344,16 @@ public override void ExecuteCmdlet()
344344
// For SAS, the Uri already contains the sas token, so can't repeatedly inout the credential
345345
if (Channel.StorageContext.Track2OauthToken != null)
346346
{
347-
tr2blob = new BlockBlobClient(InputObject.File.Uri, Channel.StorageContext.Track2OauthToken);
347+
track2Blob = new BlockBlobClient(InputObject.File.Uri, Channel.StorageContext.Track2OauthToken);
348348
}
349349
else
350350
{
351-
tr1blob = new CloudBlockBlob(InputObject.File.Uri);
351+
track1Blob = new CloudBlockBlob(InputObject.File.Uri);
352352
}
353353
}
354354
else
355355
{
356-
tr1blob = new CloudBlockBlob(InputObject.File.Uri, Channel.StorageContext.StorageAccount.Credentials);
356+
track1Blob = new CloudBlockBlob(InputObject.File.Uri, Channel.StorageContext.StorageAccount.Credentials);
357357
}
358358
fileClient = InputObject.File;
359359
}
@@ -363,13 +363,13 @@ public override void ExecuteCmdlet()
363363
}
364364
}
365365

366-
if (tr1blob != null)
366+
if (track1Blob != null)
367367
{
368-
GetBlobContent(tr1blob, FileName, true);
368+
GetBlobContent(track1Blob, FileName, true);
369369
}
370370
else
371371
{
372-
GetBlobContent(tr2blob, FileName, true);
372+
GetBlobContent(track2Blob, FileName, true);
373373
}
374374

375375
if (AsJob.IsPresent)

src/Storage/Storage/DatalakeGen2/Cmdlet/NewAzDataLakeGen2SasToken.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class NewDataLakeGen2SasTokenCommand : StorageCloudBlobCmdletBase
6262
[ValidateNotNullOrEmpty]
6363
public string Permission { get; set; }
6464

65-
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user would is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
65+
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user who is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
6666
[ValidateNotNullOrEmpty]
6767
public string DelegatedUserObjectId { get; set; }
6868

@@ -120,7 +120,7 @@ public override void ExecuteCmdlet()
120120
{
121121
IStorageBlobManagement localChannel = Channel;
122122

123-
// When the input context is Oauth bases, can't generate normal SAS, but UserDelegationSas
123+
// When the input context is OAuth bases, can't generate normal SAS, but UserDelegationSas
124124
bool generateUserDelegationSas = false;
125125
if (Channel != null && Channel.StorageContext != null && Channel.StorageContext.StorageAccount.Credentials != null && Channel.StorageContext.StorageAccount.Credentials.IsToken)
126126
{
@@ -192,10 +192,6 @@ public override void ExecuteCmdlet()
192192
}
193193
if (this.DelegatedUserObjectId != null)
194194
{
195-
if (!generateUserDelegationSas)
196-
{
197-
// TODO Write error
198-
}
199195
sasBuilder.DelegatedUserObjectId = this.DelegatedUserObjectId;
200196
}
201197

src/Storage/Storage/File/Cmdlet/NewAzureStorageFileSasToken.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public string Policy
9191

9292
[Parameter(
9393
Mandatory = false,
94-
HelpMessage = "This value specifies the Entra ID of the user would is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
94+
HelpMessage = "This value specifies the Entra ID of the user who is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
9595
[ValidateNotNullOrEmpty]
9696
public string DelegatedUserObjectId { get; set; }
9797

@@ -158,7 +158,7 @@ public override void ExecuteCmdlet()
158158
fileClient = shareClient.GetRootDirectoryClient().GetFileClient(this.Path);
159159
}
160160

161-
// When the input context is Oauth bases, can't generate normal SAS, but UserDelegationSas
161+
// When the input context is OAuth bases, can't generate normal SAS, but UserDelegationSas
162162
bool generateUserDelegationSas = false;
163163
if (Channel != null && Channel.StorageContext != null && Channel.StorageContext.StorageAccount.Credentials != null && Channel.StorageContext.StorageAccount.Credentials.IsToken)
164164
{

src/Storage/Storage/File/Cmdlet/NewAzureStorageShareSasToken.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public string Policy
5555
}
5656
private string accessPolicyIdentifier;
5757

58-
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user would is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
58+
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user who is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
5959
[ValidateNotNullOrEmpty]
6060
public string DelegatedUserObjectId { get; set; }
6161

@@ -110,7 +110,7 @@ public override void ExecuteCmdlet()
110110
snapshotTime: null,
111111
ClientOptions);
112112

113-
// When the input context is Oauth bases, can't generate normal SAS, but UserDelegationSas
113+
// When the input context is OAuth bases, can't generate normal SAS, but UserDelegationSas
114114
bool generateUserDelegationSas = false;
115115
if (Channel != null && Channel.StorageContext != null && Channel.StorageContext.StorageAccount.Credentials != null && Channel.StorageContext.StorageAccount.Credentials.IsToken)
116116
{

src/Storage/Storage/Queue/Cmdlet/NewAzureStorageQueueSasToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public string Policy
6161
[ValidateNotNullOrEmpty]
6262
public string Permission { get; set; }
6363

64-
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user would is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
64+
[Parameter(Mandatory = false, HelpMessage = "This value specifies the Entra ID of the user who is authorized to use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued to the user specified in this value. This parameter can only be specified when input Storage Context is OAuth based.")]
6565
[ValidateNotNullOrEmpty]
6666
public string DelegatedUserObjectId { get; set; }
6767

0 commit comments

Comments
 (0)