教程:将 Web 和 API 应用提供给 Azure Stack 用户使用Tutorial: make web and API apps available to your Azure Stack users

Azure Stack 云管理员可以创建套餐,使用户(租户)能够创建 Azure Functions、Web 和 API 应用程序。As an Azure Stack cloud administrator, you can create offers that let your users (tenants) create Azure Functions and web, and API applications. 通过向用户提供这些基于云的按需应用程序的访问权限,可以节省用户的时间和资源。By giving your users access to these on-demand, cloud-based apps, you can save them time and resources.

若要设置此功能,需要:To set this up, you will:

  • 部署应用服务资源提供程序Deploy the App Service resource provider
  • 创建产品Create an offer
  • 测试产品/服务Test the offer

部署应用服务资源提供程序Deploy the App Service resource provider

  1. 准备 Azure Stack 开发工具包主机Prepare the Azure Stack Development Kit host. 这包括部署 SQL Server 资源提供程序(创建某些应用的先决条件)。This includes deploying the SQL Server resource provider, which is required for creating some apps.
  2. 下载安装程序和帮助器脚本Download the installer and helper scripts.
  3. 运行帮助器脚本以创建所需的证书Run the helper script to create required certificates.
  4. 安装应用服务资源提供程序(需要在数小时之后才能安装完资源提供程序并显示所有辅助角色)。Install the App Service resource provider (It will take a couple hours to install and for all the worker roles to appear.)
  5. 验证安装Validate the installation.

创建产品Create an offer

例如,可以创建一个产品/服务来让用户创建 DNN Web 内容管理系统。As an example, you can create an offer that lets users create DNN web content management systems. 这需要用到已通过安装 SQL Server 资源提供程序启用的 SQL Server 服务。It requires the SQL Server service which you already enabled by installing the SQL Server resource provider.

  1. 设置配额并将其命名为 AppServiceQuotaSet a quota and name it AppServiceQuota. 在“命名空间”字段中选择“Microsoft.Web”。Select Microsoft.Web for the Namespace field.

  2. 创建计划Create a plan. 将计划命名为 TestAppServicePlan,并依次选择“Microsoft.SQL”服务和“AppService 配额”配额。Name it TestAppServicePlan, select the Microsoft.SQL service and the AppService Quota quota.

    Note

    若要让用户创建其他应用,可能需要在计划中包含其他服务。To let users create other apps, other services might be required in the plan. 例如,Azure Functions 要求计划中必须包含 Microsoft.Storage 服务,而 Wordpress 则要求包含 Microsoft.MySQLFor example, Azure Functions requires the Microsoft.Storage service in the plan, while Wordpress requires Microsoft.MySQL.

  3. 创建套餐,将其命名为 TestAppServiceOffer,然后选择“TestAppServicePlan”计划。Create an offer, name it TestAppServiceOffer and select the TestAppServicePlan plan.

测试产品/服务Test the offer

部署应用服务资源提供程序并创建套餐后,可以用户身份登录并订阅该套餐,然后创建应用。Now that you've deployed the App Service resource provider and created an offer, you can sign in as a user, subscribe to the offer, and create an app.

本示例将创建一个 DNN 平台内容管理系统。For this example, we'll create a DNN Platform content management system. 先创建 SQL 数据库,然后再创建 DNN Web 应用。First, you create a SQL database and then the DNN web app.

订阅套餐Subscribe to the offer

  1. 以租户身份登录到 Azure Stack 门户 (https://portal.local.azurestack.external)。Sign in to the Azure Stack portal (https://portal.local.azurestack.external) as a tenant.
  2. 选择“获取订阅”,在“显示名称”下输入 TestAppServiceSubscription > 选择“选择套餐” > “TestAppServiceOffer” > “创建”。Select Get a subscription >, enter TestAppServiceSubscription under Display Name > Select an offer > TestAppServiceOffer > Create.

创建 SQL 数据库Create a SQL database

  1. 选择“+” > “数据 + 存储” > “SQL 数据库”。Select + > Data + Storage > SQL Database.

  2. 将以下字段除外的其他字段保留默认值:Keep the default values, except for the following fields:

    • 数据库名称:DNNdbDatabase Name: DNNdb
    • 最大大小(MB):100Max Size in MB: 100
    • 订阅:TestAppServiceOfferSubscription: TestAppServiceOffer
    • 资源组:DNN-RGResource Group: DNN-RG
  3. 选择“登录设置”,输入数据库的凭据,然后选择“确定”。Select Login Settings, enter credentials for the database, and then select OK. 本教程稍后要用到这些凭据。You'll use these credentials later in this tutorial.

  4. 在“SKU”下,选择为 SQL 宿主服务器创建的 SQL SKU,然后选择“确定”。Under SKU > select the SQL SKU that you created for the SQL Hosting Server > and then select OK.

  5. 选择“创建” 。Select Create.

创建 DNN 应用Create a DNN app

  1. 选择“+” > “全部查看” > “DNN 平台预览” > “创建”。Select + > See all > DNN Platform preview > Create.
  2. 在“应用名称”下输入 DNNapp,在“订阅”下选择“TestAppServiceOffer”。Enter DNNapp under App name and select TestAppServiceOffer under Subscription.
  3. 选择“配置所需的设置” > “新建”,输入应用服务计划的名称。Select Configure required settings > Create New > to enter an App Service plan name.
  4. 选择“定价层” > “F1 免费” > “选择” > “确定”。Select Pricing tier > F1 Free > Select > OK.
  5. 选择“数据库”并输入前面创建的 SQL 数据库的凭据。Select Database and enter the credentials for the SQL database you created earlier.
  6. 选择“创建” 。Select Create.