Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Updating template url location to production storage account (#14)
Browse files Browse the repository at this point in the history
* Bug fix in get-tenant function

* Adding urls for production storage accounts
  • Loading branch information
AyoOlubeko authored Apr 15, 2018
1 parent 7be2a07 commit 8fc65f3
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"trafficManagerRecoveryEndpointName": "[concat('events-wingtip-', variables('databasePerTenantSuffix'), '-', variables('recoveryLocation'), '-', variables('lowerCaseUser'))]",
"recoveryWebAppSku": "Standard",
"wtpEventsRecoveryApp": "[concat('events-wingtip-', variables('databasePerTenantSuffix'), '-', variables('recoveryLocation'), '-', variables('lowerCaseUser'))]",
"wtpEventsAppPackageUri": "https://wingtipsaas.blob.core.windows.net/packages-dpt/eventsAppPackage-v6.zip"
"wtpEventsAppPackageUri": "https://wingtipsaas.blob.core.windows.net/packages-dpt/eventsAppPackage.zip"
},
"resources": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"trafficManagerRecoveryEndpointName": "[concat('events-wingtip-', variables('databasePerTenantSuffix'), '-', variables('recoveryLocation'), '-', variables('lowerCaseUser'))]",
"recoveryWebAppSku": "Standard",
"wtpEventsRecoveryApp": "[concat('events-wingtip-', variables('databasePerTenantSuffix'), '-', variables('recoveryLocation'), '-', variables('lowerCaseUser'))]",
"wtpEventsAppPackageUri": "https://wingtipsaas.blob.core.windows.net/packages-dpt/eventsAppPackage-v6.zip"
"wtpEventsAppPackageUri": "https://wingtipsaas.blob.core.windows.net/packages-dpt/eventsAppPackage.zip"
},
"resources": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ while ($true)


# Exit recovery if all tenant databases have been recovered
if (($databaseRecoveryJob.State -eq "Completed") -and ($poolRecoveryJob.State -eq "Completed") -and ($serverRecoveryJob.State -eq "Completed") -and ($newTenantProvisioningJob.State -eq "Completed") -and ($tenantRecoveryJob.State -eq "Completed"))
if (($appRecoveryJob.State -eq "Completed") -and ($databaseRecoveryJob.State -eq "Completed") -and ($poolRecoveryJob.State -eq "Completed") -and ($serverRecoveryJob.State -eq "Completed") -and ($newTenantProvisioningJob.State -eq "Completed") -and ($tenantRecoveryJob.State -eq "Completed"))
{
Remove-Item -Path "$env:TEMP\profile.json" -ErrorAction SilentlyContinue
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,11 @@ elseif ((!$restoreSourceDatabase.DeletionDate) -and (!$restoreSourceDatabase.Ela
# Remove old catalog references in the restored tenant database
Remove-CatalogInfoFromTenantDatabase -TenantKey $restoredTenantKey -TenantDatabase $restoredTenantDatabase -ErrorAction Continue

# Create alias for restored tenant
$tenantAliasName = $TenantName + "-old"
$restoredTenantAlias = Set-TenantAlias `
-ResourceGroupName $catalogResourceGroup `
-WtpUser $WtpUser `
-TenantName $tenantAliasName `
-TenantServerName $restoredTenantDatabase.ServerName

# Add the restored tenant database to the catalog with <tenantname>_old
Add-TenantDatabaseToCatalog -Catalog $catalog `
-TenantName $restoredTenantName `
-TenantKey $restoredTenantKey `
-TenantDatabase $restoredTenantDatabase `
-TenantAlias $restoredTenantAlias
-TenantServerName $restoredTenantDatabase.ServerName `
-TenantDatabase $restoredTenantDatabase

Write-Output "Restored tenant '$restoredTenantName' is available for use."
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ if (!(Test-TenantKeyInCatalog -Catalog $catalog -TenantKey $tenantKey))
Write-Output "Setting tenant '$TenantName' offline in the catalog."

Set-TenantOffline -Catalog $catalog -TenantKey $tenantKey
$catalog = Get-Catalog -ResourceGroupName $WtpResourceGroupName -WtpUser $WtpUser

# Get tenant database that was active during the restore point period
$restoreSourceDatabase = Get-TenantDatabaseForRestorePoint -Catalog $catalog -TenantKey $tenantKey -RestorePoint $RestorePoint
Expand Down
3 changes: 2 additions & 1 deletion Learning Modules/Common/CatalogAndDatabaseManagement.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,8 @@ function Get-Tenant
throw "Tenant '$TenantName' not found in catalog."
}

$tenantServerName = $tenantShard.Shard.Location.Server
$fullyQualifiedTenantServerName = $tenantShard.Shard.Location.Server
$tenantServerName = $fullyQualifiedTenantServerName.split('.')[0]
$tenantDatabaseName = $tenantShard.Shard.Location.Database

# Find tenant server in Azure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ if ($DemoScenario -eq 5)
& $PSScriptRoot\Start-TicketDataExtractJob.ps1 `
-WtpResourceGroupName $wtpUser.ResourceGroupName `
-WtpUser $wtpUser.Name `
-JobExecutionCredentialName $config.JobAccountCredentialName `
-JobExecutionCredentialName $config.JobAgentCredentialName `
-TargetGroupName "TenantGroup" `
-OutputServer $outputServer `
-OutputDatabase $config.TenantAnalyticsDatabaseName `
-OutputServerCredentialName $config.JobAccountCredentialName `
-OutputServerCredentialName $config.JobAgentCredentialName `
-JobName "Extract all tenants ticket purchases to database"
exit
}
Expand All @@ -94,11 +94,11 @@ if ($DemoScenario -eq 6)
& $PSScriptRoot\Start-TicketDataExtractJob.ps1 `
-WtpResourceGroupName $wtpUser.ResourceGroupName `
-WtpUser $wtpUser.Name `
-JobExecutionCredentialName $config.JobAccountCredentialName `
-JobExecutionCredentialName $config.JobAgentCredentialName `
-TargetGroupName "TenantGroup-CS" `
-OutputServer $outputServer `
-OutputDatabase $config.TenantAnalyticsCSDatabaseName `
-OutputServerCredentialName $config.JobAccountCredentialName `
-OutputServerCredentialName $config.JobAgentCredentialName `
-JobName "Extract all tenants ticket purchases to columnstore database"
exit
}
Expand Down
6 changes: 3 additions & 3 deletions Learning Modules/Schema Management/DeployReferenceData.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SET @WtpUser = '<user>';
EXEC [jobs].sp_add_target_group @target_group_name = 'DemoServerGroup'

-- Add a server target member, includes all databases in tenant server
SET @server1 = 'tenants1-' + @WtpUser + '.database.windows.net'
SET @server1 = 'tenants1-dpt-' + @WtpUser + '.database.windows.net'

EXEC [jobs].sp_add_target_group_member
@target_group_name = 'DemoServerGroup',
Expand All @@ -19,7 +19,7 @@ EXEC [jobs].sp_add_target_group_member
@server_name=@server1

-- Add the database target member of the 'golden' database and analysis database
SET @server2 = 'catalog-' + @WtpUser + '.database.windows.net'
SET @server2 = 'catalog-dpt-' + @WtpUser + '.database.windows.net'

EXEC [jobs].sp_add_target_group_member
@target_group_name = 'DemoServerGroup',
Expand All @@ -33,7 +33,7 @@ EXEC [jobs].sp_add_target_group_member
@membership_type = 'Include',
@target_type = 'SqlDatabase',
@server_name=@server2,
@database_name='adhocanalytics'
@database_name='adhocreporting'

-- Add a job to deploy new reference data
EXEC jobs.sp_add_job
Expand Down
8 changes: 4 additions & 4 deletions Learning Modules/Schema Management/Utilities.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ $resourceGroupName = $wtpUser.ResourceGroupName
<#
Remove-AzureRmSqlJobAccount `
-ServerName $serverName `
-JobAccountName $($config.JobAccount) `
-JobAccountName $($config.JobAgent) `
-ResourceGroupName $resourceGroupName
#>

<#
Get-AzureRmSqlJobAccount `
-ServerName $serverName `
-JobAccountName $($config.JobAccount) `
-JobAccountName $($config.JobAgent) `
-ResourceGroupName $resourceGroupName
#>

<#
New-AzureRmSqlJobAccount `
-ServerName $serverName `
-JobAccountName $($config.JobAccount) `
-JobAccountName $($config.JobAgent) `
-ResourceGroupName $resourceGroupName `
-DatabaseName $($config.JobAccountDatabaseName)
-DatabaseName $($config.JobAgentDatabaseName)
#>
8 changes: 4 additions & 4 deletions Learning Modules/WtpConfig.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ function Get-Configuration
TenantServerRestoreBatchTemplate = "tenantserverrecoverybatchtemplate.json"
NewTenantResourcesProvisioningTemplate = "newtenantresourcestemplate.json"
ReconfigureTenantResourcesTemplate = "updatetenantresourcestemplate.json"
JobAccount = "jobaccount"
JobAccountDatabaseName = "jobaccount"
JobAccountDatabaseServiceObjective = "S2"
JobAccountCredentialName = "mydemocred"
JobAgent = "jobagent"
JobAgentDatabaseName = "jobagent"
JobAgentDatabaseServiceObjective = "S2"
JobAgentCredentialName = "mydemocred"
TenantAnalyticsDatabaseName = "tenantanalytics"
TenantAnalyticsCSDatabaseName = "tenantanalytics-cs"
AdhocReportingDatabaseName = "adhocreporting"
Expand Down

0 comments on commit 8fc65f3

Please sign in to comment.