title: Magento 2 - Get Customer Address Id through Shipping Address at Checkout Session
body: <p>I'm having trouble with getting customer address Id as it returns a null value.</p>
  <p>This is what I have tried:</p>
  <pre><code>$checkout = $this-&gt;_sessionCheckout-&gt;getQuote();
  if ($checkout) {
     $shippingAddress = $checkout-&gt;getShippingAddress();
     if ($shippingAddress) {
         $addressId = $shippingAddress-&gt;getCustomerAddressId();
         $this-&gt;_logger-&gt;log(100, print_r('address Id: ' . $addressId , true)); //Returns null 
         /** @var \Magento\Customer\Api\Data\AddressInterface $address */
         $address = $this-&gt;_addressRepository-&gt;getById($addressId);
         $address-&gt;setCity($city_name);
         $this-&gt;_addressRepository-&gt;save($address);
  }
  </code></pre>
  <p>I just need to get customer address Id in order to update the city. I don't know why it returns a null value.</p>
  <hr />
  <p>Edited Details:</p>
  <p>The below image shows the saved shipping addresses:</p>
  <p><a href="https://i.stack.imgur.com/9ZF0X.jpg" rel="nofollow noreferrer">shipping-addresses</a></p>
  <p>What I want to know is How to know the <strong>customer address id</strong> of each of those shipping addresses. So I can modify any details I want.</p>