5

I’m trying to install a diagnostic extension via API into an existing Azure cloud service. Cloud Service has a reserved IP assigned. I’m getting “A reserved IP cannot be added, removed or changed during deployment update or upgrade.” when doing so using ChangeConfigurationBySlot. Does anyone know the trick to get this to work? Is this a miss in the API or am I doing something wrong?

Here’s a relevant code snippet:

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);

Here is the relevant section from cloud service 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>

My update has nothing to do with changing/removing/adding Reserved IPs. Any ideas as to how to update the service config?

Igorek
  • 15,716
  • 3
  • 54
  • 92
  • 5
    Dear anonymous: thanks for the downvote, care to explain why? Question provides plenty of detail and I could not find a duplicate of previously asked question for this issue – Igorek Jul 07 '15 at 15:59
  • In the new configuration update, do you then assign the same reserved ip and subnet? The relevant section from the cloud service config, is that the update or the initial service config? – Peter Jan 15 '16 at 13:39
  • in the configuration update, the old config is re-applied, and it has the reference to reserved IP, as per XML shown in the question – Igorek Jan 15 '16 at 21:00

1 Answers1

0

Try deploying to staging and doing a vip swap. The reserved ips are sticky to the slot, so it shouldn't interfere with your IPs in prod.

tripdubroot
  • 1,143
  • 5
  • 13
  • Unfortunately, this is not an option. I'm just trying to change an existing deployment. This is a feature of our product, to enable diagnostics on an existing deployment. No access to customer's codebase to redeploy to staging – Igorek Jul 07 '15 at 16:44
  • You may want to have a look at DeploymentDiagnosticManager: https://msdn.microsoft.com/en-us/library/azure/microsoft.windowsazure.diagnostics.management.deploymentdiagnosticmanager.aspx – tripdubroot Jul 07 '15 at 17:11
  • 1
    @Devian DeploymentDiagnosticManager is deprecated since SDK 2.5. If possible, stay away from using this to make diagnostics changes via code. – Gaurav Mantri Jul 07 '15 at 17:16
  • @Devia Yeah, we use DeploymentDiagnosticManager when dealing with 2.4 or lower SDK deployments to instrument diagnostics. However, post SDK2.5 Diagnostic Extension installation is required – Igorek Jul 07 '15 at 17:17
  • I'd be curious if the REST API would return anything different? https://msdn.microsoft.com/en-us/library/azure/dn169558.aspx – tripdubroot Jul 07 '15 at 19:57
  • sorry for late reply. this API adds the extension into the Cloud Service, but in order to make it be used inside a deployment, ChangeDeployment needs to be called – Igorek Feb 28 '16 at 16:32