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

Fixed error message when creating OAuth based Storage context without first login with Connect-AzAccount #26803

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

blueww
Copy link
Member

@blueww blueww commented Dec 3, 2024

Description

To fix the error message in #26802

Before the fix, it look there's namespace conflict, so the error will be
"Could not find the resource "Microsoft.WindowsAzure.Commands.Storage.Resources.resources" among the
resources "Microsoft.WindowsAzure.Commands.Storage.Common.Resources.resources" embedded in the
assembly "Microsoft.Azure.PowerShell.Storage.Common", nor among the resources in any satellite
assemblies for the specified culture. Perhaps the resources were embedded with an incorrect name."

After fix, the error will be as following ,which will remind user to logon with Connect-AzAccount.

PS C:\> New-AzStorageContext -StorageAccountName here
New-AzStorageContext : Context cannot be null.  Please log in using Connect-AzAccount.
At line:1 char:1
+ New-AzStorageContext -StorageAccountName here
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzStorageContext], InvalidOperationException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Storage.Common.Cmdlet.NewAzureStorageContext

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • For SDK-based development mode, update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • For autorest-based development mode, include the changelog in the PR description.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@VeryEarly VeryEarly merged commit b2a7da4 into Azure:future Dec 4, 2024
12 checks passed
VeryEarly pushed a commit that referenced this pull request Dec 4, 2024
VeryEarly added a commit that referenced this pull request Dec 4, 2024
#26826)

* Fixed error message when creating OAuth based Storage context without first login with Connect-AzAccount (#26803)

* fix changelog

---------

Co-authored-by: Wei Wei <[email protected]>
Co-authored-by: NoriZC <[email protected]>
github-actions bot pushed a commit that referenced this pull request Dec 4, 2024
#26826)

* Fixed error message when creating OAuth based Storage context without first login with Connect-AzAccount (#26803)

* fix changelog

---------

Co-authored-by: Wei Wei <[email protected]>
Co-authored-by: NoriZC <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants