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
{{ message }}
This repository was archived by the owner on Apr 13, 2020. It is now read-only.
az storage table create -n $t --account-name $sa_name
224
+
start=$((start + wait_seconds))
225
+
done
226
+
if [ "$sat_exists"!="true" ];then
227
+
echo"The table '$t' could not be created"
228
+
exit 1
229
+
fi
230
+
fi
231
+
fi
232
+
}
233
+
234
+
functionstorage_account_cors_enabled () {
235
+
sa_name=$1
236
+
action=$2
237
+
cors_enabled_result=$(az storage cors list --services t --account-name $sa_name| jq '.[] | select((.Service=="table") and (.AllowedMethods=="GET") and (.AllowedOrigins=="http://localhost:4040")) != null')
238
+
239
+
if [ "$cors_enabled_result"="true" ];then
240
+
echo"The storage account '$sa_name' has cors enabled"
241
+
else
242
+
echo"The storage account '$sa_name' does not have cors enabled"
243
+
if [ "$action"=="fail" ];then
244
+
exit 1
245
+
fi
246
+
if [ "$action"=="enable" ];then
247
+
echo"Enable cors in storage account '$sa_name'"
248
+
az storage cors add --methods "GET" --origins "http://localhost:4040" --services t --allowed-headers "*" --exposed-headers "*" --account-name $sa_name
249
+
fi
250
+
if [ "$action"=="wait" ];then
251
+
total_wait_seconds=25
252
+
start=0
253
+
wait_seconds=5
254
+
while [ $start-lt$total_wait_seconds ];do
255
+
cors_enabled_result=$(az storage cors list --services t --account-name $sa_name| jq '.[] | select((.Service=="table") and (.AllowedMethods=="GET") and (.AllowedOrigins=="http://localhost:4040")) != null')
256
+
if [ "$cors_enabled_result"="true" ];then
257
+
echo"The storage account '$sa_name' has cors enabled"
258
+
break
259
+
fi
260
+
echo"Wait $wait_seconds seconds..."
261
+
sleep $wait_seconds
262
+
start=$((start + wait_seconds))
263
+
done
264
+
if [ "$cors_enabled_result"!="true" ];then
265
+
echo"The storage account '$sa_name' does not have cors enabled"
0 commit comments