If-none-match header (*) was specified in the request but resource /providers/Microsoft.Network/networkInterfaces/nic- already exists.

Tummala Srikanth (ADMIN) 5 Reputation points
2025-08-05T08:34:05.5233333+00:00

When I am trying to create Private Endpoint resource for Resource Service Vault, I am ending with fowlloing exception.

{"code":"PreconditionFailed","target":"/subscriptions/##################/resourceGroups/RG-CCC-UAT-RSV-EUW/providers/Microsoft.Network/networkInterfaces/nic-pep-ccc-uat-rsv-euw","message":"Precondition failed.","details":[{"code":"PreconditionFailedResourceAlreadyExists","message":"If-none-match header (*) was specified in the request but resource /subscriptions/##################/resourceGroups/RG-CCC-UAT-RSV-EUW/providers/Microsoft.Network/networkInterfaces/nic-pep-ccc-uat-rsv-euw already exists."}]}

There is no NIC, eventhough deployment endup with above exception.

Any help would be appriciated.

Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
{count} vote

2 answers

Sort by: Most helpful
  1. Ganesh Patapati 8,765 Reputation points Microsoft External Staff Moderator
    2025-08-05T12:02:55.5666667+00:00

    Hello Tummala Srikanth (ADMIN)

    For further troubleshooting can you please share the following details:

    • Could you please share a screenshot of the error related to the issue?
    • Are you using the Azure portal or Azure PowerShell for this? Please try creating it with Azure PowerShell and let me know the results.
    • What exact steps did you take before encountering this error?

    1.First you need to delete the NIC what you have associated to the private endpoint VNET. After that you can try to create a new private endpoint.

    Use Azure CLI or PowerShell to confirm the existence of the expected NIC.

    az network nic show --name nic-pep-ccc-uat-rsv-euw --resource-group RG-CCC-UAT-RSV-EUW
    

    This command will let you know if the NIC actually exists or not?

    2.If you find that a NIC with the same name exists, consider using a different name for your new NIC to avoid the conflict.

    3.Sometimes, transient issues can cause such errors. After verifying the above steps, try to create the Private Endpoint again.


    I hope this has been helpful!

    If the above is unclear or you are unsure about something, please add a comment below.

    0 comments No comments

  2. Patricia Chin 0 Reputation points
    2025-08-08T22:41:19.4966667+00:00

    I have the following code that results in the same error as described in this topic:

    @description('Required. Name of the keyvault')
    @maxLength(24)
    param name string
    
    @onlyIfNotExists()
    resource keyVault 'Microsoft.KeyVault/vaults@2024-11-01' = {
      name: name
      location: location
      tags: tags
      properties: {
        tenantId: subscription().tenantId
        sku: {
          family: 'A'
          name: 'standard'
        }
        enableSoftDelete: true
        enableRbacAuthorization: true
        enabledForDeployment: false
        enabledForDiskEncryption: false
        enabledForTemplateDeployment: false
        publicNetworkAccess: 'Disabled'
        networkAcls: {
          bypass:  'AzureServices'
        }
      }
    }
    
    
    @onlyIfNotExists()
    resource privateEndpoint 'Microsoft.Network/privateEndpoints@2024-07-01' = {
      name: 'pe-${name}'
      location: location
      tags: tags
      properties: {
        subnet: {
          id: vNet::subnet.id
        }
        privateLinkServiceConnections: [
          {
            name: 'pe-${name}'
            properties: {
              privateLinkServiceId: keyVault.id
              groupIds: [
                'vault'
              ]
            }
          }
        ]
      }
    }
    

    I believe there may be a bug with the @onlyIfNotExists experimental feature decorator. The deployment fails when trying to create the privateEndpoint. I'm not sure if this is the correct area to post issues with experimental features, so please redirect me if necessary.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.