API を介して診断拡張機能を既存の Azure クラウド サービスにインストールしようとしています。Cloud Service には予約済みの IP が割り当てられています。「<strong>展開の更新またはアップグレード中に、予約済みの IP を追加、削除、または変更できません。」というメッセージが表示されます。その際、ChangeConfigurationBySlot を使用します。これを機能させるためのトリックを知っている人はいますか?これは API のミスですか、それとも何か間違っていますか?
関連するコード スニペットを次に示します。
var dep = client.Deployments.GetBySlot(resource.ServiceName, DeploymentSlot.Production);
var serviceConfig = XElement.Parse(dep.Configuration, LoadOptions.SetBaseUri);
var config = new DeploymentChangeConfigurationParameters(serviceConfig.ToString())
{
ExtendedProperties = dep.ExtendedProperties,
Mode = DeploymentChangeConfigurationMode.Auto,
TreatWarningsAsError = false,
Configuration = serviceConfig.ToString(),
ExtensionConfiguration = new ExtensionConfiguration
{
AllRoles = new List<ExtensionConfiguration.Extension>(),
NamedRoles = extensionConfig
}
};
var result = client.Deployments.ChangeConfigurationBySlot(resource.ServiceName, DeploymentSlot.Production, config);
クラウド サービス構成の関連セクションは次のとおりです。
<ServiceConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" serviceName="IS.Admin.Azure" osFamily="4" osVersion="*" schemaVersion="2014-06.2.4" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
<Role name="IS.Admin">
…
</Role>
<NetworkConfiguration>
<VirtualNetworkSite name="is-prod" />
<AddressAssignments>
<InstanceAddress roleName="IS.Admin">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
<ReservedIPs>
<ReservedIP name="is-admin-rip" />
</ReservedIPs>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>
私の更新は、予約済み IP の変更/削除/追加とは何の関係もありません。サービス構成を更新する方法に関するアイデアはありますか?