added uniqueness to container names for storage accounts for custom image uri
This commit is contained in:
parent
fd7cbc3cc8
commit
17b8539365
@ -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();
|
||||
|
@ -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": [
|
||||
|
@ -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": "",
|
||||
|
Loading…
Reference in New Issue
Block a user