You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Microsoft Graph为Azure B2C租户设置品牌Logo及背景图?

用Microsoft Graph设置Azure B2C租户的Logo/背景图

和设置backgroundColor的JSON PATCH请求不同,Logo和背景图需要通过PUT请求上传二进制文件来完成,具体操作如下:

使用PUT接口上传Logo的二进制数据,接口地址:
PUT https://graph.microsoft.com/v1.0/organization/{organizationId}/branding/logo

关键要求:

  • 请求头必须指定Content-Type为图片对应的MIME类型,比如image/png或image/jpeg
  • 图片需满足:仅支持PNG/JPG格式,尺寸不超过240x240像素,文件大小≤100KB

示例curl命令:

curl --request PUT 'https://graph.microsoft.com/v1.0/organization/{organizationId}/branding/logo' \
--header 'Authorization: Bearer {你的访问令牌}' \
--header 'Content-Type: image/png' \
--data-binary '@本地Logo文件路径.png'

设置登录页背景图

背景图的上传逻辑和Logo一致,接口地址为:
PUT https://graph.microsoft.com/v1.0/organization/{organizationId}/branding/signInPageBackgroundImage

关键要求:

  • 请求头Content-Type匹配图片格式
  • 背景图推荐尺寸1920x1080像素,支持PNG/JPG,文件大小≤1MB

示例curl命令:

curl --request PUT 'https://graph.microsoft.com/v1.0/organization/{organizationId}/branding/signInPageBackgroundImage' \
--header 'Authorization: Bearer {你的访问令牌}' \
--header 'Content-Type: image/jpeg' \
--data-binary '@本地背景图文件路径.jpg'

如果需要验证已上传的图片,直接用GET请求访问对应接口即可,比如:
GET https://graph.microsoft.com/v1.0/organization/{organizationId}/branding/logo

内容的提问来源于stack exchange,提问作者Kathiea

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 12:40:53