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
Copy file name to clipboardExpand all lines: docs/tutorials/azure.md
+43-12Lines changed: 43 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -61,13 +61,18 @@ The `resourceGroup` is the Resource Group created in a previous step.
61
61
The `aadClientID` and `aaClientSecret` are assoiated with the Service Principal, that you need to create next.
62
62
63
63
### Creating service principal
64
-
A Service Principal with a minimum access level of contribute to the resource group containing the Azure DNS zone(s) is necessary for ExternalDNS to be able to edit DNS records. This is an Azure CLI example on how to query the Azure API for the information required for the Resource Group and DNS zone you would have already created in previous steps.
64
+
A Service Principal with a minimum access level of `contributor` to the DNS zone(s) and `reader` to the resource group containing the Azure DNS zone(s) is necessary for ExternalDNS to be able to edit DNS records. However, other more permissive access levels will work too (e.g. `contributor` to the resource group or the whole subscription).
65
65
66
+
This is an Azure CLI example on how to query the Azure API for the information required for the Resource Group and DNS zone you would have already created in previous steps.
67
+
68
+
```bash
69
+
> az login
66
70
```
67
-
>az login
68
-
...
69
-
# find the relevant subscription and set the az context. id = subscriptionId value in the azure.json.
70
-
>az account list
71
+
72
+
Find the relevant subscription and make sure it is selected (the same subscriptionId should be set into azure.json)
73
+
74
+
```bash
75
+
> az account list
71
76
{
72
77
"cloudName": "AzureCloud",
73
78
"id": "<subscriptionId GUID>",
@@ -79,22 +84,48 @@ A Service Principal with a minimum access level of contribute to the resource gr
79
84
"name": "name",
80
85
"type": "user"
81
86
}
82
-
>az account set -s id
87
+
88
+
# select the subscription
89
+
> az account set -s <subscriptionId GUID>
83
90
...
84
-
>az group show --name externaldns
91
+
```
92
+
Create the service principal
93
+
94
+
``` bash
95
+
> az ad sp create-for-rbac -n ExternalDnsServicePrincipal
96
+
{
97
+
"appId": "appId GUID", <-- aadClientId value
98
+
...
99
+
"password": "password", <-- aadClientSecret value
100
+
"tenant": "AzureAD Tenant Id"<-- tenantId value
101
+
}
102
+
```
103
+
104
+
Assign the rights for the service principal
105
+
106
+
```
107
+
# find out the resource ids of the resource group where the dns zone is deployed, and the dns zone itself
# assign the rights to the created service principal, using the resource ids from previous step
122
+
123
+
# 1. as a reader to the resource group
124
+
> az role assignment create --role "Reader" --assignee <appId GUID> --scope <resource group resource id>
125
+
126
+
# 2. as a contributor to DNS Zone itself
127
+
> az role assignment create --role "Contributor" --assignee <appId GUID> --scope <dns zone resource id>
128
+
98
129
```
99
130
100
131
Now you can create a file named 'azure.json' with values gathered above and with the structure of the example above. Use this file to create a Kubernetes secret:
0 commit comments