You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because {product-title} and its installation program must create Microsoft Azure
20
-
resources through Azure Resource Manager, you must create a service principal
21
-
to represent it.
19
+
Because {product-title} and its installation program create Microsoft Azure resources by using the Azure Resource Manager, you must create a service principal to represent it.
22
20
23
21
.Prerequisites
24
22
25
23
* Install or update the link:https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest[Azure CLI].
26
-
* Install the `jq` package.
27
24
* Your Azure account has the required roles for the subscription that you use.
28
25
29
26
.Procedure
30
27
31
28
ifdef::ash[]
32
-
. Register your Azure Stack Cloud environment with your Azure CLI. For more details on this process, see Microsoft's documentation for link:https://docs.microsoft.com/en-us/azure-stack/mdc/azure-stack-version-profiles-azurecli-2-tzl#connect-to-azure-stack-hub[Connecting to Azure Stack Hub].
33
-
34
-
.. Register your environment with the Azure CLI:
29
+
. Register your environment:
35
30
+
36
31
[source,terminal]
37
32
----
38
-
$ az cloud register -n <environment_name> --endpoint-resource-manager <arm_endpoint>
33
+
$ az cloud register -n AzureStackCloud--endpoint-resource-manager <endpoint> <1>
39
34
----
35
+
<1> Specify the Azure Resource Manager endpoint, \`https://management.<region>.<fqdn>/`.
36
+
+
37
+
See the link:https://docs.microsoft.com/en-us/azure-stack/mdc/azure-stack-version-profiles-azurecli-2-tzl#connect-to-azure-stack-hub[Microsoft documentation] for details.
40
38
41
-
.. Set the active environment:
39
+
. Set the active environment:
42
40
+
43
41
[source,terminal]
44
42
----
45
-
$ az cloud set -n <environment_name>
43
+
$ az cloud set -n AzureStackCloud
46
44
----
47
45
48
-
.. Update your environment configuration to use the specific API version for Azure Stack Hub:
46
+
. Update your environment configuration to use the specific API version for Azure Stack Hub:
49
47
+
50
48
[source,terminal]
51
49
----
52
50
$ az cloud update --profile 2019-03-01-hybrid
53
51
----
54
-
55
52
endif::ash[]
56
53
57
54
. Log in to the Azure CLI:
@@ -60,14 +57,14 @@ endif::ash[]
60
57
----
61
58
$ az login
62
59
----
63
-
+
64
-
Log in to Azure in the web console by using your credentials.
65
60
ifdef::ash[]
61
+
+
66
62
If you are in a multitenant environment, you must also supply the tenant ID.
67
63
endif::ash[]
68
64
69
65
. If your Azure account uses subscriptions, ensure that you are using the right
70
-
subscription.
66
+
subscription:
67
+
71
68
.. View the list of available accounts and record the `tenantId` value for the
72
69
subscription you want to use for your cluster:
73
70
+
@@ -129,19 +126,17 @@ endif::[]
129
126
}
130
127
}
131
128
----
132
-
<1> Ensure that the value of the `tenantId` parameter is the UUID of the
133
-
correct subscription.
129
+
<1> Ensure that the value of the `tenantId` parameter is the correct subscription ID.
134
130
135
131
.. If you are not using the right subscription, change the active subscription:
136
132
+
137
133
[source,terminal]
138
134
----
139
-
$ az account set -s <id> <1>
135
+
$ az account set -s <subscription_id> <1>
140
136
----
141
-
<1> Substitute the value of the `id` for the subscription that you want to
142
-
use for `<id>`.
137
+
<1> Specify the subscription ID.
143
138
144
-
.. If you changed the active subscription, display your account information again:
139
+
.. Verify the subscription ID update:
145
140
+
146
141
[source,terminal]
147
142
----
@@ -170,94 +165,45 @@ endif::[]
170
165
}
171
166
----
172
167
173
-
. Record the values of the `tenantId` and `id` parameters from the previous
174
-
output. You need these values during {product-title} installation.
168
+
. Record the `tenantId` and `id` parameter values from the output. You need these values during the {product-title} installation.
175
169
176
170
. Create the service principal for your account:
177
171
+
178
172
[source,terminal]
179
173
----
180
-
$ az ad sp create-for-rbac --role Contributor --name <service_principal> <1>
174
+
$ az ad sp create-for-rbac --role Contributor --name <service_principal> \ <1>
175
+
--scopes /subscriptions/<subscription_id> <2>
181
176
----
182
-
<1> Replace `<service_principal>` with the name to assign to the service principal.
177
+
<1> Specify the service principal name.
178
+
<2> Specify the subscription ID.
183
179
+
184
180
.Example output
185
181
[source,terminal]
186
182
----
187
-
Changing "<service_principal>" to a valid URI of "http://<service_principal>", which is the required format used for service principal names
188
-
Retrying role assignment creation: 1/36
189
-
Retrying role assignment creation: 2/36
190
-
Retrying role assignment creation: 3/36
191
-
Retrying role assignment creation: 4/36
183
+
Creating 'Contributor' role assignment under scope '/subscriptions/<subscription_id>'
184
+
The output includes credentials that you must protect. Be sure that you do not
185
+
include these credentials in your code or check the credentials into your source
186
+
control. For more information, see https://aka.ms/azadsp-cli
. Record the values of the `appId` and `password` parameters from the previous
202
196
output. You need these values during {product-title} installation.
203
197
204
198
ifndef::ash[]
205
-
. Grant additional permissions to the service principal.
206
-
+
207
-
--
208
-
** You must always add the `Contributor` and `User Access Administrator` roles to the app registration service principal so the cluster can assign credentials for its components.
209
-
** To operate the Cloud Credential Operator (CCO) in _mint mode_, the app registration service principal also requires the `Azure Active Directory Graph/Application.ReadWrite.OwnedBy` API permission.
210
-
** To operate the CCO in _passthrough mode_, the app registration service principal does not require additional API permissions.
211
-
--
212
-
+
213
-
For more information about CCO modes, see "About the Cloud Credential Operator" in the "Managing cloud provider credentials" section of the _Authentication and authorization_ guide.
214
-
+
215
-
[NOTE]
216
-
====
217
-
If you limit the service principal scope of the {product-title} installation program to an already existing Azure resource group, you must ensure all other resources used by the installation program in your environment have the necessary permissions, such as the public DNS zone and virtual network. Destroying a cluster using the installation program deletes this resource group.
218
-
====
219
-
220
-
.. To assign the `User Access Administrator` role, run the following command:
199
+
. Assign the `User Access Administrator` role by running the following command:
221
200
+
222
201
[source,terminal]
223
202
----
224
203
$ az role assignment create --role "User Access Administrator" \
225
-
--assignee-object-id $(az ad sp list --filter "appId eq '<appId>'" \
226
-
| jq '.[0].id' -r) <1>
227
-
----
228
-
<1> Replace `<appId>` with the `appId` parameter value for your service principal.
229
-
230
-
.. To assign the `Azure Active Directory Graph` permission, run the following
<1> Replace `<appId>` with the `appId` parameter value for your service principal.
240
-
+
241
-
.Example output
242
-
[source,terminal]
243
-
----
244
-
Invoking "az ad app permission grant --id 46d33abc-b8a3-46d8-8c84-f0fd58177435 --api 00000002-0000-0000-c000-000000000000" is needed to make the change effective
245
-
----
246
-
+
247
-
For more information about the specific permissions that you grant with this
248
-
command, see the
249
-
link:https://blogs.msdn.microsoft.com/aaddevsup/2018/06/06/guid-table-for-windows-azure-active-directory-permissions/[GUID Table for Windows Azure Active Directory Permissions].
250
-
.. Approve the permissions request. If your account does not have the
251
-
Azure Active Directory tenant administrator role, follow the guidelines for
252
-
your organization to request that the tenant administrator approve your
253
-
permissions request.
254
-
+
255
-
[source, terminal]
256
-
----
257
-
$ az ad app permission grant --id <appId> \ <1>
258
-
--api 00000002-0000-0000-c000-000000000000
204
+
--assignee-object-id $(az ad sp show --id <appId> --query id -o tsv) <1>
259
205
----
260
-
<1> Replace `<appId>` with the `appId` parameter value for your service principal.
206
+
<1> Specify the `appId` parameter value for your service principal.
0 commit comments