Forum Discussion

Petri-X's avatar
Petri-X
Bronze Contributor
Apr 04, 2025

When the Bot's app secrets expires, how to fix. .

Hi,

Just realized that the secret was expired from one of our Teams chatbot. On the Developer portal, there was nice button "Add a secret" under Tools \ Bot Management.  And that was working fine, it adds the new secret and I was able to remove the expired.

The only question is, was this enough? Or should I do something extra steps to get the new secret into use? After few hours, that still not react to me.

3 Replies

  • Petri-X's avatar
    Petri-X
    Bronze Contributor

    Hi Sayali-MSFT 

    I'm not sure if you got my issue. I do have already existing chatbot on our Teams and its secrets expired. When I'm looking for the chatbot using the developer Portal I can see the bot under the "tools" menu and here is also the place to renew the secret for the bot, and that works fine:

    But the question is, where shall I add that the new client secret in next? If I review the bot from the "App Features" it shows all others, except the secrets:

    When I create this at the first time, then I was able to define the bot and client secret. But where is the logic for renewing the secret? I hope the answer is: "you should setup new bot every time you update the client secrets" 🙂

  • Petri-X,

    Updating your bot's secret is a critical step for maintaining the functionality and security of your Teams chatbot. However, there might be additional steps required to ensure everything is seamless and your bot remains operational. Here are some steps and considerations after updating the secret:

    1. Update Configuration in Bot Framework:
      • Ensure that the new secret is updated in your bot's configuration files, typically where the bot's credentials are stored (e.g., .env or appsettings.json).
      • Example for .env file:MicrosoftAppId={Your_Application_Id}
      • MicrosoftAppPassword={Your_New_Secret}
    2. Regenerate Tokens:
      • If your bot is using access tokens generated using the old secret, you'll need to regenerate new tokens using the updated secret.
    3. Redeploy Bot:
    • Sayali-MSFT's avatar
      Sayali-MSFT
      Icon for Microsoft rankMicrosoft

      Hello Petri-X, Could you please confirm if your issue has resolved with provided suggestions or still looking for any help?

Resources