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

Commit

Permalink
Refresh with updated tools (#6)
Browse files Browse the repository at this point in the history
* Update website and function

* Update setup instructions
  • Loading branch information
arnaudmaichac authored and nzthiago committed Jan 6, 2020
1 parent f0c856b commit db9da0f
Show file tree
Hide file tree
Showing 107 changed files with 39,636 additions and 20,746 deletions.
21 changes: 7 additions & 14 deletions Provision/assets/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
.PARAMETER resourceGroupLocation
Optional, a resource group location. If specified, will try to create a new resource group in this location. If not specified, assumes resource group is existing.
.PARAMETER deploymentName
The deployment name.
.PARAMETER templateFilePath
Optional, path to the template file. Defaults to template.json.
Expand All @@ -36,10 +33,6 @@ param(
[string]
$resourceGroupLocation,

[Parameter(Mandatory=$True)]
[string]
$deploymentName,

[string]
$templateFilePath = "template.json",

Expand All @@ -57,7 +50,7 @@ Function RegisterRP {
)

Write-Host "Registering resource provider '$ResourceProviderNamespace'";
Register-AzureRmResourceProvider -ProviderNamespace $ResourceProviderNamespace;
Register-AzResourceProvider -ProviderNamespace $ResourceProviderNamespace;
}

#******************************************************************************
Expand All @@ -68,11 +61,11 @@ $ErrorActionPreference = "Stop"

# sign in
Write-Host "Logging in...";
Login-AzureRmAccount;
Login-AzAccount;

# select subscription
Write-Host "Selecting subscription '$subscriptionId'";
Select-AzureRmSubscription -SubscriptionID $subscriptionId;
Select-AzSubscription -SubscriptionID $subscriptionId;

# Register RPs
$resourceProviders = @("microsoft.cognitiveservices","microsoft.documentdb","microsoft.insights","microsoft.storage","microsoft.web");
Expand All @@ -84,15 +77,15 @@ if($resourceProviders.length) {
}

#Create or check for existing resource group
$resourceGroup = Get-AzureRmResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue
$resourceGroup = Get-AzResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue
if(!$resourceGroup)
{
Write-Host "Resource group '$resourceGroupName' does not exist. To create a new resource group, please enter a location.";
if(!$resourceGroupLocation) {
$resourceGroupLocation = Read-Host "resourceGroupLocation";
}
Write-Host "Creating resource group '$resourceGroupName' in location '$resourceGroupLocation'";
New-AzureRmResourceGroup -Name $resourceGroupName -Location $resourceGroupLocation
New-AzResourceGroup -Name $resourceGroupName -Location $resourceGroupLocation
}
else{
Write-Host "Using existing resource group '$resourceGroupName'";
Expand All @@ -101,7 +94,7 @@ else{
# Start the deployment
Write-Host "Starting deployment...";
if(Test-Path $parametersFilePath) {
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath -TemplateParameterFile $parametersFilePath;
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath -TemplateParameterFile $parametersFilePath;
} else {
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath;
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath;
}
Loading

0 comments on commit db9da0f

Please sign in to comment.