Skip to content

Commit 0a0f8d7

Browse files
yifanz7msJinLei
andauthored
[Storage] Refine track2 OAuth context logic (#25954)
* refine track2 oauth context logic * add changelog --------- Co-authored-by: Jin Lei <[email protected]>
1 parent 599b64c commit 0a0f8d7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Updated Storage account cmdlet output context based on OAuth token
2122

2223
## Version 7.3.0
2324
* Supported account tier Cold

src/Storage/Storage.Management/Common/LazyAzureStorageContext.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ public override AzureSessionCredential Track2OauthToken {
8383
{
8484
if (_track2OauthToken == null)
8585
{
86-
_track2OauthToken = _track2OAuthTokenFactory();
86+
if (_track2OAuthTokenFactory == null)
87+
{
88+
return null;
89+
}
90+
_track2OauthToken = _track2OAuthTokenFactory();
8791
return _track2OauthToken;
8892
}
8993
return _track2OauthToken;

0 commit comments

Comments
 (0)