Forum Discussion

Simon_Geary's avatar
Simon_Geary
Brass Contributor
Sep 05, 2024

Cannot delete Azure Function as vnet no longer exists

I have an Azure Function I would like to delete.

 

The Function was integrated to a vnet that existed in a different resource group, and that resource group was deleted.

 

Now it is not possible to delete the Function with a 404 error, as the vnet it used has been deleted.

 

Any ideas how to force-delete the function in this scenario?

 

Thanks

  • kyazaferr's avatar
    kyazaferr
    Iron Contributor
    Remove VNet Integration using Azure CLI
    Sometimes, even if the VNet no longer exists, the VNet integration settings remain attached to the Function App.
    Use Azure CLI to remove the VNet integration manuall

    az webapp vnet-integration remove --name <function-app-name> --resource-group <resource-group-name>

    . Force Deletion using Azure CLI or PowerShell
    If the regular deletion methods are blocked, try forcing the deletion using Azure CLI or PowerShell:

    Azure CLI:

    az functionapp delete --name <function-app-name> --resource-group <resource-group-name>

    Use Azure Resource Explorer
    Navigate to Azure Resource Explorer and manually locate the Azure Function.
    You can try to remove the references to the VNet or delete the function from the JSON template directly in the portal.
    • Simon_Geary's avatar
      Simon_Geary
      Brass Contributor
      Unfortunately I have the opposite problem. The vnet itself has already been deleted. It's the app services that were using the deleted vnet I cannot now remove.

Resources