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

[BUG] permission lost in Start-AzStorageBlobCopy #364

Open
celinama opened this issue Nov 16, 2023 · 1 comment
Open

[BUG] permission lost in Start-AzStorageBlobCopy #364

celinama opened this issue Nov 16, 2023 · 1 comment
Labels
bug Something isn't working Priority 3

Comments

@celinama
Copy link

To Reproduce

Commands you ran
# Initialize these variables with your values.
$rgName = "celmatest"
$accountName = "blobtestcelma"
$srcContainerName = "rehydratetest"
$destContainerName = "rehydratetest"
$srcBlobName = "rehydrate.txt.txt"
$destBlobName = "rehydratechangetier.txt.txt"

# Get the storage account context
$ctx = (Get-AzStorageAccount -ResourceGroupName $rgName -Name $accountName).Context

# Copy the source blob to a new destination blob in hot tier with Standard priority.
Start-AzStorageBlobCopy -SrcContainer $srcContainerName -SrcBlob $srcBlobName -DestContainer $destContainerName -DestBlob $destBlobName -StandardBlobTier Hot -RehydratePriority Standard -Context $ctx

## Observed Behavior
403 not authorized error throw out

Include error output here
Start-AzStorageBlobCopy: This request is not authorized to perform this operation. HTTP Status Code: 403 - HTTP Error Message: This request is not authorized to perform this operation.
ErrorCode: AuthorizationFailure
ErrorMessage: This request is not authorized to perform this operation.
RequestId: 2d3062b3-501e-002b-5254-186ae8000000
Time: Thu, 16 Nov 2023 06:18:53 GMT

Expected behavior: here is the expected behavior in Windows PowerShell:

PS C:\Users\celma> $rgName = "celmatest"
PS C:\Users\celma> $accountName = "blobtestcelma"
PS C:\Users\celma> $srcContainerName = "rehydratetest"
PS C:\Users\celma> $destContainerName = "rehydratetest"
PS C:\Users\celma> $srcBlobName = "rehydrate.txt.txt"
PS C:\Users\celma> $destBlobName = "rehydratechangetier.txt.txt"
PS C:\Users\celma> $ctx = (Get-AzStorageAccount -ResourceGroupName $rgName -Name $accountName).Context
PS C:\Users\celma> Start-AzStorageBlobCopy -SrcContainer $srcContainerName -SrcBlob $srcBlobName -DestContainer $destContainerName -DestBlob $destBlobName -StandardBlobTier Hot -RehydratePriority Standard -Context $ctx

AccountName: blobtestcelma, ContainerName: rehydratetest

Name BlobType Length ContentType LastModified AccessTier SnapshotT
ime


rehydratechangeti... BlockBlob 526 text/plain 2023-11-16 06:15:34Z Hot

A clear description of what you expected to happen instead.
Permission lost when using Cloud Shell, it is working in Windows PowerShell

Is this specific to Cloud Shell? Yes, Windows PowerShell works

Please verify if the same issue can be reproduced by running the same tool outside Cloud Shell - for example,
by installing it on your own computer. If so, it is likely to be a bug in that tool or in the Azure service it communicates with,
not in Cloud Shell. Please file the issue with the appropriate project.

Interface information neither ttps://shell.azure.com nor https://portal.azure.com works

How are you accessing Cloud Shell - https://shell.azure.com, https://portal.azure.com, via Windows Terminal, or some other method?
If a browser, which Operating System and browser are you using? (ex. Edge on Windows 10)

Additional context

Add any other context about the problem here.

@celinama celinama added bug Something isn't working Triage-needed Triage needed by Cloud Shell team labels Nov 16, 2023
@mbifeld
Copy link
Member

mbifeld commented Apr 9, 2024

Does it work if you run 'az login' in Cloud Shell prior to running the command?

@mbifeld mbifeld added Priority 3 and removed Triage-needed Triage needed by Cloud Shell team labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority 3
Projects
None yet
Development

No branches or pull requests

2 participants