-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
param ( | ||
[Parameter(Mandatory=$true)] | ||
[string]$Subscription, | ||
[Parameter(Mandatory=$true)] | ||
[string]$ResourceGroup, | ||
[Parameter(Mandatory=$true)] | ||
[string]$SqlServerName, | ||
[Parameter(Mandatory=$true)] | ||
[string]$NamespaceName, | ||
[Parameter(Mandatory=$true)] | ||
[string]$PrNumber) | ||
|
||
function CreateDatabase { | ||
$databaseName = "Test-$PrNumber" | ||
az sql db create --resource-group $ResourceGroup --server $SqlServerName --name $databaseName --edition Basic | ||
} | ||
|
||
function CreateServiceBusTopics { | ||
$integrationEventsTopic = "IntegrationEvents-$PrNumber" | ||
$(az servicebus topic create --resource-group $ResourceGroup --namespace-name $NamespaceName --name $integrationEventsTopic) | Out-Null | ||
$(az servicebus topic subscription create --resource-group $ResourceGroup --namespace-name $NamespaceName --topic-name $integrationEventsTopic --name All-Events) | Out-Null | ||
} | ||
|
||
function CreateServiceBusQueues { | ||
$(az servicebus queue create --resource-group $ResourceGroup --namespace-name $NamespaceName --name "Command-$PrNumber") | Out-Null | ||
} | ||
|
||
az account set -s $Subscription | ||
|
||
#CreateDatabase | ||
CreateServiceBusTopics | ||
CreateServiceBusQueues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
param( | ||
[Parameter(Mandatory=$true)] | ||
[string]$Subscription, | ||
[Parameter(Mandatory=$true)] | ||
[string]$ResourceGroup, | ||
[Parameter(Mandatory=$true)] | ||
[string]$SqlServerName, | ||
[Parameter(Mandatory=$true)] | ||
[string]$NamespaceName, | ||
[Parameter(Mandatory=$true)] | ||
[string]$PrNumber) | ||
|
||
function DeleteDatabase { | ||
$databaseName = "Test-$prNumber" | ||
az sql db delete --name $databaseName --resource-group $ResourceGroup --server $SqlServerName | Out-Null | ||
} | ||
|
||
function DeleteServiceBusTopics { | ||
$integrationEventsTopic = "IntegrationEvents-$PrNumber" | ||
az servicebus topic subscription delete --resource-group $ResourceGroup --namespace-name $NamespaceName --topic-name $integrationEventsTopic --name All-Events | Out-Null | ||
az servicebus topic delete --resource-group $ResourceGroup --namespace-name $NamespaceName --name $integrationEventsTopic | Out-Null | ||
} | ||
|
||
function DeleteServiceBusQueues { | ||
az servicebus queue delete --resource-group $ResourceGroup --namespace-name $NamespaceName --name "Command-$PrNumber" | Out-Null | ||
} | ||
|
||
az account set -s $Subscription | ||
|
||
#DeleteDatabase | ||
DeleteServiceBusTopics | ||
DeleteServiceBusQueues |