New-AzPrivateDnsVirtualNetworkLink : Long running operation failed with status '

This worked at one point, but now I can’t get it to work. I have retried over a few days:
New-AzPrivateDnsVirtualNetworkLink : Long running operation failed with status ‘Failed’. Additional Info:‘Virtual network resource identity
‘/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork’ already in use. This is possible
in case the virtual network was re-created. Please delete all the stale virtual network links and try again.’
At C:\vsts\IA\analyticsholdings\Infrastructure-as-Code\execution\network\scripts\New-PrivateDNSZone.ps1:116 char:60

  • … xpression { New-AzPrivateDnsVirtualNetworkLink @privDnsVNLkplat } -PS …
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : CloseError: (:slight_smile: [New-AzPrivateDnsVirtualNetworkLink], CloudException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.PrivateDns.VirtualNetworkLinks.NewAzurePrivateDnsVirtualNetworkLink

[pre] $privDnsVNLkplat = @{
ZoneName = $PrivateDnsZone.Name
ResourceGroupName = $PrivateDnsZone.ResourceGroupName
Name = $Link
VirtualNetworkId = $($VirtualNetwork.Id)
EnableRegistration = $true
}

Trace-Command -Name ParameterBinding -Expression { New-AzPrivateDnsVirtualNetworkLink @privDnsVNLkplat } -PSHost
[/pre]
.\New-PrivateDNSZone.ps1
VERBOSE: Connection HDISolutions-NonMedical-QA (99214468-8f87-4136-b630-87706c64f494) - 52f6a838-57ec-42e1-bf6b-2e0e99eff20e established.
VERBOSE: Loading module from path ‘C:\Program Files\WindowsPowerShell\Modules\Az.PrivateDns\0.1.1\Az.PrivateDns.psd1’.
VERBOSE: Importing cmdlet ‘Add-AzPrivateDnsRecordConfig’.
VERBOSE: Importing cmdlet ‘Get-AzPrivateDnsRecordSet’.
VERBOSE: Importing cmdlet ‘Get-AzPrivateDnsVirtualNetworkLink’.
VERBOSE: Importing cmdlet ‘Get-AzPrivateDnsZone’.
VERBOSE: Importing cmdlet ‘New-AzPrivateDnsRecordConfig’.
VERBOSE: Importing cmdlet ‘New-AzPrivateDnsRecordSet’.
VERBOSE: Importing cmdlet ‘New-AzPrivateDnsVirtualNetworkLink’.
VERBOSE: Importing cmdlet ‘New-AzPrivateDnsZone’.
VERBOSE: Importing cmdlet ‘Remove-AzPrivateDnsRecordConfig’.
VERBOSE: Importing cmdlet ‘Remove-AzPrivateDnsRecordSet’.
VERBOSE: Importing cmdlet ‘Remove-AzPrivateDnsVirtualNetworkLink’.
VERBOSE: Importing cmdlet ‘Remove-AzPrivateDnsZone’.
VERBOSE: Importing cmdlet ‘Set-AzPrivateDnsRecordSet’.
VERBOSE: Importing cmdlet ‘Set-AzPrivateDnsVirtualNetworkLink’.
VERBOSE: Importing cmdlet ‘Set-AzPrivateDnsZone’.
VERBOSE: qa-vnetwork
VERBOSE: Catch, creating Network Link qa-link
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [New-AzPrivateDnsVirtualNetworkLink]
DEBUG: ParameterBinding Information: 0 : BIND arg [True] to parameter [EnableRegistration]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.Management.Automation.SwitchParameter]
DEBUG: ParameterBinding Information: 0 : Trying to convert argument value from System.Boolean to System.Management.Automation.SwitchParameter
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [System.Management.Automation.ValidateNotNullOrEmptyAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [True] to param [EnableRegistration] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND arg
[/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork] to parameter [VirtualNetworkId]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [System.Management.Automation.ValidateNotNullOrEmptyAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg
[/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork] to param [VirtualNetworkId]
SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND arg [qa-link] to parameter [Name]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [System.Management.Automation.ValidateNotNullOrEmptyAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [qa-link] to param [Name] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND arg [qa.hdi.local] to parameter [ZoneName]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [System.Management.Automation.ValidateNotNullOrEmptyAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [qa.hdi.local] to param [ZoneName] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND arg [qa-network-rg] to parameter [ResourceGroupName]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [System.Management.Automation.ValidateNotNullOrEmptyAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [qa-network-rg] to param [ResourceGroupName] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [New-AzPrivateDnsVirtualNetworkLink]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [New-AzPrivateDnsVirtualNetworkLink]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : BIND PIPELINE object to parameters: [Out-Default]
DEBUG: ParameterBinding Information: 0 : PIPELINE object TYPE = [System.Management.Automation.ErrorRecord]
DEBUG: ParameterBinding Information: 0 : RESTORING pipeline parameter’s original values
DEBUG: ParameterBinding Information: 0 : Parameter [InputObject] PIPELINE INPUT ValueFromPipeline NO COERCION
DEBUG: ParameterBinding Information: 0 : BIND arg [Long running operation failed with status ‘Failed’. Additional Info:‘Virtual network resource identity
‘/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork’ already in use. This is possible
in case the virtual network was re-created. Please delete all the stale virtual network links and try again.’] to parameter [InputObject]
DEBUG: ParameterBinding Information: 0 : BIND arg [Long running operation failed with status ‘Failed’. Additional Info:‘Virtual network resource identity
‘/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork’ already in use. This is possible
in case the virtual network was re-created. Please delete all the stale virtual network links and try again.’] to param [InputObject] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Out-Default]
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Out-LineOutput]
DEBUG: ParameterBinding Information: 0 : BIND arg [Microsoft.PowerShell.Commands.Internal.Format.ConsoleLineOutput] to parameter [LineOutput]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.Object]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : BIND arg [Microsoft.PowerShell.Commands.Internal.Format.ConsoleLineOutput] to param [LineOutput] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Out-LineOutput]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Out-LineOutput]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : BIND PIPELINE object to parameters: [Out-LineOutput]
DEBUG: ParameterBinding Information: 0 : PIPELINE object TYPE = [System.Management.Automation.ErrorRecord]
DEBUG: ParameterBinding Information: 0 : RESTORING pipeline parameter’s original values
DEBUG: ParameterBinding Information: 0 : Parameter [InputObject] PIPELINE INPUT ValueFromPipeline NO COERCION
DEBUG: ParameterBinding Information: 0 : BIND arg [Long running operation failed with status ‘Failed’. Additional Info:‘Virtual network resource identity
‘/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork’ already in use. This is possible
in case the virtual network was re-created. Please delete all the stale virtual network links and try again.’] to parameter [InputObject]
DEBUG: ParameterBinding Information: 0 : BIND arg [Long running operation failed with status ‘Failed’. Additional Info:‘Virtual network resource identity
‘/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork’ already in use. This is possible
in case the virtual network was re-created. Please delete all the stale virtual network links and try again.’] to param [InputObject] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [out-lineoutput]
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Format-Default]
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Format-Default]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Format-Default]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : BIND PIPELINE object to parameters: [Format-Default]
DEBUG: ParameterBinding Information: 0 : PIPELINE object TYPE = [System.Management.Automation.ErrorRecord]
DEBUG: ParameterBinding Information: 0 : RESTORING pipeline parameter’s original values
DEBUG: ParameterBinding Information: 0 : Parameter [InputObject] PIPELINE INPUT ValueFromPipeline NO COERCION
DEBUG: ParameterBinding Information: 0 : BIND arg [Long running operation failed with status ‘Failed’. Additional Info:‘Virtual network resource identity
‘/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork’ already in use. This is possible
in case the virtual network was re-created. Please delete all the stale virtual network links and try again.’] to parameter [InputObject]
DEBUG: ParameterBinding Information: 0 : BIND arg [Long running operation failed with status ‘Failed’. Additional Info:‘Virtual network resource identity
‘/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork’ already in use. This is possible
in case the virtual network was re-created. Please delete all the stale virtual network links and try again.’] to param [InputObject] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [format-default]
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : BIND arg [1] to parameter [Version]
DEBUG: ParameterBinding Information: 0 : Executing DATA GENERATION metadata:
[Microsoft.PowerShell.Commands.SetStrictModeCommand+ArgumentToVersionTransformationAttribute]
DEBUG: ParameterBinding Information: 0 : result returned from DATA GENERATION: 1.0
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.Version]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [Microsoft.PowerShell.Commands.SetStrictModeCommand+ValidateVersionAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [1.0] to param [Version] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : CALLING EndProcessing
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : BIND arg [1] to parameter [Version]
DEBUG: ParameterBinding Information: 0 : Executing DATA GENERATION metadata:
[Microsoft.PowerShell.Commands.SetStrictModeCommand+ArgumentToVersionTransformationAttribute]
DEBUG: ParameterBinding Information: 0 : result returned from DATA GENERATION: 1.0
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.Version]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [Microsoft.PowerShell.Commands.SetStrictModeCommand+ValidateVersionAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [1.0] to param [Version] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : CALLING EndProcessing
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : BIND arg [1] to parameter [Version]
DEBUG: ParameterBinding Information: 0 : Executing DATA GENERATION metadata:
[Microsoft.PowerShell.Commands.SetStrictModeCommand+ArgumentToVersionTransformationAttribute]
DEBUG: ParameterBinding Information: 0 : result returned from DATA GENERATION: 1.0
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.Version]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [Microsoft.PowerShell.Commands.SetStrictModeCommand+ValidateVersionAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [1.0] to param [Version] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : CALLING EndProcessing
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : BIND arg [1] to parameter [Version]
DEBUG: ParameterBinding Information: 0 : Executing DATA GENERATION metadata:
[Microsoft.PowerShell.Commands.SetStrictModeCommand+ArgumentToVersionTransformationAttribute]
DEBUG: ParameterBinding Information: 0 : result returned from DATA GENERATION: 1.0
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.Version]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [Microsoft.PowerShell.Commands.SetStrictModeCommand+ValidateVersionAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [1.0] to param [Version] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Set-StrictMode]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : CALLING EndProcessing
New-AzPrivateDnsVirtualNetworkLink : Long running operation failed with status ‘Failed’. Additional Info:‘Virtual network resource identity
‘/subscriptions/99214468-8f87-4136-b630-87706c64f494/resourceGroups/qa-network-rg/providers/Microsoft.Network/virtualNetworks/qa-vnetwork’ already in use. This is possible
in case the virtual network was re-created. Please delete all the stale virtual network links and try again.’
At C:\vsts\IA\analyticsholdings\Infrastructure-as-Code\execution\network\scripts\New-PrivateDNSZone.ps1:116 char:60

  • … xpression { New-AzPrivateDnsVirtualNetworkLink @privDnsVNLkplat } -PS …
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : CloseError: (:slight_smile: [New-AzPrivateDnsVirtualNetworkLink], CloudException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.PrivateDns.VirtualNetworkLinks.NewAzurePrivateDnsVirtualNetworkLink

DEBUG: ParameterBinding Information: 0 : CALLING EndProcessing

It turns out that if other networks are linked to this network, this error occurred. When I took that link away, it works fine.