簡體   English   中英

Azure 保管庫密鑰使用.Net 4.5

[英]Azure vault key using .Net 4.5

我有一個 Azure 帳戶,我需要使用.NET 4.5 class 庫來執行此操作

  • 創建 Key Vault 資源
  • 將機密添加到 Key Vault
  • 提供 Web 應用基礎設施
  • 創建托管服務標識
  • 構建 ASP.NET 內核 Web 應用程序
  • 部署和驗證 Web 應用程序

我發現很少有文章但沒有完整的文章或主要使用 asp.net 內核。 我需要使用.Net 4.5 創建它

你能建議解決方案嗎?

We can use Microsoft.Azure.Management.Fluent library to manage Azure resources ( https://www.nuget.org/packages/Microsoft.Azure.Management.Fluent/ )

結合每個資源(KeyVault、WebApp 和任何其他資源)的 ARM 模板,我們可以通過為每個模板調用 Fluent 庫來創建資源

下面提供使用 Fluent 庫創建存儲帳戶的示例代碼

string tenantId = "";
string clientId = "";
string clientSecret = "";
var credentials = SdkContext.AzureCredentialsFactory.FromServicePrincipal(clientId, clientSecret, tenantId, AzureEnvironment.AzureGlobalCloud);
var azure = Azure.Configure().WithLogLevel(Microsoft.Azure.Management.ResourceManager.Fluent.Core.HttpLoggingDelegatingHandler.Level.Basic).Authenticate(credentials).WithSubscription("<<subscriptionid>>");

var templateString = File.ReadAllText("storageaccountARMTemplate.json");
var resourceName = "storageaccounttemplate";
var resourceGroupName = "rglearnazure";
            azure.Deployments.Define(resourceName).WithExistingResourceGroup(resourceGroupName).WithTemplate(templateString).WithParameters("{}").WithMode(DeploymentMode.Incremental).Create();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM