Cannot remove certificate with thumbprint XXXX because it is used for hostname XXXX on web app XXXX

Jeroen Burgerhout 26 Reputation points MVP
2024-07-05T18:52:51.15+00:00

Hi all,

I want to remove an hidden resource, in this case a certificate. When I want to remove it, via the portal or via the Azure Cloud Shell, it can't be removed. Because this certificate is still "binded" to a web app, which is removed a long time ago.

PS /home/jeroen> remove-azresource -ResourceId "/subscriptions/{id}/resourceGroups/cat-rg-euw-prd-infra/providers/Microsoft.Web/certificates/{domain}-cat-rg-euw-prd-infra" -Force Remove-AzResource: {"Code":"Conflict","Message":"Cannot remove certificate with thumbprint {thumbprint} because it is used for hostname {hostname} on web app cat-rg-euw-prd-infra.","Target":null,"Details":[{"Message":"Cannot remove certificate with thumbprint {thumbprint} because it is used for hostname {hostname} on web app cat-rg-euw-prd-infra."},{"Code":"Conflict"},{"ErrorEntity":{"ExtendedCode":"04035","MessageTemplate":"Cannot remove certificate with thumbprint {0} because it is used for hostname {1} on web app {2}.","Parameters":["{thumbprint}",{hostname}","cat-rg-euw-prd-infra"],"Code":"Conflict","Message":"Cannot remove certificate with thumbprint {thumbprint} because it is used for hostname {hostname} on web app cat-rg-euw-prd-infra."}}],"Innererror":null} CorrelationId: 6583e9a3-effd-4d52-99db-98260751305c

Who can help me with this?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,911 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
968 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 21,766 Reputation points
    2024-07-09T11:50:38.6833333+00:00

    @Jeroen Burgerhout Could you go to azure resource portal https://resources.azure.com and navigate to subscriptions --> specific subscription --> providers --> Microsoft.Web --> certificates and see if it is here and i think you can delete it from here directly.

    0 comments No comments

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.