问题
Actually I am trying to create an infrastructure in azure using terraform so I wanted these keys for programmatic access.
回答1:
SubscriptionId and TenantId belongs to your azure subscription which you can either get from azure portal directly or from powershell.
ClientId and Client Secret are related to the application registered where you will be providing access[role] to your application to perform certain functionality for you. You can convert the secure string password to plain string as below:
When you will register any application in your Azure Active Directory you can have all the details, after creating it- ClientId, Secret, Subscription Id and Tenant Id.
See more details on doing it from Azure Portal.
回答2:
Azure Active Directory whose authentication tokens can be used as the client_id, client_secret, and tenant_id fields needed by Terraform (subscription_id can be independently recovered from your Azure account details).
It's possible to complete this task in either the Azure CLI or in the Azure Portal - in both we'll create a Service Principal which has Contributor rights to the subscription. It's also possible to assign other rights depending on your configuration.
Go Portal -->click on Active Directory-->App registration--> There you will be able to find Application client Id and Directory tenant. For Secrets and click on that option.
来源:https://stackoverflow.com/questions/57849090/where-to-find-the-values-to-subscription-id-client-id-secret-and-tenant-id