title: how to update azure vm firewall inbound port rules using python
body: <p><a href="https://i.stack.imgur.com/GS2g8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GS2g8.png" alt="enter image description here"></a>I want to bind/update/white listing my IP address in inbound port rules using python(automate).</p>
  
  <p>I went through this <a href="https://github.com/Azure-Samples/network-python-manage-loadbalancer/blob/master/example.py" rel="nofollow noreferrer">url</a>! and what 
  I understood  </p>
  
  <pre class="lang-py prettyprint-override"><code>credentials = ServicePrincipalCredentials(
          client_id=os.environ['AZURE_CLIENT_ID'],
          secret=os.environ['AZURE_CLIENT_SECRET'],
          tenant=os.environ['AZURE_TENANT_ID']
      )
      resource_client = ResourceManagementClient(credentials, subscription_id)
      compute_client = ComputeManagementClient(credentials, subscription_id)
      storage_client = StorageManagementClient(credentials, subscription_id)
      network_client = NetworkManagementClient(credentials, subscription_id)
  
  
  # Create VNet
      print('Create Vnet')
      async_vnet_creation = network_client.virtual_networks.create_or_update(
          GROUP_NAME,
          VNET_NAME,
          {
              'location': LOCATION,
              'address_space': {
                  'address_prefixes': ['10.0.0.0/16']
              }
          }
      )
      async_vnet_creation.wait()
  
      # Create Subnet
      async_subnet_creation = network_client.subnets.create_or_update(
          GROUP_NAME,
          VNET_NAME,
          SUBNET_NAME,
          {'address_prefix': '10.0.0.0/24'}
      )
      subnet_info = async_subnet_creation.result()
  
      # Creating NIC
      print('Creating NetworkInterface 1')
  
      back_end_address_pool_id = lb_info.backend_address_pools[0].id
  
      inbound_nat_rule_1_id = lb_info.inbound_nat_rules[0].id
      async_nic1_creation = network_client.network_interfaces.create_or_update(
          GROUP_NAME,
          VMS_INFO[1]['nic_name'],
          create_nic_parameters(
              subnet_info.id, back_end_address_pool_id, inbound_nat_rule_1_id)
      )
  
      inbound_nat_rule_2_id = lb_info.inbound_nat_rules[1].id
      print('Creating NetworkInterface 2')
      async_nic2_creation = network_client.network_interfaces.create_or_update(
          GROUP_NAME,
          VMS_INFO[2]['nic_name'],
          create_nic_parameters(
              subnet_info.id, back_end_address_pool_id, inbound_nat_rule_2_id)
      )
  
      nic1_info = async_nic1_creation.result()
      nic2_info = async_nic2_creation.result()
  
  </code></pre>
  
  <p>But I didn't find a place to add ip which I want to whitelisting.
  please help on this 
  or please tell how to whitelist my IP using python azure SDK ?</p>