如何在Azure Bot Service中配置AppId?适配原Bot Framework流程
Got it, I’ve gone through this exact migration step before, so let me break down how to set up an App ID in Azure Bot Service just like you did in the old Bot Framework portal.
Step 1: Create or use an existing Azure AD App Registration
First, you need an Azure AD App Registration—this is where your bot’s App ID lives now:
- Head to the Azure portal, search for App Registrations and open the service.
- You can either create a new registration (click "New registration") or reuse an existing one from your old Bot Framework setup (super handy if you’re migrating an existing bot).
- When creating a new one: Give it a clear name, pick the supported account type (most bots work with "Accounts in any organizational directory and personal Microsoft accounts"), and leave the redirect URI blank for now (you can add it later if your bot needs it).
- Once created, copy the Application (client) ID—this is exactly the App ID you configured in the old portal.
Step 2: Link the App Registration to your Azure Bot Service
Now you need to connect this App Registration to your bot resource:
- If creating a new Azure Bot resource:
When going through the creation wizard, look for the "Authentication" section. Select "Use existing app registration", paste the Application (client) ID you copied, and enter the client secret (we’ll generate this next). - If you already have an Azure Bot resource:
Go to your bot’s resource in the Azure portal, navigate to the Configuration blade. Under "Microsoft App ID", click "Manage" to view the linked registration. To switch to a different one, click "Change Microsoft App ID", then input the new App ID and its corresponding client secret.
Step 3: Generate a Client Secret
Your bot needs a client secret to authenticate with the App ID:
- Go back to your App Registration, open the Certificates & secrets tab, then select "Client secrets".
- Click "New client secret", add a description (like "Bot Service Authentication"), set an expiration period, and hit "Add".
- Important: Copy the secret value right away—you won’t be able to view it again after leaving this page. This secret pairs with your App ID for your bot’s authentication flows.
Quick Pro Tip
If you’re migrating a bot from the old Bot Framework portal, you don’t need to create a new App ID! Just find your existing App Registration (it’s tied to your old bot’s credentials) and link it directly to your new Azure Bot Service resource. That way, you can keep using the same authentication details you already had.
内容的提问来源于stack exchange,提问作者Suba

