Loading...
Loading...
Create and manage Azure Bot resources using the Azure CLI. Covers the full lifecycle: identity creation, bot registration, channel configuration (Teams, Slack, Telegram, Direct Line, and more), and deployment to Azure App Service. ESPECIALLY for OpenClaw agents.
npx skill4agent add deepparser/skills azure-botaz bot# Check Azure CLI is installed and logged in
az account show --query "{subscription:name, tenantId:tenantId}" -o tableaz loginaz --version| Parameter | Description | Default |
|---|---|---|
| Resource name (4-42 chars, alphanumeric/hyphens/underscores) | — (required) |
| Azure resource group | |
| Azure region | |
| Identity type: | |
| Human-readable display name | Same as BOT_NAME |
| Messaging endpoint URL (https://...) | Can be set later |
| Pricing tier: | |
az group create \
--name "${RESOURCE_GROUP}" \
--location "${LOCATION}"# Create the app registration
az ad app create \
--display-name "${BOT_NAME}" \
--sign-in-audience "AzureADMyOrg"
# Note the appId from the output, then generate a password
az ad app credential reset --id "<appId>"APP_IDappIdaz ad app createAPP_PASSWORDpasswordaz ad app credential resetTENANT_IDaz account show --query tenantId -o tsv# Create the managed identity
az identity create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}-identity"CLIENT_IDclientIdTENANT_IDaz account show --query tenantId -o tsvMSI_RESOURCE_IDidaz bot create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--app-type "SingleTenant" \
--appid "${APP_ID}" \
--tenant-id "${TENANT_ID}" \
--display-name "${DISPLAY_NAME}" \
--endpoint "${ENDPOINT}" \
--sku "${SKU}"az bot create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--app-type "UserAssignedMSI" \
--appid "${CLIENT_ID}" \
--tenant-id "${TENANT_ID}" \
--msi-resource-id "${MSI_RESOURCE_ID}" \
--display-name "${DISPLAY_NAME}" \
--endpoint "${ENDPOINT}" \
--sku "${SKU}"az bot show \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
-o tableaz bot msteams create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}"# Requires: Slack App client ID, client secret, verification token, and landing page URL
az bot slack create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--client-id "<slack-client-id>" \
--client-secret "<slack-client-secret>" \
--verification-token "<slack-verification-token>" \
--landing-page-url "<landing-page-url>"# Requires: Telegram bot token from @BotFather
az bot telegram create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--access-token "<telegram-bot-token>"az bot directline create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}"az bot directline show \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--query "properties.properties.sites[0].key" -o tsvaz bot facebook create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--appid "<facebook-app-id>" \
--app-secret "<facebook-app-secret>" \
--page-id "<facebook-page-id>" \
--access-token "<facebook-page-access-token>"az bot email create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--email-address "<email@outlook.com>" \
--password "<email-password>"az bot webchat show \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--query "properties.properties.sites[0].key" -o tsv# Teams
az bot msteams show --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
# Slack
az bot slack show --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
# Telegram
az bot telegram show --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
# Direct Line
az bot directline show --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"az bot update \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--endpoint "https://your-bot.azurewebsites.net/api/messages"az bot update \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--display-name "My Bot Display Name" \
--description "Bot description here"az bot update \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--sku S1# Create App Service Plan
az appservice plan create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}-plan" \
--sku B1 \
--is-linux
# Create Web App (Python example)
az webapp create \
--resource-group "${RESOURCE_GROUP}" \
--plan "${BOT_NAME}-plan" \
--name "${BOT_NAME}-app" \
--runtime "PYTHON:3.11"
# Or for Node.js
az webapp create \
--resource-group "${RESOURCE_GROUP}" \
--plan "${BOT_NAME}-plan" \
--name "${BOT_NAME}-app" \
--runtime "NODE:20-lts"az webapp config appsettings set \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}-app" \
--settings \
MicrosoftAppType=SingleTenant \
MicrosoftAppId="${APP_ID}" \
MicrosoftAppPassword="${APP_PASSWORD}" \
MicrosoftAppTenantId="${TENANT_ID}"az webapp config appsettings set \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}-app" \
--settings \
MicrosoftAppType=UserAssignedMSI \
MicrosoftAppId="${CLIENT_ID}" \
MicrosoftAppPassword="" \
MicrosoftAppTenantId="${TENANT_ID}"# Prepare deployment files (run from bot project root)
az bot prepare-deploy --lang <Csharp|Javascript|Typescript> --code-dir "."
# Deploy via zip
zip -r bot.zip . -x "*.git*" "node_modules/*" "__pycache__/*" ".env"
az webapp deploy \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}-app" \
--src-path bot.zip \
--type zipaz bot update \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--endpoint "https://${BOT_NAME}-app.azurewebsites.net/api/messages"# List available OAuth providers
az bot authsetting list-providers \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}"
# Create an OAuth connection
az bot authsetting create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--setting-name "<connection-name>" \
--provider-scope-string "<scopes>" \
--client-id "<oauth-client-id>" \
--client-secret "<oauth-client-secret>" \
--service "Aadv2"config.pyimport os
class DefaultConfig:
PORT = 3978
APP_TYPE = os.environ.get("MicrosoftAppType", "SingleTenant")
APP_ID = os.environ.get("MicrosoftAppId", "")
APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "")
APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "").envMicrosoftAppType=SingleTenant
MicrosoftAppId=<your-app-id>
MicrosoftAppPassword=<your-app-password>
MicrosoftAppTenantId=<your-tenant-id>appsettings.json{
"MicrosoftAppType": "SingleTenant",
"MicrosoftAppId": "<your-app-id>",
"MicrosoftAppPassword": "<your-app-password>",
"MicrosoftAppTenantId": "<your-tenant-id>"
}# List all bots in a resource group
az bot list --resource-group "${RESOURCE_GROUP}" -o table
# Show bot details
az bot show --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
# Delete a bot
az bot delete --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
# Delete a channel
az bot msteams delete --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
az bot slack delete --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
az bot telegram delete --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
az bot directline delete --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}"
# Generate a new app password
az ad app credential reset --id "${APP_ID}"https://az webapp log tail --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}-app"MicrosoftAppId or MicrosoftAppPassword is not correctaz ad app credential resetEndpoint must start with httpsaz bot update --endpoint "https://..."Bot name already taken