gpt4 book ai didi

azure - 当前正在此存储帐户上执行需要独占访问的操作

转载 作者:行者123 更新时间:2023-12-04 13:45:53 24 4
gpt4 key购买 nike

我的要求是编写测试用例,为 Azure 中存储帐户的多个 api 版本创建存储帐户。但出现此错误

An operation is currently performing on this storage account that requires exclusive access. but sometimes and intermittently test has been passed, so i want to know whats the root cause and how to fix this error. My concern is what, Azure cant create multiple storage account in one go. or any other constraint from Azure that does not allow me to do this?

我的实现:我有一个数组,其中有多个 api 版本,下面是我的实现,

let apiVersions =  ["2017-10-01", "2017-06-01", "2016-12-01", "2016-05-01", "2016-01-01"];

describe("put", function () {
it("should create a storage account with storage account type, async () => {
for (const apiVersion of apiVersions) {
let location = 'uk south';
let resourceGroupName = 'test';
let storageAccountName = 'stacct';
AzureAuthentication.StorageAccountApiVersion = apiVersion;
// StorageAccount.FormatName(storageAccountName + apiVersion): this function will give me string without special charaters and spaces etc, e.g stacct20171001
await StorageAccount.CreateStorageAccount(resourceGroupName, location, StorageAccount.FormatName(storageAccountName + apiVersion), AzureAuthentication);
}
});
});

有人面临这个错误吗?

最佳答案

该错误消息可能是由于缺少您想要创建的存储帐户的规范,请检查您的代码,它没有指定您希望创建它的区域等...检查示例下面的c#:

 /* Include this "using" directive...
using Microsoft.Azure.Management.Storage.Fluent
*/

IStorageAccount storage = azure.StorageAccounts.Define(storageAccountName)
.WithRegion(Region.USEast)
.WithNewResourceGroup(rgName)
.Create();

完整文档可以在 here 找到

关于azure - 当前正在此存储帐户上执行需要独占访问的操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48640970/

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