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

Commit db9da0f

Browse files
arnaudmaichacnzthiago
authored andcommitted
Refresh with updated tools (#6)
* Update website and function * Update setup instructions
1 parent f0c856b commit db9da0f

File tree

107 files changed

+39636
-20746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+39636
-20746
lines changed

Provision/assets/deploy.ps1

+7-14
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
.PARAMETER resourceGroupLocation
1515
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.
1616
17-
.PARAMETER deploymentName
18-
The deployment name.
19-
2017
.PARAMETER templateFilePath
2118
Optional, path to the template file. Defaults to template.json.
2219
@@ -36,10 +33,6 @@ param(
3633
[string]
3734
$resourceGroupLocation,
3835

39-
[Parameter(Mandatory=$True)]
40-
[string]
41-
$deploymentName,
42-
4336
[string]
4437
$templateFilePath = "template.json",
4538

@@ -57,7 +50,7 @@ Function RegisterRP {
5750
)
5851

5952
Write-Host "Registering resource provider '$ResourceProviderNamespace'";
60-
Register-AzureRmResourceProvider -ProviderNamespace $ResourceProviderNamespace;
53+
Register-AzResourceProvider -ProviderNamespace $ResourceProviderNamespace;
6154
}
6255

6356
#******************************************************************************
@@ -68,11 +61,11 @@ $ErrorActionPreference = "Stop"
6861

6962
# sign in
7063
Write-Host "Logging in...";
71-
Login-AzureRmAccount;
64+
Login-AzAccount;
7265

7366
# select subscription
7467
Write-Host "Selecting subscription '$subscriptionId'";
75-
Select-AzureRmSubscription -SubscriptionID $subscriptionId;
68+
Select-AzSubscription -SubscriptionID $subscriptionId;
7669

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

8679
#Create or check for existing resource group
87-
$resourceGroup = Get-AzureRmResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue
80+
$resourceGroup = Get-AzResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue
8881
if(!$resourceGroup)
8982
{
9083
Write-Host "Resource group '$resourceGroupName' does not exist. To create a new resource group, please enter a location.";
9184
if(!$resourceGroupLocation) {
9285
$resourceGroupLocation = Read-Host "resourceGroupLocation";
9386
}
9487
Write-Host "Creating resource group '$resourceGroupName' in location '$resourceGroupLocation'";
95-
New-AzureRmResourceGroup -Name $resourceGroupName -Location $resourceGroupLocation
88+
New-AzResourceGroup -Name $resourceGroupName -Location $resourceGroupLocation
9689
}
9790
else{
9891
Write-Host "Using existing resource group '$resourceGroupName'";
@@ -101,7 +94,7 @@ else{
10194
# Start the deployment
10295
Write-Host "Starting deployment...";
10396
if(Test-Path $parametersFilePath) {
104-
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath -TemplateParameterFile $parametersFilePath;
97+
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath -TemplateParameterFile $parametersFilePath;
10598
} else {
106-
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath;
99+
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath;
107100
}

0 commit comments

Comments
 (0)