簡體   English   中英

如何獲取 Azure (ARM) 部署模板的 clientId 和 clientsecret

[英]How to get clientId and clientsecret for Azure (ARM) deployment template

我想自動化我的 Azure 資源管理,我正在使用 ARM 模板來做到這一點。

如果我想從我的 C# 代碼(下載 Azure 導出模板時生成的 DeploymentHelper.cs)連接到 Azure。

該代碼要求提供以下詳細信息:

        string subscriptionId = "your-subscription-id";
        string clientId = "your-service-principal-clientId";
        string clientSecret = "your-service-principal-client-secret";
        string resourceGroupName = "resource-group-name";
        string deploymentName = "deployment-name";
        string resourceGroupLocation = "resource-group-location"; // must be specified for creating a new resource group
        string pathToTemplateFile = "path-to-template.json-on-disk";
        string pathToParameterFile = "path-to-parameters.json-on-disk";
        string tenantId = "tenant-id";

我可以通過powershell查看tentantId和subscriptionId,但我不知道如何獲取clientId和clientsecret,而且我也找不到有關如何獲取這些的可靠說明。

您是否在AD中創建了服務主體? 如果是這樣,您應該擁有這些值。 如果還沒有,請按照msft指南進行操作。

https://azure.microsoft.com/en-gb/documentation/articles/resource-group-create-service-principal-portal/

  1. Azure 門戶
  2. 活動目錄
  3. 應用程序注冊(在右側面板上)
  4. 單擊正確的應用程序(客戶端)ID
  5. 您將在概覽下看到。

在此處輸入圖片說明

暫無
暫無

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

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