I've added a custom field to the Customer Addresses with the following UpgradeData:
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
/** @var CustomerSetup $customerSetup */
$customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
$params = [
'label' => 'House Number',
'type' => 'varchar',
'input' => 'text',
'required' => true,
'visible' => true,
'user_defined' => true,
'position' =>999,
'system' => 0,
];
$customerSetup->addAttribute('customer_address', 'house_number', $params);
$customAttribute = $customerSetup->getEavConfig()->getAttribute('customer_address', 'house_number');
$customAttribute->setData(
'used_in_forms',
['adminhtml_checkout', 'adminhtml_customer', 'adminhtml_customer_address', 'customer_address_edit', 'customer_register_address'],
);
$customAttribute->save();
}
The field properly displays when logging into the Adminhtml area and adding a new Addresses to a customer. However, the New Address form cannot be submitted, the following error appears:
"House Number" is a required value.
Here is a screenshot:
I do believe that it is clear that a value for House Number was submitted.
What else must I do to enable this field on this form, and on other forms such as the Checkout and user's own Account Information?

$customerSetup->addAttributeToSet()line, and made the other changes that you suggest such as the use ofAddressMetadataInterfaceinstead of the strings which they represent. However, the field still is not saved, and throws the error. Any other ideas? – dotancohen Dec 28 '22 at 14:22house_numbercustom customer address attribute into your database, you have to remove it from database, if you still use UpgradeData script, you have to increase setup_version inmodule.xmland run bin/magento setup:upgrade command. If you choose use Data Patch, you don't need to do anything with setup_version inmodule.xml. Let me know if you need help with that, I'll tell you how. – Tu Van Dec 28 '22 at 15:09$customerSetup->removeAttribute(AddressMetadataInterface::ENTITY_TYPE_ADDRESS, 'house_number')first. – dotancohen Dec 28 '22 at 15:11removeAttributefunction should remove your attribute. RunSELECT * FROMeav_attributeWHEREattribute_code= 'house_number'MySql command to check ifhouse_numberattribute was removed or not. If it does not show any records, that means the attribute was removed. Make your changes in UpgradeData or create a new Data Patch then runbin/magento setup:upgrade. P/S: I've tested the features after applying the code in my answer before sharing it with you. – Tu Van Dec 28 '22 at 15:24