Skip to main content

Publish the Bot Microservice to Azure

This article explains how to publish the EmpowerID Bot microservice to an Azure App Service instance. This step finalizes the bot deployment by uploading the ZIP package and enabling the runtime for RESTful endpoint interaction.

Prerequisites

Before publishing the EmpowerID Bot microservice, ensure the following prerequisites are met:

  • ✅ You have completed the Setting up the Microsoft App ID process.
  • ✅ You have obtained the EmpowerID Bot microservice ZIP package.
    info

    If you do not have the ZIP file for the bot microservice, please contact EmpowerID Support to obtain it.

  • ✅ You have downloaded the App Service Publisher Profile Settings file (.PublishSettings) from Azure for the target App Service.
  • ✅ You have administrative permissions to run PowerShell scripts on your system.

Overview

Publishing the EmpowerID Bot microservice:

  • Deploys the compiled bot runtime to an Azure Web App
  • Exposes RESTful endpoints required for bot communication
  • Enables integration with Microsoft Teams

PowerShell Deployment Script

  1. Create the deployment script by copying the following PowerShell code into your preferred text editor and saving it as zipdeploy_appService.ps1.

    param(
    $pubProfileFilePath
    ,$zipFilePath
    )
    $ErrorActionPreference = "Stop"
    $pubProfile = [xml](gc $pubProfileFilePath)
    $zipPubProfile = $pubProfile.publishData.publishProfile | where { $_.publishMethod -eq "zipdeploy" }
    $userAgent = "powershell/1.0"
    $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $zipPubProfile.userName, $zipPubProfile.userPWD)))
    $zipdeployUrl = "https://$($zipPubProfile.publishUrl)/api/zipdeploy"
    $deploymentsUrl = "https://$($zipPubProfile.publishUrl)/api/deployments"
    Invoke-RestMethod -Uri $zipdeployUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -UserAgent $userAgent -Method Post -InFile $zipFilePath
    Invoke-RestMethod -Uri $deploymentsUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -UserAgent $userAgent -Method Get

    ⚠️ Do not modify the structure of this script. It performs authenticated deployment using Azure’s zipdeploy publishing method and retrieves deployment status from the service endpoint.

Publishing Steps

  1. Open an elevated PowerShell session (Run as Administrator).

  2. Execute the deployment script:

    • Navigate to the directory containing the zipdeploy_appService.ps1 script.
    • Run the script, specifying the following parameters:
      • pubProfileFilePath: Full path to the Azure App Service Publish Settings file.
      • zipFilePath: Full path to the EmpowerID Bot microservice ZIP file.

    Example execution:

    .\zipdeploy_appService.ps1 -pubProfileFilePath "C:\Path\To\AppService.PublishSettings" -zipFilePath "C:\Path\To\EmpowerIDBot.zip"

    PowerShell Execution Command

  3. Verify deployment output: Upon successful execution, PowerShell returns deployment information from Azure, including status, timestamps, and deployment ID. Deployment Output Example

Post-Deployment

After successful publication of the bot microservice:

✅ The EmpowerID Bot microservice is now active within your Azure App Service environment.

➡️ Proceed to configure channels for user access through Microsoft Teams and Direct Line.