2023 年 6 月 30 日淘汰第 4 版的 Azure Cache for Redis 執行個體

在 2023 年 6 月 30 日淘汰第 4 版的 Azure Cache for Redis 執行個體。 在該日期之前,您需要將任何快取執行個體升級至第 6 版。

  • 2023 年 6 月 30 日之後執行 Redis 第 4 版的所有快取執行個體都會自動升級
  • 執行已啟用異地複寫之 Redis 第 4 版的所有快取執行個體,都會在 2023 年 8 月 30 日之後自動升級

建議您自行升級快取,以配合您的排程及使用者的需求,盡可能使升級方便進行。

更多相關訊息及問答請參考:
https://learn.microsoft.com/zh-tw/azure/azure-cache-for-redis/cache-retired-features

HTH. 2023-4-12 by Jacky Chiou

Azure Web App with Managed Identity to access Azure Open AI

如何使用 Web App 的 Managed Identity 存取 Azure Open AI 的服務?

Why?

因為用 Managed Identity 即可以不用使用 KEY 來存取 Azure Open AI, 不使用 KEY 也就不用煩惱要如何保護及定時更換 KEY.

How?

3 Stpes:

Step 1. 設定 Web App 使用 Managed Identity

Step 2. 設定 Web App 的 Managed Identity 可以存取 特定的 Azure Open AI 服務

Step 3. 程式碼中使用 Managed Identity 存取特定的 Azure Open AI 服務

詳細的說明:

Step 1. 設定 Web App 使用 Managed Identity

建議先使用 System assigned identity , 設定方式如下:
Web App -> Identity -> 啟用 System assigned identity

參考資訊: https://learn.microsoft.com/en-us/azure/app-service/overview-managed-identity?tabs=portal%2Cpython#add-a-system-assigned-identity

Step 2. 設定 Web App 的 Managed Identity 可以存取 特定的 Azure Open AI 服務

這裡特別注意是把 Web App 的 System assigned identity 加入 特定 Azure Open AI 服務的 Cognitive Services User 角色

參考資訊: https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/managed-identity#assign-yourself-to-the-cognitive-services-user-role

Step 3. 程式碼中使用 Managed Identity 存取特定的 Azure Open AI 服務

我的範例程式如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from azure.identity import DefaultAzureCredential
import openai
import os
import requests
import json
from datetime import datetime
from flask import Flask, render_template, request, redirect, url_for, send_from_directory
app = Flask(__name__)

@app.route('/')
def index():
print('Request for index page received')
return render_template('index.html')

@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static'),
'favicon.ico', mimetype='image/vnd.microsoft.icon')

@app.route('/hello', methods=['POST'])
def hello():
name = request.form.get('name')

if name:
# Request credential
default_credential = DefaultAzureCredential()
token = default_credential.get_token("https://cognitiveservices.azure.com/.default")

# Setup parameters
openai.api_type = "azure_ad"
openai.api_key = token.token
openai.api_base = "https://jackyopenai001.openai.azure.com/"
openai.api_version = "2022-12-01"
deployment_name='text-davinci-003' #This will correspond to the custom name you chose for your deployment when you deployed a model.

# Send a completion call to generate an answer
print('Sending a test completion job')
start_phrase = 'Write a tagline for an ice cream shop. '
response = openai.Completion.create(engine=deployment_name, prompt=start_phrase, max_tokens=10)
text = response['choices'][0]['text'].replace('\n', '').replace(' .', '.').strip()
print(start_phrase+text)

print('Request for hello page received with name=%s' % text)
return render_template('hello.html', name = text)
else:
print('Request for hello page received with no name or blank name -- redirecting')
return redirect(url_for('index'))


if __name__ == '__main__':
app.run()

參考資訊:
https://github.com/openai/openai-python#microsoft-azure-active-directory-authentication (特別感謝同事 Jimmy Liao 提供這個重要的資訊讓我可以快速完成.)

https://learn.microsoft.com/zh-tw/azure/app-service/quickstart-python?tabs=flask%2Cwindows%2Cazure-cli%2Clocal-git-deploy%2Cdeploy-instructions-azportal%2Cterminal-bash%2Cdeploy-instructions-zip-azcli#1---sample-application

範例程式執行後的結果將 Azure Open AI 回覆的資訊顯示在網頁上.

HTH. 20230305 By Jacky

Power Pages with Application Insights

I. 3 steps to integrate with Application Insights:

1. Create a new Application Insights and get the Instrumentation key.

Please refer: https://learn.microsoft.com/en-us/azure/azure-monitor/app/create-new-resource?tabs=net

Copy the Instrumentation Key from Azure Portal:

2. Get Application Insights Code Snippet:

3. Enable Traffic Analysis in PP Portal Managements

Please refer my sceenshot:

II. Analyze the home page performance in Application Insights:

Please refer: https://learn.microsoft.com/en-us/azure/azure-monitor/app/tutorial-performance

Go to Performance blade:

Dig into the details:

HTH. 20230214 By Jacky

AKS Standard tier - Uptime SLA is enabled by default NOW

2023/2/1 AKS 推出免費及標準兩者計價模式。更新新的計價模式後,Uptime ALS support會是標準計價模式中中既有的功能,希望能藉此降低 production workload 服務中斷的情形發生。

AKS的建議使用場景:

  • Free tier: for clusters with less than 10 nodes and for experimenting, learning, and simple testing
  • Standard tier: mission-critical, production workload with uptime SLA by-default, support for 5000 nodes, and better control plane autoscaling

For more information:

Enjoy. 2023-Feb-1 By Jacky

雲端資安重點自檢計畫

年節雲端資安

重點自檢計劃

新年假期將至,先預祝貴司新的一年福兔迎祥。年節期間,駭客組織依然 7 x 24 上工不停歇,尋找有機可乘的節點門戶。鑑此,微軟資安團隊特別準備了一份雲端資安重點自檢計畫,詳述於 Microsoft Azure 如何加強雲端資安防禦、遇到攻擊事件的應變原則,以及年節後如何長遠佈局,持續強化企業雲端資安。

重點自檢計畫內容如下:

Azure 資安防禦自檢重點

  • 身分識別與存取控制
  • 網路安全
  • 雲端組態安全與威脅偵測
  • 虛擬機器端點安全
  • 應用程式安全
  • 資料安全與備份
  • 事件應變計劃準備

攻擊事件應變原則

  • 偵測與分析、遏制影響範圍並根除威脅

資安持續強化指引

  • Azure Well-Architected Framework
  • Microsoft Cloud Security Benchmark
  • Microsoft Defender for Cloud

完整資安重點自檢計劃請參閱: 鴻兔大展-年節前 Azure 資安重點自檢計劃

Enjoy. 2023-1-13 By Jacky

Windows 2022 Configure Nested Virtualization with AMD Ryzen processor

CPU: AMD Ryzen 7 5700G with Radeon Graphics
OS: Windows Server 2022 Datacenter

The Hyper-V host must be Windows Server 2022/Windows 11 or greater.

Configure Nested Virtualization

  • Create a virtual machine. See the prerequisites above for the required OS and VM versions.
  • While the virtual machine is in the OFF state, run the following command on the physical Hyper-V host. This enables nested virtualization for the virtual machine.
1
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
  • Start the virtual machine.
  • Install Hyper-V within the virtual machine, just like you would for a physical server. For more information on installing Hyper-V see, Install Hyper-V.

For more information:
https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization#configure-nested-virtualization

HTH. 2022-12-7 By Jacky

Microsoft Power Pages 正式發佈

Power Pages 全新特性

使用設計工作室(Design Studio)輕鬆建置商務網站

用戶無需編寫任何程式碼,便可輕鬆地為電腦端或移動設備建置現代化的、以資料為中心的商務網站。使用者現在還可以輕鬆構建多步驟表單,在資料工作區上傳文檔。同時更新還包括在“樣式工作區”(Styling Workspace)中添加自訂 CSS 的功能。

16 個新的業務解決方案範本可選供選擇

在範本中心(Templates Hub)內,用戶可以從一系列可訂製的響應式範本中進行選擇,從而開啟網站建置之旅。新增的 16 個業務解決方案範本,包括處理建築許可證、管理課後活動註冊和管理客戶約會等。使用者還可以使用客戶自助服務、社區自助服務和合作夥伴關係管理等範本實現 Dynamics 365 擴展

通過學習中心(Learn Hub)的新課程快速提升技能

用戶可以直接在 Power Pages 的學習中心(Learn Hub),探索與 Power Pages 功能相關的不同角度和維度的培訓資源。新增加的課程部分包括嵌入的指導性影片和文件檔,可以為公民開發者和專業開發者提供更多支援。

使用專業開發人員工具擴展頁面

專業開發工具的新更新包括 Power Pages 設計工作室(Design Studio)與 Visual Studio Code Web 的整合。這種整合使融合開發團隊的專業開發者能夠快速、安全地瀏覽和編輯網頁內容 ( HTML 和 Liquid )、網頁樣式 ( CSS ) 和網頁腳本 ( JavaScript ) 的原始程式碼,並將其同步回設計工作室(Design Studio)。

強化安全和治理能力

在 Power Pages 安全可靠的平台基礎上,新的安全和治理更新包括:整合 Azure Web 應用防火牆;支援 Azure Front Door 的 CDN 加速;以及對自訂域的支持。一個新的啟用清單,簡化了網站啟用前的檢查流程,讓使用者能夠完全控制網站何時公開。

Power Pages 相關資源

Power Pages 官方網站

Power Pages 官方文檔

Power Pages 試用申請

Azure Storage CMS using AKV on diff AAD tenant

[GA] Encrypt storage accounts with customer-managed keys (CMK) using an Azure Key Vault hosted on a different Azure Active Directory tenant. You can use this solution to encrypt your customers’ data using an encryption key managed by your customers.

Documentation: https://learn.microsoft.com/azure/storage/common/customer-managed-keys-overview

這個功能即可以實現 加密 Storage Account 的 Key 是由 另一個 AAD Tenant 來控管.

HTH. By Jacky 2022-11-14

App Service 2022 end of support 的公告

某些版本的 Azure 服務將很快停用。我們希望您做好準備並遷移到較新版本,以確保生產正常運行。

以下是您可能感興趣的 4 項服務的資訊。

  • App Service (Linux) PHP v.7.4 End of Support (EoS) -> 11.28.2022
  • Azure Functions v2.x & v3.x EoS -> 12.3.2022
  • App Service .NET Core 3.1 EoS -> 12.3.2022
  • App Service (Linux) Python v.3.7 EoS -> 6.27.2023

For more information:
https://techcommunity.microsoft.com/t5/azure-developer-community-blog/winter-is-coming-keep-your-azure-services-up-to-date/ba-p/3667447