Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate from deprecated AzureRM powershell modules to Az modules #97

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#Requires -Module AzureRM.KeyVault
#Requires -Module Az.KeyVault

# Use this script to create a certificate that you can use to secure a Service Fabric Cluster
# This script requires an existing KeyVault that is EnabledForDeployment. The vault must be in the same region as the cluster.
# To create a new vault and set the EnabledForDeployment property run:
# This script requires an existing KeyVault that is EnabledForDeployment and EnabledForTemplateDeployment. The vault must be in the same region as the cluster.
# To create a new vault, set the EnabledForDeployment, and set EnabledForTemplateDeployment property run:
#
#$keyvaultRG="mykevaultrg"
#$KeyVaultName="mykevaultname"
#New-AzureRmResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzureRmKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment
#New-AzResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment -EnabledForTemplateDeployment
#
# Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment
#
Expand Down Expand Up @@ -39,9 +39,9 @@ $ContentBytes = [System.Text.Encoding]::UTF8.GetBytes($JSONBlob)
$Content = [System.Convert]::ToBase64String($ContentBytes)

$SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force
$NewSecret = Set-AzureKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose
$NewSecret = Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose

Write-Host
Write-Host "Source Vault Resource Id: "$(Get-AzureRmKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Source Vault Resource Id: "$(Get-AzKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Certificate URL : "$NewSecret.Id
Write-Host "Certificate Thumbprint : "$NewCert.Thumbprint
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#Requires -Module AzureRM.KeyVault
#Requires -Module Az.KeyVault

# Use this script to create a certificate that you can use to secure a Service Fabric Cluster
# This script requires an existing KeyVault that is EnabledForDeployment. The vault must be in the same region as the cluster.
# To create a new vault and set the EnabledForDeployment property run:
# This script requires an existing KeyVault that is EnabledForDeployment and EnabledForTemplateDeployment. The vault must be in the same region as the cluster.
# To create a new vault, set the EnabledForDeployment, and set EnabledForTemplateDeployment property run:
#
#$keyvaultRG="mykevaultrg"
#$KeyVaultName="mykevaultname"
#New-AzureRmResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzureRmKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment
#New-AzResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment -EnabledForTemplateDeployment
#
# Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment
#
Expand Down Expand Up @@ -39,9 +39,9 @@ $ContentBytes = [System.Text.Encoding]::UTF8.GetBytes($JSONBlob)
$Content = [System.Convert]::ToBase64String($ContentBytes)

$SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force
$NewSecret = Set-AzureKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose
$NewSecret = Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose

Write-Host
Write-Host "Source Vault Resource Id: "$(Get-AzureRmKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Source Vault Resource Id: "$(Get-AzKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Certificate URL : "$NewSecret.Id
Write-Host "Certificate Thumbprint : "$NewCert.Thumbprint
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#Requires -Module AzureRM.KeyVault
#Requires -Module Az.KeyVault

# Use this script to create a certificate that you can use to secure a Service Fabric Cluster
# This script requires an existing KeyVault that is EnabledForDeployment. The vault must be in the same region as the cluster.
# To create a new vault and set the EnabledForDeployment property run:
# This script requires an existing KeyVault that is EnabledForDeployment and EnabledForTemplateDeployment. The vault must be in the same region as the cluster.
# To create a new vault, set the EnabledForDeployment, and set EnabledForTemplateDeployment property run:
#
#$keyvaultRG="mykevaultrg"
#$KeyVaultName="mykevaultname"
#New-AzureRmResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzureRmKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment
#New-AzResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment -EnabledForTemplateDeployment
#
# Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment
#
Expand Down Expand Up @@ -39,9 +39,9 @@ $ContentBytes = [System.Text.Encoding]::UTF8.GetBytes($JSONBlob)
$Content = [System.Convert]::ToBase64String($ContentBytes)

$SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force
$NewSecret = Set-AzureKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose
$NewSecret = Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose

Write-Host
Write-Host "Source Vault Resource Id: "$(Get-AzureRmKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Source Vault Resource Id: "$(Get-AzKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Certificate URL : "$NewSecret.Id
Write-Host "Certificate Thumbprint : "$NewCert.Thumbprint
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#Requires -Module AzureRM.KeyVault
#Requires -Module Az.KeyVault

# Use this script to create a certificate that you can use to secure a Service Fabric Cluster
# This script requires an existing KeyVault that is EnabledForDeployment. The vault must be in the same region as the cluster.
# To create a new vault and set the EnabledForDeployment property run:
# This script requires an existing KeyVault that is EnabledForDeployment and EnabledForTemplateDeployment. The vault must be in the same region as the cluster.
# To create a new vault, set the EnabledForDeployment, and set EnabledForTemplateDeployment property run:
#
#$keyvaultRG="mykevaultrg"
#$KeyVaultName="mykevaultname"
#New-AzureRmResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzureRmKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment
#New-AzResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment -EnabledForTemplateDeployment
#
# Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment
#
Expand Down Expand Up @@ -39,9 +39,9 @@ $ContentBytes = [System.Text.Encoding]::UTF8.GetBytes($JSONBlob)
$Content = [System.Convert]::ToBase64String($ContentBytes)

$SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force
$NewSecret = Set-AzureKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose
$NewSecret = Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose

Write-Host
Write-Host "Source Vault Resource Id: "$(Get-AzureRmKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Source Vault Resource Id: "$(Get-AzKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Certificate URL : "$NewSecret.Id
Write-Host "Certificate Thumbprint : "$NewCert.Thumbprint
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#Requires -Module AzureRM.KeyVault
#Requires -Module Az.KeyVault

# Use this script to create a certificate that you can use to secure a Service Fabric Cluster
# This script requires an existing KeyVault that is EnabledForDeployment. The vault must be in the same region as the cluster.
# To create a new vault and set the EnabledForDeployment property run:
# This script requires an existing KeyVault that is EnabledForDeployment and EnabledForTemplateDeployment. The vault must be in the same region as the cluster.
# To create a new vault, set the EnabledForDeployment, and set EnabledForTemplateDeployment property run:
#
#$keyvaultRG="mykevaultrg"
#$KeyVaultName="mykevaultname"
#New-AzureRmResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzureRmKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment
#New-AzResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment -EnabledForTemplateDeployment
#
# Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment
#
Expand Down Expand Up @@ -39,9 +39,9 @@ $ContentBytes = [System.Text.Encoding]::UTF8.GetBytes($JSONBlob)
$Content = [System.Convert]::ToBase64String($ContentBytes)

$SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force
$NewSecret = Set-AzureKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose
$NewSecret = Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose

Write-Host
Write-Host "Source Vault Resource Id: "$(Get-AzureRmKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Source Vault Resource Id: "$(Get-AzKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Certificate URL : "$NewSecret.Id
Write-Host "Certificate Thumbprint : "$NewCert.Thumbprint
4 changes: 2 additions & 2 deletions 5-VM-Windows-OMS-UnSecure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ This test template allows you to deploy an unsecure 5 node cluster with OMS Log

You can go through the process of creating the cluster as described in [Creating Service Fabric Cluster via ARM](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-creation-via-arm)

You can also use the `New-AzureRmResourceGroupDeployment` Powershell command if you have the Azure PowerShell prerequisites in the link above.
You can also use the `New-AzResourceGroupDeployment` Powershell command if you have the Azure PowerShell prerequisites in the link above.

```Powershell
New-AzureRmResourceGroupDeployment -ResourceGroupName "<resourceGroupName>" -TemplateFile "<templatefile>.json"
New-AzResourceGroupDeployment -ResourceGroupName "<resourceGroupName>" -TemplateFile "<templatefile>.json"
```

## Creating a custom ARM template
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#Requires -Module AzureRM.KeyVault
#Requires -Module Az.KeyVault

# Use this script to create a certificate that you can use to secure a Service Fabric Cluster
# This script requires an existing KeyVault that is EnabledForDeployment. The vault must be in the same region as the cluster.
# To create a new vault and set the EnabledForDeployment property run:
# This script requires an existing KeyVault that is EnabledForDeployment and EnabledForTemplateDeployment. The vault must be in the same region as the cluster.
# To create a new vault, set the EnabledForDeployment, and set EnabledForTemplateDeployment property run:
#
#$keyvaultRG="mykevaultrg"
#$KeyVaultName="mykevaultname"
#New-AzureRmResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzureRmKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment
#New-AzResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment -EnabledForTemplateDeployment
#
# Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment
#
Expand Down Expand Up @@ -39,9 +39,9 @@ $ContentBytes = [System.Text.Encoding]::UTF8.GetBytes($JSONBlob)
$Content = [System.Convert]::ToBase64String($ContentBytes)

$SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force
$NewSecret = Set-AzureKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose
$NewSecret = Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose

Write-Host
Write-Host "Source Vault Resource Id: "$(Get-AzureRmKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Source Vault Resource Id: "$(Get-AzKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Certificate URL : "$NewSecret.Id
Write-Host "Certificate Thumbprint : "$NewCert.Thumbprint
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#Requires -Module AzureRM.KeyVault
#Requires -Module Az.KeyVault

# Use this script to create a certificate that you can use to secure a Service Fabric Cluster
# This script requires an existing KeyVault that is EnabledForDeployment. The vault must be in the same region as the cluster.
# To create a new vault and set the EnabledForDeployment property run:
# This script requires an existing KeyVault that is EnabledForDeployment and EnabledForTemplateDeployment. The vault must be in the same region as the cluster.
# To create a new vault, set the EnabledForDeployment, and set EnabledForTemplateDeployment property run:
#
#$keyvaultRG="mykevaultrg"
#$KeyVaultName="mykevaultname"
#New-AzureRmResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzureRmKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment
#New-AzResourceGroup -Name $KeyvaultRG -Location WestUS
#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment -EnabledForTemplateDeployment
#
# Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment
#
Expand Down Expand Up @@ -39,9 +39,9 @@ $ContentBytes = [System.Text.Encoding]::UTF8.GetBytes($JSONBlob)
$Content = [System.Convert]::ToBase64String($ContentBytes)

$SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force
$NewSecret = Set-AzureKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose
$NewSecret = Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name $KeyVaultSecretName -SecretValue $SecretValue -Verbose

Write-Host
Write-Host "Source Vault Resource Id: "$(Get-AzureRmKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Source Vault Resource Id: "$(Get-AzKeyVault -VaultName $KeyVaultName).ResourceId
Write-Host "Certificate URL : "$NewSecret.Id
Write-Host "Certificate Thumbprint : "$NewCert.Thumbprint