Skip to content

Commit fe1a805

Browse files
Merge pull request #3209 from singhvikra-micro/main
Enhanced documentation for Azure Bot Service in the China Mooncake (#1)
2 parents 00ab73a + 70145c0 commit fe1a805

File tree

4 files changed

+164
-2
lines changed

4 files changed

+164
-2
lines changed

articles/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@
205205
href: provision-azure-bot.md
206206
- name: Configure an Azure Government bot
207207
href: how-to-deploy-gov-cloud-high.md
208+
- name: Configure a bot in Microsoft Azure operated by 21Vianet
209+
href: how-to-deploy-china-cloud.md
208210
- name: Set up continuous deployment
209211
displayName: Set up continuous integration and delivery, Set up CI/CD, Set up CICD
210212
href: bot-service-build-continuous-deployment.md

articles/channel-connect-teams.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ You can configure your bot to communicate with people via Microsoft Teams. This
3939
>
4040
> - The **Calling** tab supports the Teams calling feature. For more information, see [Register calls and meetings bot for Microsoft Teams](/microsoftteams/platform/bots/calls-and-meetings/registering-calling-bot).
4141
> - The **Publish** tab contains information about how to publish your Teams app to the Teams Store.
42+
> - The **Microsoft Azure operated by 21Vianet** does not support the **Get bot embed code** feature. To test the Teams channel, create the Teams app and deploy it using the steps mentioned below.
4243
4344
## Test your bot in Teams
4445

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
title: Deploy Bots to Microsoft Azure operated by 21Vianet
3+
description: Learn how to configure a bot to operate in the Microsoft Azure operated by 21Vianet.
4+
author: singhvikra-micro
5+
ms.author: singhvikra
6+
manager: kunsingh
7+
ms.reviewer: kparihar
8+
ms.service: azure-ai-bot-service
9+
ms.topic: how-to
10+
ms.date: 09/23/2024
11+
ms.custom:
12+
- template-how-to
13+
- evergreen
14+
---
15+
16+
# Configure a bot in Microsoft Azure operated by 21Vianet
17+
18+
This guide helps Microsoft Azure customers deploy Bot Framework and Azure AI Bot Service bots on the Microsoft Azure platform operated by 21Vianet.
19+
20+
## Prerequisites
21+
22+
- An account in the Microsoft Azure.
23+
- The C# or JavaScript bot project you want to configure.
24+
- Bot Framework SDK version 4.14 or later.
25+
26+
## Use the cloud adapter
27+
28+
Make sure that your bot uses the _cloud adapter_, or an adapter that derives from the cloud adapter.
29+
The cloud adapter lets you specify settings specific to the Microsoft Azure Cloud.
30+
31+
### [C#](#tab/csharp)
32+
33+
The `ConfigurationBotFrameworkAuthentication` class reads authentication settings from your bot configuration file. Upon creation, the cloud adapter utilizes these authentication settings.
34+
35+
Make sure that the `ConfigureServices` method in your **Startup.cs** file contains this line.
36+
37+
```csharp
38+
services.AddSingleton<BotFrameworkAuthentication, ConfigurationBotFrameworkAuthentication>();
39+
```
40+
41+
### [JavaScript](#tab/javascript)
42+
43+
The `ConfigurationBotFrameworkAuthentication` constructor reads authentication settings from your bot configuration file.
44+
45+
In your **index.js** file, the code to create your adapter should look like this:
46+
47+
```javascript
48+
const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication(process.env);
49+
50+
const adapter = new CloudAdapter(botFrameworkAuthentication);
51+
```
52+
53+
---
54+
55+
## Configure UserAssignedMSI/SingleTenant Bot
56+
57+
To ensure the bot functions correctly in the Microsoft Azure Cloud, extra authentication settings are necessary. Replace the "App-Tenant-ID" with the bot's tenant ID.
58+
59+
### [C#](#tab/csharp)
60+
61+
Add the following settings to your **appsettings.json** file.
62+
63+
```json
64+
"OAuthUrl": "https://token.botframework.azure.cn/",
65+
"ToChannelFromBotLoginUrl": "https://login.partner.microsoftonline.cn/<App-Tenant-ID>",
66+
"ToChannelFromBotOAuthScope": "https://api.botframework.azure.cn",
67+
"ToBotFromChannelTokenIssuer": "https://api.botframework.azure.cn",
68+
"ToBotFromChannelOpenIdMetadataUrl": "https://login.botframework.azure.cn/v1/.well-known/openidconfiguration",
69+
"ToBotFromEmulatorOpenIdMetadataUrl": "https://login.partner.microsoftonline.cn/a55a4d5b-9241-49b1-b4ff-befa8db00269/v2.0/.well-known/openid-configuration",
70+
"ValidateAuthority": true
71+
```
72+
73+
### [JavaScript](#tab/javascript)
74+
75+
Add the following settings to your **.env** file.
76+
77+
```ini
78+
OAuthUrl=https://token.botframework.azure.cn/,
79+
ToChannelFromBotLoginUrl=https://login.partner.microsoftonline.cn/<App-Tenant-Id>,
80+
ToChannelFromBotOAuthScope=https://api.botframework.azure.cn,
81+
ToBotFromChannelTokenIssuer=https://api.botframework.azure.cn,
82+
ToBotFromChannelOpenIdMetadataUrl=https://login.botframework.azure.cn/v1/.well-known/openidconfiguration,
83+
ToBotFromEmulatorOpenIdMetadataUrl=https://login.partner.microsoftonline.cn/a55a4d5b-9241-49b1-b4ff-befa8db00269/v2.0/.well-known/openid-configuration,
84+
ValidateAuthority=true
85+
```
86+
87+
---
88+
89+
## Configure MultiTenant Bot
90+
91+
For the multitenant bot, use the following settings.
92+
93+
### [C#](#tab/csharp)
94+
95+
Add the following settings to your **appsettings.json** file.
96+
97+
```json
98+
"OAuthUrl": "https://token.botframework.azure.cn/",
99+
"ToChannelFromBotLoginUrl": "https://login.partner.microsoftonline.cn/microsoftservices.partner.onmschina.cn",
100+
"ToChannelFromBotOAuthScope": "https://api.botframework.azure.cn",
101+
"ToBotFromChannelTokenIssuer": "https://api.botframework.azure.cn",
102+
"ToBotFromChannelOpenIdMetadataUrl": "https://login.botframework.azure.cn/v1/.well-known/openidconfiguration",
103+
"ToBotFromEmulatorOpenIdMetadataUrl": "https://login.partner.microsoftonline.cn/a55a4d5b-9241-49b1-b4ff-befa8db00269/v2.0/.well-known/openid-configuration",
104+
"ValidateAuthority": true
105+
```
106+
107+
### [JavaScript](#tab/javascript)
108+
109+
Add the following settings to your **.env** file.
110+
111+
```ini
112+
OAuthUrl=https://token.botframework.azure.cn/,
113+
ToChannelFromBotLoginUrl=https://login.partner.microsoftonline.cn/microsoftservices.partner.onmschina.cn,
114+
ToChannelFromBotOAuthScope=https://api.botframework.azure.cn,
115+
ToBotFromChannelTokenIssuer=https://api.botframework.azure.cn,
116+
ToBotFromChannelOpenIdMetadataUrl=https://login.botframework.azure.cn/v1/.well-known/openidconfiguration,
117+
ToBotFromEmulatorOpenIdMetadataUrl=https://login.partner.microsoftonline.cn/a55a4d5b-9241-49b1-b4ff-befa8db00269/v2.0/.well-known/openid-configuration,
118+
ValidateAuthority=true
119+
```
120+
121+
---
122+
123+
## Add user authentication to your bot
124+
125+
Your bot can use various identity providers to access resources on behalf of a user, such as Microsoft Entra ID and many other OAuth providers.
126+
127+
The Microsoft Azure Cloud uses a redirect URL that is different from the ones used for other environments.
128+
To configuring your bot for authentication, use `https://token.botframework.azure.cn/.auth/web/redirect` as the OAuth redirect URL and follow the steps in how to [add authentication to your bot](v4sdk/bot-builder-authentication.md).
129+
130+
---
131+
132+
## Configure a bot to run on one or more channels
133+
134+
To configure a bot to connect to a channel, complete the following steps:
135+
136+
1. Sign in to the [Azure portal](https://portal.azure.cn).
137+
2. Select the bot that you want to configure.
138+
3. In the left pane, select **Channels** under **Settings**.
139+
4. In the right pane, select the icon of the channel you want to add to your bot. You may need to scroll down to see the list of all **Available Channels**. The connection steps vary for each channel. For more information on supported channels, see the related articles.
140+
141+
| Channel | Description |
142+
|:-|:-|
143+
| [Direct Line](bot-service-channel-directline.md) | Integrate a bot into a mobile app, web page, or other applications. |
144+
| [Microsoft Teams](channel-connect-teams.md) | Configure a bot to communicate with users through Microsoft Teams. |
145+
| [Web Chat](bot-service-channel-connect-webchat.md) | Automatically configured for you when you create a bot with the Bot Framework Service. |
146+
147+
---
148+
149+
## Next steps
150+
151+
With these steps, your bot should be configured to work successfully. Other useful references regarding Bot Service.
152+
153+
- [Tutorial: Deploy a basic bot using Azure AI Bot Service](tutorial-publish-a-bot.md)
154+
- [Add authentication to a bot in Bot Framework SDK](v4sdk/bot-builder-authentication.md)
155+
- [Connect a bot to Web Chat in the Bot Framework SDK](bot-service-channel-connect-webchat.md)
156+
- [Authenticate requests with the Bot Connector API](rest-api/bot-framework-rest-connector-authentication.md)
157+
- [Compliance in the Azure AI Bot Service](bot-service-compliance.md)

articles/ref-oauth-redirect-urls.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Azure AI Bot Service provides different OAuth and OAuth redirect URLs to meet sp
1818

1919
- The bot needs the OAuth URL at run time.
2020
- You need to provide the OAuth redirect URL when you create or configure your OAuth identity provider.
21-
- For more information, see [how to add authentication to your a bot](v4sdk/bot-builder-authentication.md).
21+
- For more information, see [how to add authentication to your bot](v4sdk/bot-builder-authentication.md).
2222

23-
Choose the URLs to use with your bot and identity provider based on your data residency requirements and whether your bot is in the public cloud or the Microsoft Azure Government cloud.
23+
Choose the URLs to use with your bot and identity provider based on your data residency requirements and whether your bot is in the public cloud or the Microsoft Azure Government cloud or the Microsoft Azure operated by 21Vianet.
2424

2525
| Data residency | Cloud | OAuth URL | OAuth Redirect URL |
2626
|:---------------|:-----------------|:----------------------------------------------|:-----------------------------------------------------------------|
@@ -29,6 +29,7 @@ Choose the URLs to use with your bot and identity provider based on your data re
2929
| United States | Public | `https://unitedstates.token.botframework.com` | `https://unitedstates.token.botframework.com/.auth/web/redirect` |
3030
| India | Public | `https://india.token.botframework.com` | `https://india.token.botframework.com/.auth/web/redirect` |
3131
| None | Azure Government | `https://token.botframework.azure.us` | `https://token.botframework.azure.us/.auth/web/redirect` |
32+
| None | Azure operated by 21Vianet | `https://token.botframework.azure.cn` | `https://token.botframework.azure.cn/.auth/web/redirect` |
3233

3334
The default OAuth and OAuth redirect URLs are `https://token.botframework.com` and `https://token.botframework.com/.auth/web/redirect`, which can be used for public-cloud bots with no data residency requirements.
3435

@@ -62,3 +63,4 @@ See these articles for related information.
6263
- [Regionalization in Azure AI Bot Service](v4sdk/bot-builder-concept-regionalization.md)
6364
- [Bot Framework authentication basics](v4sdk/bot-builder-authentication-basics.md)
6465
- [Configure Bot Framework bots for US Government customers](how-to-deploy-gov-cloud-high.md)
66+
- [Configure a bot in Microsoft Azure operated by 21Vianet](how-to-deploy-china-cloud.md)

0 commit comments

Comments
 (0)