added uniqueness to container names for storage accounts for custom image uri

This commit is contained in:
Arjun Roy Chaudhuri 2016-11-23 16:14:48 -08:00
parent fd7cbc3cc8
commit 17b8539365
3 changed files with 8 additions and 3 deletions

View File

@ -343,11 +343,16 @@ public class AzureVMManagementServiceDelegate {
rmClient.getResourceGroupsOperations().createOrUpdate(resourceGroupName, new ResourceGroup(location));
try
{
StorageAccountCreateParameters createParams = new StorageAccountCreateParameters();
createParams.setLocation(location);
createParams.setAccountType(AccountType.StandardLRS);
storageClient.getStorageAccountsOperations().create(resourceGroupName, targetStorageAccount, createParams);
}catch (Exception e)
{
LOGGER.log(Level.INFO, e.getMessage());
}
// Get the storage account name and key
String storageAccountKey = storageClient.getStorageAccountsOperations().listKeys(resourceGroupName, targetStorageAccount)
.getStorageAccountKeys().getKey1();

View File

@ -10,7 +10,7 @@
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"publicIPAddressType": "Dynamic",
"storageAccountContainerName": "vhds",
"storageAccountContainerName": "[uniqueString(resourceGroup().id, deployment().name)]",
"storageAccountType": "Standard_LRS"
},
"resources": [

View File

@ -13,7 +13,7 @@
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"publicIPAddressType": "Dynamic",
"storageAccountContainerName": "vhds",
"storageAccountContainerName": "[uniqueString(resourceGroup().id, deployment().name)]",
"storageAccountType": "Standard_LRS",
"startupScriptURI": "",
"startupScriptName": "",