Loading...
Loading...
Compare original and translation side by side
az botaz botundefinedundefined
If not logged in, run `az login` first.
Required tools:
- Azure CLI 2.39.0+ (`az --version`)
- An active Azure subscription
如果未登录,请先运行`az login`。
所需工具:
- Azure CLI 2.39.0及以上版本(可通过`az --version`查看)
- 有效的Azure订阅| 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: | |
| 参数 | 描述 | 默认值 |
|---|---|---|
| 资源名称(4-42个字符,支持字母/数字/连字符/下划线) | — (必填) |
| Azure资源组 | |
| Azure区域 | |
| 身份类型: | |
| 可读性强的展示名称 | 与BOT_NAME相同 |
| 消息端点URL(需以https://开头) | 可后续设置 |
| 定价层: | |
az group create \
--name "${RESOURCE_GROUP}" \
--location "${LOCATION}"az group create \
--name "${RESOURCE_GROUP}" \
--location "${LOCATION}"undefinedundefined
Record these values:
- `APP_ID` — the `appId` from `az ad app create` output
- `APP_PASSWORD` — the `password` from `az ad app credential reset` output
- `TENANT_ID` — from `az account show --query tenantId -o tsv`
**Option B: User-Assigned Managed Identity**
```bash
记录以下值:
- `APP_ID` — `az ad app create`输出中的`appId`
- `APP_PASSWORD` — `az ad app credential reset`输出中的`password`
- `TENANT_ID` — 可通过`az account show --query tenantId -o tsv`获取
**选项B:用户分配的托管身份**
```bash
Record:
- `CLIENT_ID` — the `clientId` from output
- `TENANT_ID` — from `az account show --query tenantId -o tsv`
- `MSI_RESOURCE_ID` — the `id` from output (full ARM resource ID)
记录以下值:
- `CLIENT_ID` — 输出中的`clientId`
- `TENANT_ID` — 可通过`az account show --query tenantId -o tsv`获取
- `MSI_RESOURCE_ID` — 输出中的`id`(完整ARM资源ID)az 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 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 show \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
-o tableaz bot msteams create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}"az bot msteams create \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}"undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedaz 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 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 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 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 tsvaz bot webchat show \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--query "properties.properties.sites[0].key" -o tsvundefinedundefinedundefinedundefinedaz 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}" \
--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}" \
--display-name "My Bot Display Name" \
--description "Bot description here"az bot update \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--sku S1az bot update \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--sku S1undefinedundefinedundefinedundefinedaz 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}"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}"undefinedundefinedundefinedundefinedaz bot update \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--endpoint "https://${BOT_NAME}-app.azurewebsites.net/api/messages"az bot update \
--resource-group "${RESOURCE_GROUP}" \
--name "${BOT_NAME}" \
--endpoint "https://${BOT_NAME}-app.azurewebsites.net/api/messages"undefinedundefinedundefinedundefinedconfig.pyconfig.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", "")import 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", "").env.envMicrosoftAppType=SingleTenant
MicrosoftAppId=<your-app-id>
MicrosoftAppPassword=<your-app-password>
MicrosoftAppTenantId=<your-tenant-id>MicrosoftAppType=SingleTenant
MicrosoftAppId=<your-app-id>
MicrosoftAppPassword=<your-app-password>
MicrosoftAppTenantId=<your-tenant-id>appsettings.jsonappsettings.json{
"MicrosoftAppType": "SingleTenant",
"MicrosoftAppId": "<your-app-id>",
"MicrosoftAppPassword": "<your-app-password>",
"MicrosoftAppTenantId": "<your-tenant-id>"
}{
"MicrosoftAppType": "SingleTenant",
"MicrosoftAppId": "<your-app-id>",
"MicrosoftAppPassword": "<your-app-password>",
"MicrosoftAppTenantId": "<your-tenant-id>"
}undefinedundefinedundefinedundefinedhttps://az webapp log tail --resource-group "${RESOURCE_GROUP}" --name "${BOT_NAME}-app"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 takenMicrosoftAppId or MicrosoftAppPassword is not correctaz ad app credential resetEndpoint must start with httpsaz bot update --endpoint "https://..."Bot name already taken