Articles in this section

WebApp Sample Request Template

This article contains full instructions for setting up a Marketplace offering creating WebApp and an optional App Service Plan. The wizard guides the requesting user through a series of business near questions that will decide what properties and permissions the created WebApp will have.

Watch this recording for a 6-minute quick walktrough of the template

Requirements

Except for having EvOps installed and an EvOps account configured, the following prerequisites need to be fulfilled before proceeding with the setup.

App Services

Since the template is using Functions for populating and validating wizard data and the offering creates a Web App and optionally Service Plan, App Services need to be installed in the target Azure Stack stamp. For more information about installing App Services on Azure Stack: App Service on Azure Stack Overview

Plans & Offer

It is of course crucial that tenants' subscriptions have Web Services offering to be able to provision Web Apps and App Service Plans.

Preparation

Creating Function App

The Function App should be created in a Subscription that is managed by the team that manages and operates EvOps.

Log in Azure Stack Portal (Tenant)

Click + Create a resource

Browse to Web + Mobile category and click Function App in Featured list

Provide an App name

Select a Subscription

Select an existing or create a new Resource Group

Select App Service Plan as Hosting Plan

Select an existing Service Plan or create a newNote: Shared pricing tiers can be used for basic scenarios, but for production and certification authentication support dedicated tier should be used

Select .NET as Runtime Stack

Leave default settings for Storage Account

Click Create

Verify that Function App has been created successfully before proceeding to next section

AD/AAD Groups for RBAC Roles

This request template showcases how to set RBAC permission on created resources. Prepare information about at least one group (Name and object ID) that you will be using in this sample.

EvOps Account Service Principal Permissions

EvOps Workflow runs in the context of the EvOps account service principal. Since the ARM template in this sample sets permissions on created WebApp, the service principal needs Owner role on the subscription.

EvOps account service principal name is created with a script as a prerequisite before you create your account. It is following the naming standard Azure Stack - EvOps - "Name of your EvOps account". When searching for the user, you need to type the entire name.

Important

If you do not set Owner permission, created requests will fail when running ARM deployment activity with the following error message: "Failed starting activity Failed to call endpoint, status code 'BadRequest' and message '{"Code":"Unknown error","Message":"{\"error\":{\"code\":\"InvalidTemplateDeployment\",\"message\":\"The template deployment failed with error: 'Authorization failed for template resource...."

Remote Source & Validation Functions

In this section, Functions will be created and configured in App Services hosted in Azure Stack, but there are no limitations to create and configure these in Azure App Services as long as EvOps RP has network connectivity to Azure.

Note

The sample functions only contain logic inside the function itself. It does not reach out and validate Web App Names etc. We have taken the decision that it is more important getting started easily, than adding this to the sample since it increases the complexity importing the template.

Add Remote Source For Generating WebApp Name

Create getWebAppName function

Browse to Function Apps

Expand function app created earlier

Click + symbol to create new Function

Click create your own custom function

Enable Experimental Language Support to enable PowerShell

Choose PowerShell in HTTP trigger area

Select PowerShell as Language, getWebAppName as Name and Function as Authorization level. Then click Create

Open just created function and replace all content of Run.ps1 with below code