Windows Azure Management Libraries を使用して、新しいクラウド サービスを展開しています。既存のクラウド サービスのコピーを作成しようとしていますが、新しい名前を使用しています。新しい展開を作成しようとすると、次のエラーが表示されます。
DeployNew error: Microsoft.WindowsAzure.CloudException: ResourceNotFound: The hosted service does not exist.
at Microsoft.WindowsAzure.Management.Compute.DeploymentOperationsExtensions.Create(IDeploymentOperations operations, String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters)
at XXYYZZ.DeployNew() in c:\xxyyzz\Scale.cs:line 147
REQUEST BODY:
<CreateDeployment xmlns="http://schemas.microsoft.com/windowsazure">
<Name>simulatorprocesstrainer</Name>
<PackageUrl>https://xxyyzz.blob.core.windows.net/deployments/XXYYZZ.cspkg</PackageUrl>
<Label>...</Label>
<Configuration>...</Configuration>
<StartDeployment>true</StartDeployment>
<ExtendedProperties />
</CreateDeployment>
RESPONSE:
HTTP/1.1 NotFound (404): Not Found
x-ms-servedbyregion: ussouth
x-ms-request-id: 8854275254702aef8c2a84a27d23f12d
Cache-Control: no-cache
Date: Tue, 12 Nov 2013 12:11:26 GMT
Server: 1.0.6198.19
Server: (rd_rdfe_stable.131030-2145)
Server: Microsoft-HTTPAPI/2.0
client-tracking-id: 1
Content-Length: 199
Content-Type: application/xml; charset=utf-8
RESPONSE BODY:
<Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Code>ResourceNotFound</Code><Message>The hosted service does not exist.</Message></Error>
「myfirstcloudservice」という名前の既存の clous サービスがあり、「myfirstcloudservice」からのコピーとして「myfirstcloudservice2」という名前の新しいクラウド サービスを作成したいと考えています。
次の疑似コードを使用しました。
using (ComputeManagementClient client = CloudContext.Clients.CreateComputeManagementClient(CertificateAuthenticationHelper.GetCredentials()))
{
var parameters = new DeploymentCreateParameters()
{
Label = "mypackagename",
Name = "myfirstcloudservice2",
PackageUri = package.Uri, // cspkg-file from myfirstcloudservice
Configuration = configContent, // content from cscfg-file from myfirstcloudservice
StartDeployment = true
};
client.Deployments.Create("myfirstcloudservice2", deploymentSlot, parameters);
}