title: How to detach/dissociate public IP of VM through SDK
body: <p>I am looking for a way to dissociate public IP addresses from my nic that is associated with a VM that is part of a scale set. There is ways to do it through the Azure portal and CLI (<a href="https://docs.microsoft.com/en-us/azure/virtual-network/remove-public-ip-address-vm" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/virtual-network/remove-public-ip-address-vm</a>). My question is that is there a way to do it through azure python or ruby SDK?</p>
  
  <p>I have tried the<code>network_client.network_interfaces.create_or_update(GROUP_NAME, nic.name, nic_params)</code> approach. However, I am not quite sure what to set for the nic_params field. Existing document indicate that the field is of the format:        </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>        nic_params = {
              'location': LOCATION,
              'ip_configurations':[{
                  'name': ipconfig_name,
                  'public_ip_address':ip_address_object,
                  'subnet': {
                      'id': subnet_info.id
                  }
              }]
          }</code></pre>
  </div>
  </div>
  
  I tried to set <code>ip_configuration</code> to null, <code>public_ip_address</code> to null. Neither approach worked. </p>