从 Azure Stack Hub 删除 Azure 应用服务Remove Azure App Service from Azure Stack Hub

本文介绍如何从 Azure Stack Hub 删除 Azure 应用服务资源提供程序和相关组件。This article shows how to remove the Azure App Service resource provider and related components, from Azure Stack Hub.

删除资源提供程序Remove resource provider

重要

此操作会删除所有租户资源、从所有计划中删除服务和配额,以及彻底删除 Azure 应用程序服务资源提供程序。This operation will remove all tenant resources, remove the service and quotas from all plans and remove the Azure App Service resource provider in it's entirety. 如果已部署应用服务高可用文件服务器和 SQL Server 快速启动模板,则这些资源也会被删除,因为它们与 Azure Stack Hub 上的 Azure 应用服务部署在同一资源组中。If you have deployed the App Service Highly Available File Server and SQL Server Quickstart template, these resources will also be removed as they are deployed in the same resource group as Azure App Service on Azure Stack Hub.

若要从 Azure Stack Hub 删除 Azure 应用服务,请执行下面的这个步骤:To remove Azure App Service from Azure Stack Hub, follow this one step:

  1. 删除用于保存 Azure Stack Hub 上的 Azure应用服务资源的资源组(例如 AppService.local)Delete the Resource Group that holds the Azure App Service on Azure Stack Hub Resources, for example AppService.local

删除数据库和文件共享内容Remove databases and file share content

仅当 SQL Server 和/或文件服务器部署在缩放单元之外或其他资源组中时,才需要执行此部分步骤,否则请继续执行下一部分。You only need to follow this section if your SQL Server and/or File Server is deployed off-stamp or in a different resource group, otherwise continue to the next section.

删除数据库和登录名Remove databases and logins

  1. 如果使用 SQL Server Always On,请从可用性组中删除 AppService_Hosting 和 AppService_Metering 数据库:If using SQL Server Always On, remove the AppService_Hosting and AppService_Metering databases from the Availability Group:

  2. 执行以下 SQL 脚本以删除数据库和登录名Execute the following SQL Script to remove the databases and logins

    --******************************************************************
    /*
    Script to clean up App Service objects (databases and logins).
    */
    USE [master]
    GO
    
    DROP DATABASE [appservice_hosting]
    GO
    
    DROP DATABASE [appservice_metering]
    GO
    
    DECLARE @sql NVARCHAR(MAX) = N'';    
    
    SELECT @sql += '
    DROP LOGIN [' + name + '];' 
    from master.sys.sql_logins
    WHERE name LIKE  '%_hosting_%' OR 
    name LIKE  '%_metering_%' OR
    name LIKE  '%WebWorker_%';
    
    PRINT @sql;
    EXEC sp_executesql @sql;
    PRINT 'Completed';
    
    --******************************************************************
    

从文件服务器中删除应用程序文件内容Remove the application file content from the file server

  1. 从文件服务器中删除文件共享内容。Remove the content fileshare from your file server.

后续步骤Next steps

若要重新进行安装,请返回到在 Azure Stack Hub 上部署应用服务的先决条件一文。To reinstall, return to the Prerequisites for deploying App Service on Azure Stack Hub article.