2022-08-16

[Azure] C# 透過 Microsoft.Azure.Management.Fluent 取得 Azure Storage (Table) 的操作事件

這篇主要目的是因為有朋友問,如何得知 Azure Table 中資料被存取,其實我有跟他說過你可以透過 在入口網站 左邊的 共用存取簽章 Shared Access Signature (SAS)

來做到控管




而且,其實也可以透過左邊網路的部份去限制 IP 


但是朋友希望可以看到這 storage 裡面的所有 Event Log 這時候就稍微麻煩點



1. 你要取得 權限 請參考這篇文章

https://blog.no2don.com/2020/09/azurec-c-azure.html

指令:


2.下載套件

Microsoft.Azure.Management.Fluent

Microsoft.Azure.Management.ResourceManager.Fluent


3.接下來就是把步驟一的資料包含 clientId=appId , clientSecret=password , tenantId=tenant


結果:


這樣你就可以透過程式的方法去拿到log 拿到你要的資訊。