Azure 入门系列 (第四篇 Key Vault)

本系列

这个系列会介绍从 0 到 1 搭建一个 Web Application 的 Server. 间中还会带上一些真实开发常用的功能.

一共 6 篇

1. Virtual Machine (VM) 和 SQL Server

2. Backup & Recovery Disaster 

3. Publish Web Application to VM (IIS, HTTPS) 

4. Azure Key Vault <-- 你在这里

5. Azure Storage (with custom domain)

6. Computer Vision (smart-cropped thumbnails, OCR)

以前的学记笔记: 

Azure key-vault

Secret 和 Data Protect Azure key-vault & Storage Account 第 2 篇

ASP.NET core

git clone https://github.com/keatkeat87/cnblogs-azure-get-started

git checkout de62d9e9a0e03cc6b81686b0fe5eb8955912241a

dotnet add package Azure.Identity

dotnet add package Azure.Extensions.AspNetCore.Configuration.Secrets

Program.cs 改动的部分

HyphenKeyVaultSecretManager 的作用: Azure key 不可以放分号 : 所以我用 hyphen - 来代替, 然后 setup 的时候需要一个 convert

Azure Portal Setup

要让 VM 有权限访问到 Key Vault, 我们需要开通 VM 

进入 JBReviews-VM > Identity > Status = On

把 Object ID 记入起来, 之后会用到

Search “Key vaults” 进入服务页面

Create key vault, 选好区域, 其余默认就可以了

Access policy

 Add Access Policy

其余的默认, create

进入做好的 Key Vault, create secret key value

 这样就可以了. 

原文地址:https://www.cnblogs.com/keatkeat/p/15054870.html