Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] Fixed issue that table cmdlet fail with context get from StorageAccount object #26014

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,8 @@
- Additional information about change #1
-->
## Upcoming Release
* Updated Storage account cmdlet output context based on OAuth token
blueww marked this conversation as resolved.
Show resolved Hide resolved
* Fixed issue that table cmdlet fail when execute with Storage context get from StorageAccount object and based on sharedkey authentication.
* Refined Storage account cmdlet output context generation function based on OAuth token

## Version 7.3.0
* Supported account tier Cold
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