49
49
LOCATION=" ${1} "
50
50
RESOURCE_GROUP=" ${2} "
51
51
AZURE_STORAGE_ACCOUNT=" oidcissuer$( openssl rand -hex 4) "
52
- AZURE_STORAGE_CONTAINER=" oidc"
53
- SERVICE_ACCOUNT_ISSUER=" https://${AZURE_STORAGE_ACCOUNT} .blob.core.windows.net/${AZURE_STORAGE_CONTAINER} /"
52
+ # This $web container is a special container that serves static web content without requiring public access enablement.
53
+ # See https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website
54
+ AZURE_STORAGE_CONTAINER=" \$ web"
54
55
55
56
validate () {
56
57
# check if user is logged into azure cli
@@ -74,12 +75,15 @@ create_azure_blob_storage_account() {
74
75
75
76
if ! az storage account show --name " ${AZURE_STORAGE_ACCOUNT} " --resource-group " ${RESOURCE_GROUP} " > /dev/null 2>&1 ; then
76
77
echo " Creating storage account '${AZURE_STORAGE_ACCOUNT} ' in '${RESOURCE_GROUP} '"
77
- az storage account create --resource-group " ${RESOURCE_GROUP} " --name " ${AZURE_STORAGE_ACCOUNT} " --allow-blob-public-access true -- output none --only-show-errors
78
+ az storage account create --resource-group " ${RESOURCE_GROUP} " --name " ${AZURE_STORAGE_ACCOUNT} " --output none --only-show-errors
78
79
fi
79
80
81
+ # Enable static website serving
82
+ az storage blob service-properties update --account-name " ${AZURE_STORAGE_ACCOUNT} " --static-website --output none --only-show-errors
83
+
80
84
if ! az storage container show --name " ${AZURE_STORAGE_CONTAINER} " --account-name " ${AZURE_STORAGE_ACCOUNT} " > /dev/null 2>&1 ; then
81
85
echo " Creating storage container '${AZURE_STORAGE_CONTAINER} ' in '${AZURE_STORAGE_ACCOUNT} '"
82
- az storage container create --name " ${AZURE_STORAGE_CONTAINER} " --account-name " ${AZURE_STORAGE_ACCOUNT} " --public-access blob -- output none --only-show-errors
86
+ az storage container create --name " ${AZURE_STORAGE_CONTAINER} " --account-name " ${AZURE_STORAGE_ACCOUNT} " --output none --only-show-errors
83
87
fi
84
88
}
85
89
@@ -124,6 +128,8 @@ upload_to_blob() {
124
128
}
125
129
126
130
create_kind_cluster () {
131
+ SERVICE_ACCOUNT_ISSUER=$( az storage account show --name " ${AZURE_STORAGE_ACCOUNT} " -o json | jq -r .primaryEndpoints.web)
132
+
127
133
if [ " ${SKIP_CLUSTER:- } " = " true" ]; then
128
134
echo " Skipping cluster creation"
129
135
return
0 commit comments