Closed ashmind closed 5 years ago
@ashmind
I can't repro this issue.
From PSH code, following 2 command will generate same storage context, no matter with or without -UseConnectedAccount
.
$context = New-AzStorageContext -StorageAccountName 'sl**' -UseConnectedAccount
$context = New-AzStorageContext -StorageAccountName 'sl**'
Would you please make sure the success script and the failed script only has the new context command different (with or without -UseConnectedAccount
, storage account are same), run in same powershell console, login with same Azure Account, and the script before and after the command are exactly same?
If so, would you please get request ID with following command just after the issue repro, then I can look at server log to see if any clu.
$error[0].Exception.InnerException.RequestInformation.ServiceRequestID
Hmm, I can't reproduce it anymore. Very weird since I reproduced it multiple times yesterday, but maybe something else. I also looked at the code and it does seem to be the same either way.
So I think this can be closed, thanks!
I'll re-raise if I can reproduce later.
@ashmind Thanks for the reply! I will close this issue. Feel free to contact us if need any further assistance.
Can this be re-opened? I'm also having this issue.
@neilp-snow
What's the exact issue you have meet? Would you please open a new issue, and follow the issue teamplate to share the necessary information, please also include: the command which the create context works, and which the created context not work. And the detail error?
Please make sure you use same StorageAccountName in New-AzStorageAccount, and login with same Azure account (login with Connect-AzAccount, alias Add-AzAccount/Login-AzAccount )
This error can be seen on Storage Accounts, that have private endpoint configured. How can I pass the Private endpoint IP?
@sayandaw
Would you please open a new issue and follow the issue template to give information that necessary for investigation?
Description
Using context created by
New-AzStorageContext -UseConnectedAccount
produces 403. HoweverNew-AzStorageContext
without-UseConnectedAccount
works fine, so it doesn't seem to be a permission issue.I might be misunderstanding the docs, but it seems that both of those options should be using the same approach? (OAuth)
Steps to reproduce
Note that if I remove
-UseConnectedAccount
it works fine.Environment data
Module versions
Debug output
Error output