Image in adaptive card isn't updated in Teams after the source is changed

Qinen Zhu 1 Reputation point Microsoft Employee
2022-09-19T02:38:32.29+00:00

Hi team,

Recently I'm working on building a Teams bot app with adaptive card, and one of the cards set the background image with a blob link. During app development, I found the card background image isn't updated in Teams after I uploaded another different image to the same blob URL.

With F12 in Teams web client, I noticed the image URL in Teams is set to "***https://as-prod.asyncgw.teams.microsoft.com/urlp/v1/url/content***?url=https%3a%2f%2fqinezh.blob.core.windows.net%2fshareimages%2fpipeleak%2fblue.png" instead of the actual blob URL. So I guess the issue is related to the image cache in Teams platform, which doesn't refresh the card background image.

I have following questions for the image cache:

  1. how long is the expiration time for the image cache?
  2. how to invalidate the cache during app development?

Here's the sample content of the adaptive card:

{  
  "type": "AdaptiveCard",  
  "body": [  
    {  
      "type": "Container",  
      "items": [  
        {  
          "type": "TextBlock",  
          "text": "Image Background"  
        }  
      ],  
      "backgroundImage": "https://qinezh.blob.core.windows.net/shareimages/pipeleak/blue.png"  
    }  
  ],  
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",  
  "version": "1.4"  
}  

Thanks.

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,187 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.