This repository was archived by the owner on Jul 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,8 +124,15 @@ function Deploy-WTTAzureDWDatabase
124124
125125 # Create database using 2000 units
126126 WriteLabel(" Creating database '$DWDatabaseName '" )
127- $null = New-AzureRMSqlDatabase - RequestedServiceObjectiveName " DW2000" - ServerName $ServerName - DatabaseName $DWDatabaseName - Edition $DatabaseEdition - ResourceGroupName $WTTEnvironmentApplicationName - Verbose:$false
128- WriteValue(" Successful" )
127+ $azureDWExist = New-AzureRMSqlDatabase - RequestedServiceObjectiveName " DW2000" - ServerName $ServerName - DatabaseName $DWDatabaseName - Edition $DatabaseEdition - ResourceGroupName $WTTEnvironmentApplicationName - Verbose:$false
128+ if (! $azureDWExist )
129+ {
130+ WriteValue(" Unsuccessful" )
131+ }
132+ else
133+ {
134+ WriteValue(" Successful" )
135+ }
129136
130137 $DWServer = (Find-AzureRmResource - ResourceType " Microsoft.Sql/servers" - ResourceNameContains " primary" - ExpandProperties).properties.FullyQualifiedDomainName
131138 # Set working location
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ function New-WTTADFEnvironment
8080
8181 # Get StorageAccount Key
8282 $storageAccountKey = GetStorageAccountKey
83+ CreateStorageContainer($storageAccountKey )
8384
8485 # Set up Mapping Dictionary
8586 SetupMappingDictionary($storageAccountKey )
@@ -128,6 +129,25 @@ function GetStorageAccountKey()
128129 return $storageAccountKey
129130}
130131
132+ function CreateStorageContainer ($storageAccountKey )
133+ {
134+ try {
135+ # Get Context
136+ $context = New-AzureStorageContext - storageAccountName $ApplicationName - StorageAccountKey $storageAccountKey
137+
138+ # Create the container to store blob
139+ $container = New-AzureStorageContainer - Name ' productrec' - Context $context - ErrorAction Stop
140+ }catch {
141+ if ($error [0 ].CategoryInfo.Category -eq ' ResourceExists' ){
142+ Write-Host ' resource exists.'
143+ }else {
144+ Write-Host ' error.'
145+ }
146+ }
147+ Write-Host ' created.'
148+
149+ }
150+
131151function SetupMappingDictionary ($StorageAccountKey )
132152{
133153 # Set up the Mapping Dictionary
You can’t perform that action at this time.
0 commit comments