Skip to content
Latchkey

Terraform AzureRM provider "PublicIPCountLimitReached" in CI

Azure returned PublicIPCountLimitReached: the subscription already holds the maximum number of public IP addresses allowed in the Region, so the new IP cannot be created until you raise the quota or free some.

What this error means

terraform apply fails with Code="PublicIPCountLimitReached" Message="Cannot create more than N public IP addresses for this subscription in this region."

Terraform
Error: creating Public IP: network.PublicIPAddressesClient#CreateOrUpdate:
... Code="PublicIPCountLimitReached" Message="Cannot create more than 20
public IP addresses for this subscription in this region."

Common causes

The Region public IP quota is exhausted

The subscription already has as many public IPs as the Region allows, so any new one is rejected.

Leaked IPs from failed or partial runs

Earlier failed applies left public IPs allocated, consuming the quota without being in use.

How to fix it

Request a quota increase

  1. Check current usage against the Region limit.
  2. Raise the public IP quota for the subscription and Region.
  3. Re-run apply once the new limit is granted.
Terminal
az network list-usages --location eastus \
  --query "[?contains(name.value, 'PublicIPAddresses')]"

Free unused public IPs

Delete leaked or unused public IP addresses to reclaim quota, especially ones left by failed runs.

How to prevent it

  • Track public IP usage against the Region limit.
  • Clean up IPs from failed applies so quota is not leaked.
  • Request quota ahead of provisioning many IPs.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →