Skip to content

Commit 237bbc3

Browse files
lilyydulilydu
andauthored
[docs]: add regional config section to user authentication (#2684)
added typescript and python as .NET implementation will be delayed with other refactorings --------- Co-authored-by: lilydu <[email protected]>
1 parent 2c706e4 commit 237bbc3

File tree

5 files changed

+75
-0
lines changed

5 files changed

+75
-0
lines changed

teams.md/src/components/include/in-depth-guides/user-authentication/csharp.incl.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,6 @@ teams.OnMessage("/signout", async context =>
8888
await context.Send("you have been signed out!");
8989
});
9090
```
91+
<!-- regional-bot -->
92+
93+
N/A

teams.md/src/components/include/in-depth-guides/user-authentication/python.incl.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,38 @@ async def handle_signout_message(ctx: ActivityContext[MessageActivity]):
8585
await ctx.sign_out()
8686
await ctx.send("You have been signed out!")
8787
```
88+
89+
<!-- regional-bot -->
90+
import Tabs from '@theme/Tabs';
91+
import TabItem from '@theme/TabItem';
92+
93+
## Regional Configs
94+
You may be building a regional bot that is deployed in a specific Azure region (such as West Europe, East US, etc.) rather than global. This is important for organizations that have data residency requirements or want to reduce latency by keeping data and authentication flows within a specific area.
95+
96+
These examples use West Europe, but follow the equivalent for other regions.
97+
98+
<Tabs>
99+
<TabItem value="portal" label="Azure Portal">
100+
To configure a new regional bot in Azure, you must setup your resoures in the desired region. Your resource group must also be in the same region.
101+
102+
1. Deploy a new App Registration in `westeurope`.
103+
2. Deploy and link a new Enterprise Application (Service Principal) on Microsoft Entra in `westeurope`.
104+
3. Deploy and link a new Azure Bot in `westeurope`.
105+
4. In your App Registration, in the `Authentication (Preview)` tab, add a `Redirect URI` for the Platform Type `Web` to your regional endpoint (e.g., `https://europe.token.botframework.com/.auth/web/redirect`)
106+
107+
![Authentication Tab](/screenshots/regional-auth.png)
108+
109+
5. In your `.env` file (or wherever you set your environment variables), add your `OAUTH_URL`. For example:
110+
`OAUTH_URL=https://europe.token.botframework.com`
111+
</TabItem>
112+
113+
<TabItem value="atk" label="Agents Toolkit">
114+
To configure a new regional bot with ATK, you will need to make a few updates. Note that this assumes you have not yet deployed the bot previously.
115+
116+
1. In `azurebot.bicep`, replace all `global` occurrences to `westeurope`
117+
2. In `manifest.json`, in `validDomains`, `*.botframework.com` should be replaced by `europe.token.botframework.com`
118+
3. In `aad.manifest.json`, replace `https://token.botframework.com/.auth/web/redirect` with `https://europe.token.botframework.com/.auth/web/redirect`
119+
4. In your `.env` file, add your `OAUTH_URL`. For example:
120+
`OAUTH_URL=https://europe.token.botframework.com`.
121+
</TabItem>
122+
</Tabs>

teams.md/src/components/include/in-depth-guides/user-authentication/typescript.incl.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,38 @@ app.message('/signout', async ({ send, signout, isSignedIn }) => {
8686
await send('you have been signed out!');
8787
});
8888
```
89+
90+
<!-- regional-bot -->
91+
import Tabs from '@theme/Tabs';
92+
import TabItem from '@theme/TabItem';
93+
94+
## Regional Configs
95+
You may be building a regional bot that is deployed in a specific Azure region (such as West Europe, East US, etc.) rather than global. This is important for organizations that have data residency requirements or want to reduce latency by keeping data and authentication flows within a specific area.
96+
97+
These examples use West Europe, but follow the equivalent for other regions.
98+
99+
<Tabs>
100+
<TabItem value="portal" label="Azure Portal">
101+
To configure a new regional bot in Azure, you must setup your resoures in the desired region. Your resource group must also be in the same region.
102+
103+
1. Deploy a new App Registration in `westeurope`.
104+
2. Deploy and link a new Enterprise Application (Service Principal) on Microsoft Entra in `westeurope`.
105+
3. Deploy and link a new Azure Bot in `westeurope`.
106+
4. In your App Registration, in the `Authentication (Preview)` tab, add a `Redirect URI` for the Platform Type `Web` to your regional endpoint (e.g., `https://europe.token.botframework.com/.auth/web/redirect`)
107+
108+
![Authentication Tab](/screenshots/regional-auth.png)
109+
110+
5. In your `.env` file (or wherever you set your environment variables), add your `OAUTH_URL`. For example:
111+
`OAUTH_URL=https://europe.token.botframework.com`
112+
</TabItem>
113+
114+
<TabItem value="atk" label="Agents Toolkit">
115+
To configure a new regional bot with ATK, you will need to make a few updates. Note that this assumes you have not yet deployed the bot previously.
116+
117+
1. In `azurebot.bicep`, replace all `global` occurrences to `westeurope`
118+
2. In `manifest.json`, in `validDomains`, `*.botframework.com` should be replaced by `europe.token.botframework.com`
119+
3. In `aad.manifest.json`, replace `https://token.botframework.com/.auth/web/redirect` with `https://europe.token.botframework.com/.auth/web/redirect`
120+
4. In your `.env` file, add your `OAUTH_URL`. For example:
121+
`OAUTH_URL=https://europe.token.botframework.com`
122+
</TabItem>
123+
</Tabs>

teams.md/src/pages/templates/in-depth-guides/user-authentication.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ You can signout by calling the `signout` method, this will remove the token from
9696

9797
<LanguageInclude section="signing-out" />
9898

99+
<LanguageInclude section="regional-bot" />
100+
99101
## Resources
100102

101103
[User Authentication Basics](https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-concept-authentication?view=azure-bot-service-4.0)
119 KB
Loading

0 commit comments

Comments
 (0)