Skip to content

Commit

Permalink
[Storage] Fixed issue that table cmdlet fail when execute with Storag…
Browse files Browse the repository at this point in the history
…e context get from StorageAccount object and based on sharedkey authentication.
  • Loading branch information
blueww committed Sep 5, 2024
1 parent eb18fae commit 8f1de50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Updated Storage account cmdlet output context based on OAuth token
* Fixed issue that table cmdlet fail when execute with Storage context get from StorageAccount object and based on sharedkey authentication.

## Version 7.3.0
* Supported account tier Cold
Expand Down Expand Up @@ -50,6 +50,7 @@
- `Set-AzStorageShareQuota`
- `Start-AzStorageFileCopy`
- `Stop-AzStorageFileCopy`
* Updated Storage account cmdlet output context based on OAuth token

## Version 7.2.0
* Upgraded Microsoft.Azure.Storage.DataMovement to 2.0.5
Expand Down
4 changes: 3 additions & 1 deletion src/Storage/Storage/Common/StorageCloudCmdletBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ internal AzureStorageContext GetCmdletStorageContext(bool outputErrorMessage = t
internal AzureStorageContext GetCmdletStorageContext(IStorageContext inContext, bool outputErrorMessage = true)
{
var context = inContext as AzureStorageContext;
if (context == null && inContext != null)

// if TableStorageAccount == null and not using Oauth, need create the TableStorageAccount track1 object for table cmdlets.
if ((context == null && inContext != null) || (context.TableStorageAccount == null && context.StorageAccount != null && context.StorageAccount.Credentials != null && !context.StorageAccount.Credentials.IsToken))
{
context = new AzureStorageContext(inContext.GetCloudStorageAccount(), null, DefaultContext, WriteDebug);
}
Expand Down

0 comments on commit 8f1de50

Please sign in to comment.