5

我正在尝试应该是一项非常基本的任务。我创建了一个工作站模板的本地 VHD,我想上传它以在我的 Azure 环境中使用。我正在使用 Azure Powershell。

我已上传 .cer 文件以创建管理证书。我已导入 .publishsettings 文件,并且可以使用 Set-AzureSubscription 和 Select-AzureSubscription 没有明显问题:

Set-AzureSubscription -SubscriptionName "Windows Azure Enterprise" -CurrentStorageAccount ATOQA

Select-AzureSubscription -SubscriptionName "Windows Azure Enterprise"

当我尝试使用 Add-AzureVHD 时遇到的问题是:

PS C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\bin> add-azurevhd -destination "https://ATOQA.blob.core.windows.net/vhds/ztemplate-W7.vhd" -localfilepath "C:\VM\W7_Template\ztemplate-w7.vhd"
add-azurevhd : "An exception occurred when calling the ServiceManagement API. HTTP Status Code: 404. Service Management Error Code: ResourceNotFound. Message: The requested storage account 
'atoqa' was not found.. Operation Tracking ID: df91c24901254047b39a7a7d5b037ea0."
At line:1 char:1
+ add-azurevhd -destination "https://ATOQA.blob.core.windows.net/vhds/ztemplate-W7 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Add-AzureVhd], ServiceManagementClientException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.StorageServices.AddAzureVhdCommand

我相当确定我用来指定 -destination 的信息是正确的,因为我直接从 Azure 站点上的容器 URL 字段复制了它。

我哪里错了?我一直在使用一些网站作为指南,让您了解我的工作内容:

http://www.cloudtec.ch/blog/tech/upload-vhd-to-azure.html

http://msdn.microsoft.com/en-us/library/windowsazure/dn205185.aspx

我还尝试使用具有相同基本步骤的 CSUPLOAD 并收到一条消息,指出“未找到存储帐户”,这让我相信我正在用错误的信息填充参数,但我真的很困惑什么我的错误正是。

非常非常感谢提前!

4

2 回答 2

7

Short Answer:

Please ensure that your storage account is in the same subscription as specified in Set-AzureSubscription.

Long Answer:

What's happening (I think) is that when you call Set-Subscription, the cmdlet doesn't check if the storage account is in the same subscription. Now when you call, Add-AzureVhd and specify the destination URL, the cmdlet need to find the storage account key and makes use of Get Storage Account Keys operation for that making use of subscription id and management certificate. Because this storage account does not exist in the specified subscription, you get Resource Not Found error.

于 2013-05-17T15:50:24.650 回答
4

我遇到了问题Set-AzureSubscription

Select-AzureSubscription成功了。

于 2013-08-17T00:02:09.860 回答