-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy path_help.py
More file actions
107 lines (92 loc) · 4.39 KB
/
_help.py
File metadata and controls
107 lines (92 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.help_files import helps # pylint: disable=unused-import
helps['login'] = """
type: command
short-summary: Log in to Azure.
long-summary: >-
By default, this command logs in with a user account. CLI will try to launch a web browser to log in interactively.
If a web browser is not available, CLI will fall back to device code login.
To login with a service principal, specify --service-principal.
examples:
- name: Log in interactively.
text: az login
- name: Log in with user name and password. This doesn't work with Microsoft accounts or accounts that have two-factor authentication enabled. Use -p=secret if the first character of the password is '-'.
text: az login -u johndoe@contoso.com -p VerySecret
- name: Log in with a service principal using client secret. Use -p=secret if the first character of the password is '-'.
text: az login --service-principal -u http://azure-cli-2016-08-05-14-31-15 -p VerySecret --tenant contoso.onmicrosoft.com
- name: Log in with a service principal using client certificate.
text: az login --service-principal -u http://azure-cli-2016-08-05-14-31-15 -p ~/mycertfile.pem --tenant contoso.onmicrosoft.com
- name: Log in using a VM's system-assigned managed identity.
text: az login --identity
- name: Log in using a VM's user-assigned managed identity. Client or object ids of the service identity also work.
text: az login --identity -u /subscriptions/<subscriptionId>/resourcegroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myID
"""
helps['account'] = """
type: group
short-summary: Manage Azure subscription information.
"""
helps['account clear'] = """
type: command
short-summary: Clear all subscriptions from the CLI's local cache.
long-summary: To clear the current subscription, use 'az logout'.
"""
helps['account list'] = """
type: command
short-summary: >-
Get a list of subscriptions for the logged in account. By default, only 'Enabled' subscriptions from the current
cloud is shown.
"""
helps['account list-locations'] = """
type: command
short-summary: List supported regions for the current subscription.
"""
helps['account show'] = """
type: command
short-summary: Get the details of a subscription.
long-summary: If no subscription is specified, shows the current subscription.
"""
helps['account set'] = """
type: command
short-summary: Set a subscription to be the current active subscription.
"""
helps['account show'] = """
type: command
short-summary: Get the details of a subscription.
long-summary: >-
If the subscription isn't specified, shows the details of the default subscription.
When --sdk-auth is used,
the output includes credentials that you must protect. Be sure that you do not include these credentials
in your code or check the credentials into your source control. As an alternative, consider using
[managed identities](https://aka.ms/azadsp-managed-identities) if available to avoid the need to use credentials.
"""
helps['account get-access-token'] = """
type: command
short-summary: Get a token for utilities to access Azure.
long-summary: >
The token will be valid for at least 5 minutes with the maximum at 60 minutes.
If the subscription argument isn't specified, the current account is used.
examples:
- name: Get an access token for the current account
text: >
az account get-access-token
- name: Get an access token for a specific subscription
text: >
az account get-access-token --subscription 00000000-0000-0000-0000-000000000000
- name: Get an access token for a specific tenant
text: >
az account get-access-token --tenant 00000000-0000-0000-0000-000000000000
- name: Get an access token to use with MS Graph API
text: >
az account get-access-token --resource-type ms-graph
- name: Show the decoded claims of the access token, instead of the token itself
text: >
az account get-access-token --show-claims
"""
helps['self-test'] = """
type: command
short-summary: Runs a self-test of the CLI.
"""