File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,17 @@ create_aks_cluster() {
201201 sleep 5
202202 done
203203
204+ # If storage account var is set:
205+ if [ -n " ${AZURE_STORAGE_ACCOUNT} " ]; then
206+ echo " assigning storage blob data reader role to the service principal"
207+ until az role assignment create --assignee-object-id " ${AKS_MI_OBJECT_ID} " --role " Storage Blob Data Reader" \
208+ --scope " /subscriptions/${AZURE_SUBSCRIPTION_ID} /resourceGroups/${AZURE_STORAGE_ACCOUNT_RESOURCE_GROUP} /providers/Microsoft.Storage/storageAccounts/${AZURE_STORAGE_ACCOUNT} /blobServices/default/containers/${AZURE_BLOB_CONTAINER_NAME} " \
209+ --assignee-principal-type ServicePrincipal; do
210+ echo " retrying to assign storage blob data reader role to the service principal"
211+ sleep 5
212+ done
213+ fi
214+
204215 echo " using ASO_CREDENTIAL_SECRET_MODE as podidentity"
205216 ASO_CREDENTIAL_SECRET_MODE=" podidentity"
206217}
You can’t perform that action at this time.
0 commit comments