Skip to content

Commit a130436

Browse files
committed
fixing a azure script bug
1 parent 66979f9 commit a130436

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

installers.zip

61 Bytes
Binary file not shown.

installers/azure/setup_azure_file_notification.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,20 @@ else
394394
fi
395395

396396
if az storage account show --name $STORAGE_ACCOUNT --resource-group $RESOURCE_GROUP 2>&1 | grep -q "ResourceNotFound" ; then
397-
az storage account create --name ${STORAGE_ACCOUNT} --resource-group ${RESOURCE_GROUP} --location $LOCATION >> $log_filename
398-
if [ $? -eq 0 ]; then
399-
echo "Step 3/14 : Successfully created storage account ${STORAGE_ACCOUNT}"
400-
echo "Step 3/14 : Successfully created storage account ${STORAGE_ACCOUNT}" >> $log_filename
397+
if az storage account show --name $STORAGE_ACCOUNT 2>&1 | grep -q "not found" ; then
398+
az storage account create --name ${STORAGE_ACCOUNT} --resource-group ${RESOURCE_GROUP} --location $LOCATION >> $log_filename
399+
if [ $? -eq 0 ]; then
400+
echo "Step 3/14 : Successfully created storage account ${STORAGE_ACCOUNT}"
401+
echo "Step 3/14 : Successfully created storage account ${STORAGE_ACCOUNT}" >> $log_filename
402+
else
403+
echo "Step 3/14 : Failed to create storage account ${STORAGE_ACCOUNT}"
404+
echo "Step 3/14 : Failed to create storage account ${STORAGE_ACCOUNT}" >> $log_filename
405+
exit
406+
fi
401407
else
402-
echo "Step 3/14 : Failed to create storage account ${STORAGE_ACCOUNT}"
403-
echo "Step 3/14 : Failed to create storage account ${STORAGE_ACCOUNT}" >> $log_filename
404-
exit
405-
fi
408+
echo "Step 3/14 : Storage Account with name ${STORAGE_ACCOUNT} is already taken by other resource group, please use different storage account and try again"
409+
echo "Step 3/14 : Storage Account with name ${STORAGE_ACCOUNT} is already taken by other resource group, please use different storage account and try again" >> $log_filename
410+
exit
406411
else
407412
echo "Step 3/14 : Storage Account with name ${STORAGE_ACCOUNT} exists and skipping the creation of storage account";
408413
echo "Step 3/14 : Storage Account with name ${STORAGE_ACCOUNT} exists and skipping the creation of storage account" >> $log_filename

0 commit comments

Comments
 (0)