Deleting and recreating app service with same name

Arjun P A 0 Reputation points
2024-11-30T10:42:18.1866667+00:00

We have a doubt, we have moved an azure app service resource from our azure account subscription tenant to a different azure account subscription tenant, that is ok working fine no issues. Currently its deployed as local git, i need to change that to azure docker container registry. Can we change that without deleting app service and recreating it.

If there is no other ways and we should delete the app service will there be any issue for deleting and recreating with same name because we moved the resource to a different azure account. Please advise.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,000 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 27,410 Reputation points MVP
    2024-11-30T12:44:20.0866667+00:00

    You can change the deployment method of your Azure App Service from local Git to using an Azure Container Registry (ACR) without needing to delete and recreate the App Service.

    Steps to Change the Deployment Method

    1. Prepare Your Docker Container:
      • Build and push your Docker image to the Azure Container Registry (ACR) or any other container registry.
    2. Update App Service to Use Docker Deployment:
      • Go to the Azure portal, navigate to your App Service, and open the Deployment Center.
      • Select Container as the deployment source.
      • Configure the registry settings:
        • Azure Container Registry: Select the ACR resource.
        • Provide the image name and tag.
      • If using an external registry, provide the appropriate credentials.
    3. Enable Continuous Deployment (Optional):
      • If desired, enable continuous deployment to automatically update the app when the container image changes.
    4. Verify and Test:
      • Restart the App Service and ensure it is correctly pulling and running the container.

    If Deletion is Necessary If you need to delete and recreate the App Service (e.g., to clear deployment settings completely):

    1. Issues with Deleting and Recreating an App Service with the Same Name:
      • Name Unavailability: Once an App Service is deleted, the name may not be immediately available due to backend cleanup. It might take a few minutes to hours before you can reuse the same name.
      • DNS Propagation: If there are DNS records pointing to the old App Service, these may briefly resolve to a deleted resource.
    2. Cross-Tenant Consideration:
      • Moving the resource to another subscription or tenant does not affect your ability to reuse the name in the same Azure region, as long as the name becomes available after deletion.
    3. Best Practice:
      • Before deleting, ensure there is a backup or exported configuration of the App Service to easily recreate it.
      • Consider using Infrastructure as Code (e.g., ARM templates, Bicep, or Terraform) to quickly redeploy with the same configurations.

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    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.