Skip to content

Commit e517e0f

Browse files
authored
Add Azure Cloud Name support for sovereign cloud environments (e.g. AzureChinaCloud) (#65)
1 parent 21fc211 commit e517e0f

8 files changed

Lines changed: 105 additions & 38 deletions

File tree

AZURE.md

Lines changed: 76 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,62 @@ helm version
7777

7878
There are **two authentication methods** available for the credential provider:
7979

80-
- **Option A: Nodepool Managed Identity** (Steps 1 → 2 → 3A4) — Uses the AKS nodepool's user-assigned managed identity to authenticate via Azure IMDS.
80+
- **Option A: Nodepool Managed Identity** (Steps 1 → 2 → 34A → 5) — Uses the AKS nodepool's user-assigned managed identity to authenticate via Azure IMDS.
8181
> **Choose this when:** You want a straightforward setup, all nodes in the pool can share the same identity, and you don't need per-workload credential isolation.
8282
83-
- **Option B: Workload Identity** (Steps 1 → 2 → 3B4) — Uses Kubernetes projected service account tokens. Provides better security isolation as each service account can have its own identity.
83+
- **Option B: Workload Identity** (Steps 1 → 2 → 34B → 5) — Uses Kubernetes projected service account tokens. Provides better security isolation as each service account can have its own identity.
8484
> **Choose this when:** You need fine-grained, per-service-account access control, want to follow the zero-trust principle, or your organization requires workload-level identity isolation.
8585
8686
The setup process consists of the following steps:
8787

88-
1. **Azure AD App Registration** - Create an enterprise application in Azure AD
89-
2. **Federated Identity Credentials** - Configure AKS nodepool access to the Azure App
90-
3. **JFrog Artifactory OIDC Configuration** - Choose one of:
91-
- **Step 3A:** Configure using Nodepool Managed Identity
92-
- **Step 3B:** Configure using Workload Identity (Projected Service Account Tokens)
93-
4. **Deploy Credentials Provider** - Deploy the credential provider using Helm
88+
1. **Identify Azure Cloud Name** - Determine your Azure cloud environment (optional for `AzureCloud`, required for sovereign clouds)
89+
2. **Azure AD App Registration** - Create an enterprise application in Azure AD
90+
3. **Federated Identity Credentials** - Configure AKS nodepool access to the Azure App
91+
4. **JFrog Artifactory OIDC Configuration** - Choose one of:
92+
- **Step 4A:** Configure using Nodepool Managed Identity
93+
- **Step 4B:** Configure using Workload Identity (Projected Service Account Tokens)
94+
5. **Deploy Credentials Provider** - Deploy the credential provider using Helm
9495

9596
---
9697

97-
## Step 1: 🔐 Azure AD App Registration
98+
## Step 1: 🌍 Identify Azure Cloud Name and Endpoints
99+
100+
Before configuring the credential provider, you need to identify which Azure cloud environment you're using and set the appropriate endpoints. Different Azure clouds have different endpoints for Microsoft Graph and Active Directory authentication.
101+
102+
> **ℹ️ Note:** If you are using the default Azure public cloud (`AzureCloud`), `azure_cloud_name` is optional and defaults to `AzureCloud`. You can skip setting it in your Helm values. For sovereign clouds like `AzureChinaCloud`, you must set it explicitly.
103+
104+
### 🔍 Determine Your Azure Cloud and Endpoints
105+
106+
Azure operates in multiple sovereign clouds, each with different service endpoints. Identify your cloud environment from the table below and set the corresponding variables:
107+
108+
| Cloud Name | Microsoft Graph (`GRAPH_ENDPOINT`) | Active Directory (`AD_ENDPOINT`) |
109+
|------------|----------------|------------------|
110+
| `AzureCloud` | `https://graph.microsoft.com` | `https://login.microsoftonline.com` |
111+
| `AzureChinaCloud` | `https://microsoftgraph.chinacloudapi.cn` | `https://login.partner.microsoftonline.cn` |
112+
113+
Set the variables based on your cloud environment:
114+
115+
```bash
116+
# Get your Azure cloud name from the active cloud eg. AzureCloud, AzureChinaCloud
117+
CLOUD_NAME=$(az cloud show --query name -o tsv)
118+
119+
# Set the endpoints from the table above based on your CLOUD_NAME
120+
GRAPH_ENDPOINT="https://graph.microsoft.com"
121+
AD_ENDPOINT="https://login.microsoftonline.com"
122+
123+
echo "Azure Cloud Name: $CLOUD_NAME"
124+
echo "Microsoft Graph Endpoint: $GRAPH_ENDPOINT"
125+
echo "Active Directory Endpoint: $AD_ENDPOINT"
126+
```
127+
128+
> **💾 Important:** Save these values for later use:
129+
> - `CLOUD_NAME` (also called `azure_cloud_name`)
130+
> - `GRAPH_ENDPOINT` (used in subsequent steps for Azure AD API calls)
131+
> - `AD_ENDPOINT` (used as the issuer URL for OIDC configuration)
132+
133+
---
134+
135+
## Step 2: 🔐 Azure AD App Registration
98136

99137
The Azure AD App Registration serves as the identity that authenticates with JFrog Artifactory via OIDC.
100138

@@ -158,7 +196,7 @@ Setting **Assignment Required** to **Yes** ensures that only explicitly assigned
158196
SPN_OBJECT_ID=$(az ad sp list --filter "appId eq '$APP_CLIENT_ID'" --query "[0].id" -o tsv)
159197

160198
az rest --method PATCH \
161-
--uri "https://graph.microsoft.com/v1.0/servicePrincipals/$SPN_OBJECT_ID" \
199+
--uri "$GRAPH_ENDPOINT/v1.0/servicePrincipals/$SPN_OBJECT_ID" \
162200
--headers "Content-Type=application/json" \
163201
--body '{"appRoleAssignmentRequired": true}'
164202
```
@@ -179,7 +217,7 @@ Or via CLI:
179217
OBJECT_ID=$(az ad app show --id "$APP_CLIENT_ID" --query "id" -o tsv)
180218

181219
az rest --method PATCH \
182-
--uri "https://graph.microsoft.com/v1.0/applications/$OBJECT_ID" \
220+
--uri "$GRAPH_ENDPOINT/v1.0/applications/$OBJECT_ID" \
183221
--headers "Content-Type=application/json" \
184222
--body '{
185223
"appRoles": [{
@@ -204,7 +242,7 @@ ROLE_ID=$(az ad sp show --id "$SPN_OBJECT_ID" --query "appRoles[?value=='Task.Re
204242

205243
```bash
206244
az rest --method POST \
207-
--uri "https://graph.microsoft.com/v1.0/servicePrincipals/$SPN_OBJECT_ID/appRoleAssignments" \
245+
--uri "$GRAPH_ENDPOINT/v1.0/servicePrincipals/$SPN_OBJECT_ID/appRoleAssignments" \
208246
--headers "Content-Type=application/json" \
209247
--body "{
210248
\"principalId\": \"$SPN_OBJECT_ID\",
@@ -217,7 +255,7 @@ After this, the credential provider will continue to work via the federated cred
217255

218256
### ⚙️ Configure Access Token Version
219257

220-
The credential provider uses `https://login.microsoftonline.com` as the issuer URL (instead of the older `https://sts.windows.net/`). Azure requires you to set `requestedAccessTokenVersion` to `2` for this to work.
258+
The credential provider uses the Active Directory endpoint (e.g., `$AD_ENDPOINT`) as the issuer URL. Azure requires you to set `requestedAccessTokenVersion` to `2` for this to work.
221259

222260
```bash
223261
# Get the object ID of the app created above
@@ -226,7 +264,7 @@ OBJECT_ID=$(az ad app show --id "$APP_CLIENT_ID" --query "id" -o tsv)
226264
# Update the access token version
227265
az rest --method PATCH \
228266
--headers "Content-Type=application/json" \
229-
--uri "https://graph.microsoft.com/v1.0/applications/$OBJECT_ID" \
267+
--uri "$GRAPH_ENDPOINT/v1.0/applications/$OBJECT_ID" \
230268
--body '{"api":{"requestedAccessTokenVersion": 2}}'
231269
```
232270

@@ -238,9 +276,12 @@ az rest --method PATCH \
238276
4. Set `"requestedAccessTokenVersion": 2` in the JSON
239277
5. Click **Save**
240278

279+
> **💾 Important:** For AzureChinaCloud, the key will be:
280+
> `"accessTokenAcceptedVersion": 2`
281+
241282
---
242283

243-
## Step 2: 🔗 Federated Identity Credentials
284+
## Step 3: 🔗 Federated Identity Credentials
244285

245286
Federated credentials allow the AKS nodepool's managed identity to exchange tokens with the Azure AD App Registration. This establishes trust between your AKS cluster and Azure AD.
246287

@@ -311,7 +352,7 @@ echo "Nodepool Client ID: $NODEPOOL_CLIENT_ID"
311352
# Use the kubelet identity object ID (or nodepool if different)
312353
FEDERATED_CREDENTIAL_NAME="aks-nodepool-federated-credential"
313354
AUDIENCE="api://AzureADTokenExchange"
314-
ISSUER="https://login.microsoftonline.com/$TENANT_ID/v2.0"
355+
ISSUER="$AD_ENDPOINT/$TENANT_ID/v2.0"
315356

316357
# Create the federated credential
317358
az ad app federated-credential create \
@@ -333,13 +374,13 @@ az ad app federated-credential list --id "$APP_CLIENT_ID"
333374
```
334375

335376
You should see your federated credential with:
336-
- `issuer`: `https://login.microsoftonline.com/<TENANT_ID>/v2.0`
377+
- `issuer`: `<AD_ENDPOINT>/<TENANT_ID>/v2.0` (e.g., `https://login.microsoftonline.com/<TENANT_ID>/v2.0` for AzureCloud)
337378
- `subject`: Your kubelet/nodepool identity object ID
338379
- `audiences`: `["api://AzureADTokenExchange"]`
339380

340381
---
341382

342-
## Step 3A: 🐸 JFrog Artifactory OIDC Configuration
383+
## Step 4A: 🐸 JFrog Artifactory OIDC Configuration
343384

344385
Configure JFrog Artifactory to accept OIDC tokens from Azure. This involves creating an OIDC provider and an identity mapping in Artifactory.
345386

@@ -365,10 +406,10 @@ curl -X POST "https://$ARTIFACTORY_URL/access/api/v1/oidc" \
365406
-H "Authorization: Bearer $ARTIFACTORY_ADMIN_TOKEN" \
366407
-d "{
367408
\"name\": \"$OIDC_PROVIDER_NAME\",
368-
\"issuer_url\": \"https://login.microsoftonline.com/$TENANT_ID/v2.0\",
409+
\"issuer_url\": \"$AD_ENDPOINT/$TENANT_ID/v2.0\",
369410
\"description\": \"OIDC provider for Azure AKS\",
370411
\"provider_type\": \"Azure\",
371-
\"token_issuer\": \"https://login.microsoftonline.com/$TENANT_ID/v2.0\",
412+
\"token_issuer\": \"$AD_ENDPOINT/$TENANT_ID/v2.0\",
372413
\"azure_app_id\": \"$APP_CLIENT_ID\",
373414
\"audience\": \"$APP_CLIENT_ID\",
374415
\"use_default_proxy\": false
@@ -392,7 +433,7 @@ curl -X POST "https://$ARTIFACTORY_URL/access/api/v1/oidc/$OIDC_PROVIDER_NAME/id
392433
\"description\": \"Azure OIDC identity mapping\",
393434
\"claims\": {
394435
\"aud\": \"$APP_CLIENT_ID\",
395-
\"iss\": \"https://login.microsoftonline.com/$TENANT_ID/v2.0\"
436+
\"iss\": \"$AD_ENDPOINT/$TENANT_ID/v2.0\"
396437
},
397438
\"token_spec\": {
398439
\"username\": \"$ARTIFACTORY_USER\",
@@ -408,7 +449,7 @@ curl -X POST "https://$ARTIFACTORY_URL/access/api/v1/oidc/$OIDC_PROVIDER_NAME/id
408449
<summary><strong>📝 Configuration Notes</strong></summary>
409450

410451
- The `claims.aud` must match your `azure_app_client_id`
411-
- The `claims.iss` must match the Azure AD issuer URL: `https://login.microsoftonline.com/$TENANT_ID/v2.0`
452+
- The `claims.iss` must match the Azure AD issuer URL: `$AD_ENDPOINT/$TENANT_ID/v2.0` (e.g., `https://login.microsoftonline.com/$TENANT_ID/v2.0` for AzureCloud)
412453
- The `token_spec.username` must be an existing Artifactory user
413454
- Ensure the user has permissions to pull images from your repositories
414455

@@ -430,7 +471,7 @@ curl -X GET "https://$ARTIFACTORY_URL/access/api/v1/oidc/$OIDC_PROVIDER_NAME" \
430471

431472
---
432473

433-
## Step 3B: Using Projected Service Account Tokens (Workload Identity)
474+
## Step 4B: Using Projected Service Account Tokens (Workload Identity)
434475

435476
Instead of using the Nodepool's Managed Identity, you can use **Kubernetes Workload Identity**. This allows the Credential Provider to use a specific Kubernetes Service Account to authenticate with Artifactory. This method provides better security isolation as each service account can have its own Azure AD app registration.
436477

@@ -444,7 +485,7 @@ Instead of using the Nodepool's Managed Identity, you can use **Kubernetes Workl
444485

445486
4. The kubelet uses the registry token to authenticate and pull the container image
446487

447-
### Step 3B.1: ✅ Enable OIDC Issuer on AKS
488+
### Step 4B.1: ✅ Enable OIDC Issuer on AKS
448489

449490
First, ensure your cluster has the OIDC issuer enabled to support Workload Identity:
450491

@@ -471,7 +512,7 @@ echo "Service Account Issuer: $SERVICE_ACCOUNT_ISSUER"
471512

472513
> **💾 Important:** Save the `SERVICE_ACCOUNT_ISSUER` URL - you'll need it for Artifactory OIDC configuration.
473514
474-
### Step 3B.2: 👤 Configure the Kubernetes Service Account
515+
### Step 4B.2: 👤 Configure the Kubernetes Service Account
475516

476517
Create a Service Account that the Credential Provider will use to project the tokens:
477518

@@ -496,7 +537,7 @@ kubectl annotate serviceaccount "$SERVICE_ACCOUNT_NAME" \
496537

497538
> **ℹ️ Note:** The `JFrogExchange="true"` annotation tells the credential provider to use the projected service account token instead of the nodepool's managed identity.
498539
499-
### Step 3B.3: 🐸 Update JFrog Artifactory OIDC Configuration
540+
### Step 4B.3: 🐸 Update JFrog Artifactory OIDC Configuration
500541

501542
You must point Artifactory to your AKS Cluster's OIDC Issuer instead of the global Azure Login URL for this flow:
502543

@@ -547,7 +588,7 @@ curl -X POST "https://$ARTIFACTORY_URL/access/api/v1/oidc/aks-workload-identity/
547588
548589
---
549590

550-
## Step 4: 🚀 Deploy Credentials Provider
591+
## Step 5: 🚀 Deploy Credentials Provider
551592

552593
Deploy the credential provider using Helm. For manual deployment with Kubernetes manifests, refer to the [Kubernetes Kubelet Credential Provider documentation](https://kubernetes.io/docs/tasks/administer-cluster/kubelet-credential-provider/).
553594

@@ -564,6 +605,7 @@ You can use the following commands to print the values you need:
564605

565606
```bash
566607
echo "artifactory_url: $ARTIFACTORY_URL"
608+
echo "azure_cloud_name: $CLOUD_NAME"
567609
echo "azure_tenant_id: $TENANT_ID"
568610
echo "azure_app_client_id: $APP_CLIENT_ID"
569611
echo "azure_nodepool_client_id: $NODEPOOL_CLIENT_ID"
@@ -573,6 +615,7 @@ echo "jfrog_oidc_provider_name: $OIDC_PROVIDER_NAME"
573615

574616
| Configuration Value | Description | Example |
575617
|---------------------|-------------|---------|
618+
| `azure_cloud_name` | Your Azure Cloud Name (optional, defaults to `AzureCloud`) | `AzureCloud` `AzureChinaCloud` |
576619
| `azure_tenant_id` | Your Azure AD tenant ID | `12345678-1234-1234-1234-123456789012` |
577620
| `azure_app_client_id` | The Azure AD application client ID | `87654321-4321-4321-4321-210987654321` |
578621
| `azure_nodepool_client_id` | Client ID of the user-assigned managed identity attached to the AKS nodepool (also added to the app registration's federated credential) | `11111111-2222-3333-4444-555555555555` |
@@ -582,7 +625,7 @@ echo "jfrog_oidc_provider_name: $OIDC_PROVIDER_NAME"
582625

583626
#### Configuration for Traditional Nodepool Identity
584627

585-
Use this configuration if you're using the **nodepool's managed identity** (Steps 1-3A):
628+
Use this configuration if you're using the **nodepool's managed identity** (Steps 2-4A):
586629

587630
```yaml
588631
providerConfig:
@@ -595,6 +638,7 @@ providerConfig:
595638
enabled: false # Set to false for nodepool identity
596639
azure:
597640
enabled: true
641+
azure_cloud_name: "<cloud-name>" # Optional, defaults to AzureCloud
598642
azure_tenant_id: "<tenant-id>"
599643
azure_app_client_id: "<app-client-id>"
600644
azure_nodepool_client_id: "<nodepool-client-id>"
@@ -607,7 +651,7 @@ rbac:
607651
608652
#### Configuration for Workload Identity (Projected Service Account Tokens)
609653
610-
Use this configuration if you're using **Kubernetes Workload Identity** (Steps 3B):
654+
Use this configuration if you're using **Kubernetes Workload Identity** (Steps 4B):
611655
612656
```yaml
613657
providerConfig:
@@ -621,6 +665,7 @@ providerConfig:
621665
serviceAccountTokenAudience: "<app-audience>"
622666
azure:
623667
enabled: true
668+
azure_cloud_name: "<cloud-name>" # Optional, defaults to AzureCloud
624669
azure_app_client_id: "<app-client-id>"
625670
azure_app_audience: "<app-audience>"
626671
jfrog_oidc_provider_name: "<oidc-provider-name>"
@@ -631,7 +676,7 @@ rbac:
631676
# Note: You must also create the service account and annotate it as described in Step 3B.2
632677
```
633678

634-
> **ℹ️ Note:** When using Workload Identity, ensure the service account `jfrog-provider-sa` is annotated with `JFrogExchange="true"` and the Azure App Client ID as shown in Step 3B.2.
679+
> **ℹ️ Note:** When using Workload Identity, ensure the service account `jfrog-provider-sa` is annotated with `JFrogExchange="true"` and the Azure App Client ID as shown in Step 4B.2.
635680
636681

637682
### 📦 Install with Helm
@@ -714,3 +759,4 @@ For troubleshooting help, see the [debug documentation](./debug.md).
714759
- [JFrog Artifactory OIDC Documentation](https://www.jfrog.com/confluence/display/JFROG/Access+Tokens#AccessTokens-OIDCIntegration)
715760
- [Kubernetes Kubelet Credential Provider](https://kubernetes.io/docs/tasks/administer-cluster/kubelet-credential-provider/)
716761
- [Main README](./README.md)
762+

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,3 @@ For detailed debugging instructions, troubleshooting steps, and common issues, s
159159
- [🔷 Azure Setup Guide](./AZURE.md) - Complete Azure AKS setup instructions
160160
- [🔵 GCP Setup Guide](./GCP.md) - Complete GCP GKE setup instructions
161161
- [🐛 Debug Documentation](./debug.md) - Troubleshooting and debugging guide
162-

debug.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Example for Azure:
7070

7171
```bash
7272
export artifactory_url=YOUR_ARTIFACTORY_URL
73+
export azure_cloud_name=YOUR_AZURE_CLOUD_NAME
7374
export azure_app_client_id=YOUR_AZURE_APP_CLIENT_ID
7475
export azure_tenant_id=YOUR_AZURE_TENANT_ID
7576
export azure_nodepool_client_id=YOUR_AZURE_NODEPOOL_CLIENT_ID

examples/azure-values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ providerConfig:
77
azure:
88
enabled: true
99
azure_app_client_id: "<azure-app-client-id>"
10+
# azure_cloud_name: "AzureCloud"
1011
azure_tenant_id: "<azure-tenant-id>"
1112
azure_app_audience: "api://AzureADTokenExchange"
1213
jfrog_oidc_provider_name: "<jfrog-oidc-provider-name>"

helm/templates/configmap-provider.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ data:
148148
value: "{{ .artifactoryUrl }}"
149149
- name: azure_app_client_id
150150
value: "{{ .azure.azure_app_client_id }}"
151+
{{- if .azure.azure_cloud_name }}
152+
- name: azure_cloud_name
153+
value: "{{ .azure.azure_cloud_name }}"
154+
{{- end }}
151155
- name: azure_tenant_id
152156
value: "{{ .azure.azure_tenant_id }}"
153157
- name: azure_nodepool_client_id

helm/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ providerConfig:
105105
azure:
106106
enabled: false
107107
azure_app_client_id: ""
108+
# azure_cloud_name: "AzureCloud"
108109
azure_tenant_id: ""
109110
azure_app_audience: ""
110111
jfrog_oidc_provider_name: ""

internal/handlers/azure.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727

2828
const (
2929
AZURE_IDENTITY_ENDPOINT = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2023-11-01&resource=$audience&client_id=$nodepool_client_id"
30-
AZURE_OIDC_TOKEN_URL = "https://login.microsoftonline.com/$tenant/oauth2/v2.0/token"
3130
AZURE_GRANT_TYPE = "client_credentials"
3231
AZURE_SCOPE = "$client_id/.default"
3332
AZURE_METADATA_URL = "http://169.254.169.254/metadata/instance?api-version=2021-02-01"
@@ -59,6 +58,18 @@ type JWTHeader struct {
5958
X5t string `json:"x5t,omitempty"`
6059
}
6160

61+
// getAzureADEndpoint returns the Azure Active Directory endpoint based on the cloud name
62+
func getAzureADEndpoint(cloudName string) string {
63+
switch cloudName {
64+
case "AzureCloud":
65+
return "https://login.microsoftonline.com"
66+
case "AzureChinaCloud":
67+
return "https://login.partner.microsoftonline.cn"
68+
default:
69+
return "https://login.microsoftonline.com"
70+
}
71+
}
72+
6273
// GetAzureClusterIdentity retrieves the identity token from the kubelet managed identity
6374
func GetAzureClusterIdentity(s *service.Service, ctx context.Context, azureAppAudience, azureNodepoolClientId string) (string, error) {
6475
tokenEndpoint := strings.Replace(AZURE_IDENTITY_ENDPOINT, "$audience", azureAppAudience, 1)
@@ -99,15 +110,18 @@ func GetAzureClusterIdentity(s *service.Service, ctx context.Context, azureAppAu
99110

100111
// GetAzureOIDCToken retrieves an OIDC token from Azure using managed identity
101112
func GetAzureOIDCToken(s *service.Service, ctx context.Context,
102-
tenantId, clientId, azureNodepoolClientId, azureAppAudience string) (string, error) {
113+
tenantId, clientId, azureNodepoolClientId, azureAppAudience, cloudName string) (string, error) {
103114

104115
identityTokenAssertion, err := GetAzureClusterIdentity(s, ctx, azureAppAudience, azureNodepoolClientId)
105116
if err != nil {
106117
s.Logger.Error("GetAzureClusterIdentity failed: " + err.Error())
107118
return "", err
108119
}
109120

110-
oidc_url := strings.Replace(AZURE_OIDC_TOKEN_URL, "$tenant", tenantId, 1)
121+
// Get Azure AD endpoint based on cloud name
122+
azureADEndpoint := getAzureADEndpoint(cloudName)
123+
s.Logger.Info(fmt.Sprintf("Using Azure AD endpoint: %s for cloud: %s", azureADEndpoint, cloudName))
124+
oidcURL := fmt.Sprintf("%s/%s/oauth2/v2.0/token", azureADEndpoint, tenantId)
111125

112126
// Create url.Values for form data
113127
data := url.Values{}
@@ -119,7 +133,7 @@ func GetAzureOIDCToken(s *service.Service, ctx context.Context,
119133
data.Set("subject_token_type", "urn:ietf:params:oauth:token-type:jwt")
120134

121135
// Get oidc token
122-
req, err := http.NewRequestWithContext(ctx, "POST", oidc_url, strings.NewReader(data.Encode()))
136+
req, err := http.NewRequestWithContext(ctx, "POST", oidcURL, strings.NewReader(data.Encode()))
123137
if err != nil {
124138
return "", fmt.Errorf("NewRequestWithContext from azure oidc token failed: %v" + err.Error())
125139
}

0 commit comments

Comments
 (0)