Skip to content

Commit 72dc0e6

Browse files
CSPL-4208: Fix aks integration test setup (#1609)
* try --no-ssh-key for aks create * add role assignment * set servicePrincipal * comment dependency for now * comment dependency for now * use object id * remove aad graph api * update azure cli version * update azure cli version * update azure cli version * update azure cli version * cleanup
1 parent 9c9902b commit 72dc0e6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ REVIEWERS=vivekr-splunk,rlieberman-splunk,patrykw-splunk,Igor-splunk,kasiakoziol
33
GO_VERSION=1.23.0
44
AWSCLI_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.6.zip
55
KUBECTL_VERSION=v1.29.1
6-
AZ_CLI_VERSION=2.30.0
6+
AZ_CLI_VERSION=2.79.0
77
EKSCTL_VERSION=v0.215.0
88
EKS_CLUSTER_K8_VERSION=1.34
99
EKS_INSTANCE_TYPE=m5.2xlarge

.github/workflows/int-test-azure-workflow.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,18 @@ jobs:
7575
with:
7676
azcliversion: ${{ steps.dotenv.outputs.AZ_CLI_VERSION }}
7777
inlineScript: |
78-
az aks create -n ${{ env.TEST_CLUSTER_NAME }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --generate-ssh-keys -l westus --service-principal ${{ secrets.AZURE_CREDENTIALS_CLIENT_ID }} --client-secret ${{ secrets.AZURE_CREDENTIALS_CLIENT_SECRET }} --node-count ${{ env.CLUSTER_WORKERS }} --node-vm-size standard_d8_v3
78+
# Use Microsoft Graph-compatible SP lookup
79+
SP_OBJECT_ID=$(az ad sp list --filter "appId eq '${{ secrets.AZURE_CREDENTIALS_CLIENT_ID }}'" --query "[].id" --output tsv)
80+
if [ -z "$SP_OBJECT_ID" ]; then
81+
echo "Service Principal Object ID not found. Check AZURE_CREDENTIALS_CLIENT_ID permission/scopes."
82+
exit 1
83+
fi
84+
85+
# Assign AcrPull role
86+
az role assignment create --assignee-object-id $SP_OBJECT_ID --assignee-principal-type ServicePrincipal --role AcrPull --scope $(az acr show --name ${{ secrets.AZURE_CONTAINER_REGISTRY }} --query id --output tsv)
87+
88+
# Create AKS
89+
az aks create -n ${{ env.TEST_CLUSTER_NAME }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --no-ssh-key -l westus --service-principal ${{ secrets.AZURE_CREDENTIALS_CLIENT_ID }} --client-secret ${{ secrets.AZURE_CREDENTIALS_CLIENT_SECRET }} --node-count ${{ env.CLUSTER_WORKERS }} --node-vm-size standard_d8_v3
7990
- name: Wait for Cluster to be Ready
8091
uses: azure/CLI@v1
8192
with:

0 commit comments

Comments
 (0)