You need to have tenant ID, subscription ID, client ID and client secret values
From the Portal, if you click on the Help icon in the upper right and then choose Show Diagnostics
you can find the tenant id in the diagnostic JSON.
You can also find TenantID from Portal -> Azure Active Directory -> Proparties -> Directory ID
From the Portal, if you click on the Help icon in the upper right and then choose Show Diagnostics
you can find the subscription id in the diagnostic JSON.
You can also find Subscription id from Portal -> Subscription -> Subscription ID
Azure Active Directory
App Registrations
from left sidebarApplication (Client) ID
copy the valueNew Registration
from top barName
and then click Register
Overview
from left bar. You’ll get Application (client) ID
Azure Active Directory
App Registrations
from left sidebarCertificates and secrets
from left sidebarNew client secret
to create a new secretFrom command line, run
$ pharmer create credential <credential-name>
select azure as cloud provider. You will be prompted to enter Tenant ID
, Subscription ID
, Client ID
and Client Secret
You can also create credential from environment variables
$ export AZURE_SUBSCRIPTION_ID=<subscription id>
$ export AZURE_TENANT_ID=<tenant id>
$ export AZURE_CLIENT_ID=<client id>
$ export AZURE_CLIENT_SECRET=<client secret>
$ pharmer create credential <credential-name> --provider azure --from-env
You can also create credentials from file. Create a file in this format
{
"tenantID": "your azure client id",
"subscriptionID": "your azure subscriptino id",
"clientID": "your azure client id",
"clientSecret": "your azure client secret"
}
now run
$ pharmer create credential <credential-name> --provider azure --from-file <path-to-file>
You can view list of credentials you created by running
$ pharmer get credentials
To view the credential you created, run
$ pharmer get credential <credential-name> -o yaml
apiVersion: cloud.pharmer.io/v1
kind: Credential
metadata:
creationTimestamp: "2019-06-26T08:55:54Z"
name: <credential-name>
spec:
data:
clientID: your azure client id
clientSecret: your azure client secret
subscriptionID: your azure subscriptino id
tenantID: your azure client id
provider: azure
Here,
- spec.data.clientID
is the azure client id
- spec.data.clientSecret
is the secret
- spec.data.subscriptionID
is the subscription id of azure account
- spec.data.tenantID
is tenant id that you provided which can be edited by following command:
You can edit your created credential by running
$ phrmer edit credential <credential-name>
You can delete your credential by running
$ pharmer delete credential <credential-name>