gpt4 book ai didi

azure - 存储帐户问题?

转载 作者:行者123 更新时间:2023-12-02 08:27:48 25 4
gpt4 key购买 nike

我正在尝试创建存储组,但遇到了一些问题。

这是我正在使用的代码:

$StorageAccountName = 'myazurefileshare'
$Share = 'FileShare'
$Location = 'North Europe'
$ac = Get-AzureStorageAccount -StorageAccountName $StorageAccountName -ErrorAction SilentlyContinue
"Storage account exists? [$(if ($ac) {$true} else {$false})]"
If (!$ac) # Does not exist - so create it
{
Write-Verbose "Storage Account [$StorageAccountName] in [$Location] does not exist"
Write-Verbose "Creating Storage Account [$StorageAccountName] in [$Location]"
New-AzureStorageAccount -StorageAccountName $StorageAccountName `
-Location $Location -type 'Standard_GRS'
}

如果我在启用详细信息的情况下运行此命令,我会得到以下结果:

VERBOSE: 19:58:11 - Begin Operation: Get-AzureStorageAccount
VERBOSE: 19:58:12 - Completed Operation: Get-AzureStorageAccount
Storage account exists? [False]
VERBOSE: Storage Account [myazurefileshare] in [North Europe] does not exist
VERBOSE: Creating Storage Account [myazurefileshare] in [North Europe]
VERBOSE: 19:58:12 - Begin Operation: New-AzureStorageAccount
New-AzureStorageAccount : ConflictError: The storage account named 'myazurefileshare' is already taken.
At line:13 char:6
+ New-AzureStorageAccount -StorageAccountName $StorageAccountName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureStorageAccount], CloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.StorageServices.NewAzureStorageAccountCommand

VERBOSE: 19:58:14 - Completed Operation: New-AzureStorageAccount

所以 - 当我执行 Get-AzureStorageAccount 时,它告诉我存储帐户不存在。但是当我尝试创建它时,由于名称存在而失败。不用说,Test-AzureName 与返回的错误是一致的:

C:> Test-AzureName -Storage myazurefileshare
VERBOSE: The storage account named 'myazurefileshare' is already taken.
True

那么为什么 Get-AzureStorageAccount 不返回 Test-Azurename 所说存在的实际存储帐户?

线索?

(对之前的格式问题表示歉意!)

最佳答案

存储帐户名称在订阅中是唯一的。当您尝试列出具有给定名称的帐户时,在您的订阅下找不到该帐户,但该帐户已被其他人占用,并且不允许您创建另一个同名的存储帐户。

关于azure - 存储帐户问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30427205/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com