How to provision Azure resources

APPLIES TO: Composer v2.x

This article describes how to provision Azure resources by IT administrators to satisfy the request submitted by users that do not have provisioning abilities.

Note

The information about generating an handoff request by users without provisioning abilities can be found in the Publish a bot to Azure article.

Prerequisites

Run the provisioning command

After you receive the resource provisioning request from your user, follow the steps described below.

  1. Download and unzip the provisioning helper scripts.

  2. Open a new command prompt and navigate to the newly create scripts folder. For example:

    cd C:\Users\UserName\Documents\provisionScripts
    
  3. Run the following command to install the dependencies. You must run this command every time you install a new version of the scripts.

    npm install
    
  4. Run the provisioning command shared by your requester to provision new Azure resources. The command structure is shown below. The provisioning process will take a few minutes to complete.

    node provisionComposer.js --subscriptionId=<YOUR AZURE SUBSCRIPTION ID> --name=<YOUR RESOURCE NAME> --appPassword=<APP PASSWORD> --environment=<NAME FOR ENVIRONMENT DEFAULT to dev> --location=<LOCATION> --createLuisResource=true --createLuisAuthoringResource=true --createCosmosDb=false --createStorage=false createAppInsights=true --CreateQnAResource=true
    
    Parameter Description Required
    subscriptionId Your Azure subscription ID. Yes
    name Azure resource name. Yes
    appPassword Azure resource password. It must be at least 16 characters long, contain at least 1 upper or lower case alphabetical character, and contain at least 1 special character. Yes
    environment Default to dev Optional
    location Azure resource group region. Default to westus. Optional
    tenantId ID of your tenant if required. If default value does not apply you get user was not found error.
    createLuisResource The LUIS prediction resource to create. Region is default to westus and cannot be changed. Default to true.
    createLuisAuthoringResource The LUIS authoring resource to create. Region is default to westus and cannot be changed. Default to true. Optional
    createQnAResource The QnA resource to create. Default to true. Optional
    createCosmosDB The CosmosDB resource to create. Default to true. Optional
    createStorage The BlobStorage resource to create. Default to true. Optional
    createAppInsights The AppInsights resource to create. Default to true. Optional
  5. As the Azure resources are being provisioned, you will see a spinning activity indicator for a few minutes. Once completed, a publishing profile in JSON format is displayed.

  6. Copy and save this profile. Then send it the user that made the provisioning request.

The process concludes when in Composer the user will publish the bot using the publishing profile received in the importing existing resources modality.

Share resource details

Once completed, a publishing profile in JSON format is displayed in the command line terminal.

  1. Copy and save this profile.
  2. Send it to the user that made the provisioning request.

The following is an example of the JSON file format.

{
    "name": "<NAME OF YOUR RESOURCE GROUP>",
    "environment": "<ENVIRONMENT>",
    "hostname": "<NAME OF THE HOST>",
    "luisResource": "<NAME OF YOUR LUIS RESOURCE>",
    "settings": {
        "applicationInsights": {
        "InstrumentationKey": "<SOME VALUE>"
        },
        "cosmosDb": {
        "cosmosDBEndpoint": "<SOME VALUE>",
        "authKey": "<SOME VALUE>",
        "databaseId": "botstate-db",
        "collectionId": "botstate-collection",
        "containerId": "botstate-container"
        },
        "blobStorage": {
        "connectionString": "<SOME VALUE>",
        "container": "transcripts"
        },
        "luis": {
        "endpointKey": "<SOME VALUE>",
        "authoringKey": "<SOME VALUE>",
        "region": "westus"
        },
        "qna": {
        "endpoint": "<SOME VALUE>",
        "subscriptionKey": "<SOME VALUE>"
        },
        "MicrosoftAppId": "<SOME VALUE>",
        "MicrosoftAppPassword": "<SOME VALUE>"
    }
}

Navigate to your Azure portal, you should be able to see the resources created like the following:

Resource Required/Optional Description
Application Registration Required Required registration allowing your bot to communicate with Azure services.
App Service Required Quickly build, deploy, and scale enterprise-grade web, mobile, and API apps running on any platform.
Azure Bot resource Required Build, connect and manage bots to interact with your users from your app or website to Cortana, Skype, Messenger and many other services.
Azure Cosmos DB Optional Azure cosmos is a multi-model database service backed up by comprehensive SLAs. Used for bot state retrieving.
Application Insights Optional Application performance, availability and usage information at your fingertips. Used for bot chatting data analyzing.
Azure Blob Storage Optional Scalable, durable cloud storage, backup and recovery solutions for any data, big or small. Used for bot transcripts logging.
LUIS authoring resource (Cognitive Services) Optional LUIS is an NLP service that enables you to understand human language in your own application. Used for Luis endpoint hitting.
LUIS prediction resource (Cognitive Services) Optional LUIS is an NLP service that enables you to understand human language in your own application. Used for Luis endpoint hitting.
QnA Maker resource (Cognitive Services) Optional Use QnA Maker to build a knowledge base by extracting questions and answers from your content, such as FAQs, documents, etc.

You should then securely share the output JSON with the requester. Once the requester receives the resource details, he or she can use these resources to import existing Azure resources and publish your bot.

Additional information