当前位置: 首页 > news >正文

How to Use Managed Identity with ACS?

Overview

ACS is a fully managed(托管)communication platform. By using managed identity with ACS , we can simplify the authentication process for our ACS application, while also increasing its security. Eliminating the need to managed our own access tokens and credentials.

Two identities

ACS supports two types of managed identity to authenticate with the service.

  • A System Assigned Identity which is tied to the ACS resource.
  • A User Assigned Identity which is an Azure resource that can be assigned to the ACS resource.

How to use managed identity with ACS

  1. Grant the managed identity access to the ACS resource by the Azure portal, Azure CLI, and the ACS Management SDKs.
  2. Use the managed identity to authenticate with ACS by the Azure SDKs or REST APIs.
const { EmailClient, KnownEmailSendStatus } = require("@azure/communication-email"); 
// system assigned 
//const { DefaultAzureCredential } = require("@azure/identity"); // user assigned 
const { ManagedIdentityCredential } = require("@azure/identity"); 
const userAssignedClientId = "xxxx"; // 替换为你的用户分配身份的客户端 ID 
const endpoint = "xxxx"; // system assigned 
//let credential = new DefaultAzureCredential(); // user assigned 
let credential = new ManagedIdentityCredential(userAssignedClientId); 
// Create an instance of ManagedIdentityCredential with an object ID. 
// Options for configuring the resource which makes the access token request; 
// Refer to js SDK cosntructor details// Create the email client with authentication
const emailClient = new EmailClient(endpoint, credential); 
  • Note: There are a few different options available for authentication an email client: Connection String, Microsoft Entra ID, AzureKeyCredential. We use MS Extra ID here.

Reference

  • ACS - Enable managed identity
  • ACS - Send Email
  • JS SDK - ManagedIdentityCredential
http://www.dtcms.com/a/347605.html

相关文章:

  • 全面解析主流AI模型:功能对比与应用推荐
  • douyin_search_tool:用python开发的抖音关键词搜索采集软件
  • 低功耗全双工远距离无线对讲解决方案
  • 【数位DP】D. From 1 to Infinity
  • 数据库字段类型深度解析:从关系型到 NoSQL 的全面指南
  • Placement new是什么
  • CUDA和torch的安装
  • 【LeetCode】363. 矩形区域不超过 K 的最大数值和 (二分 + 前缀和)
  • 拓扑排序|hash
  • 深入剖析Spring Boot应用启动全流程
  • MySQL GPG 密钥更新问题解决文档
  • Centos7.9 Docker26容器化部署 MySql9.4 一主一从的同步复制部署
  • 【51单片机非精准延时演示来回流水灯效果】2022-11-10
  • 【机器学习深度学习】自然语言与多模态大模型
  • 【KO】前端面试一
  • git的工作使用中实际经验
  • 关于Highcharts的数据参考与产品系列
  • Camera performance analysis
  • 智能系统与未来生态演进初步思考
  • 告别图片背景违和!autohue.js 让图片与背景自动 “无缝衔接”
  • 基于51单片机自动智能浇花系统设计
  • 【序列晋升】13 Spring Cloud Bus微服务架构中的消息总线
  • 研究生方向:在传统赛道与交叉领域间寻找破局之路
  • 第三阶段数据库-2:数据库中的sql语句
  • 重审文字的本体论地位:符号学转向、解构主义突围与视觉性革命
  • 1电吉他环境搭建:效果器再探
  • C++算法题—— 小C的细菌(二维偏序离线 + 树状数组 + 坐标压缩)
  • [激光原理与应用-328]:结构设计 - Solidworks - 什么是结构建模?
  • PCB电路设计学习3 电路原理图设计 元件PCB封装设计与添加
  • 学习嵌入式第三十六天