From f4d0e04275c992d2cc84ef26c79163ef6f1600a7 Mon Sep 17 00:00:00 2001 From: Jason Gilbertson Date: Mon, 19 Jun 2023 12:28:42 -0400 Subject: [PATCH 1/4] modify #Requires -Module AzureRM.KeyVault -> #Requires -Module Az.KeyVault --- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 833d2f8..1229051 100644 --- a/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,4 +1,4 @@ -#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. diff --git a/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 833d2f8..1229051 100644 --- a/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,4 +1,4 @@ -#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. diff --git a/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 index 833d2f8..1229051 100644 --- a/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,4 +1,4 @@ -#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. diff --git a/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 index 833d2f8..1229051 100644 --- a/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 @@ -1,4 +1,4 @@ -#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. diff --git a/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 833d2f8..1229051 100644 --- a/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,4 +1,4 @@ -#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. diff --git a/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 833d2f8..1229051 100644 --- a/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,4 +1,4 @@ -#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. diff --git a/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 b/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 index 833d2f8..1229051 100644 --- a/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 +++ b/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 @@ -1,4 +1,4 @@ -#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. From 446e9c7454ba600d0becb04682d4f48d2ffaf7e4 Mon Sep 17 00:00:00 2001 From: Jason Gilbertson Date: Mon, 19 Jun 2023 15:04:37 -0400 Subject: [PATCH 2/4] migrate from deprecated -AzureRm modules to -Az modules --- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- 5-VM-Windows-OMS-UnSecure/README.md | 4 ++-- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 1229051..b9a43f0 100644 --- a/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -6,8 +6,8 @@ # #$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 # # Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment # @@ -42,6 +42,6 @@ $SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force $NewSecret = Set-AzureKeyVaultSecret -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 \ No newline at end of file diff --git a/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 1229051..b9a43f0 100644 --- a/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -6,8 +6,8 @@ # #$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 # # Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment # @@ -42,6 +42,6 @@ $SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force $NewSecret = Set-AzureKeyVaultSecret -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 \ No newline at end of file diff --git a/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 index 1229051..b9a43f0 100644 --- a/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -6,8 +6,8 @@ # #$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 # # Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment # @@ -42,6 +42,6 @@ $SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force $NewSecret = Set-AzureKeyVaultSecret -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 \ No newline at end of file diff --git a/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 index 1229051..b9a43f0 100644 --- a/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 @@ -6,8 +6,8 @@ # #$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 # # Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment # @@ -42,6 +42,6 @@ $SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force $NewSecret = Set-AzureKeyVaultSecret -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 \ No newline at end of file diff --git a/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 1229051..b9a43f0 100644 --- a/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -6,8 +6,8 @@ # #$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 # # Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment # @@ -42,6 +42,6 @@ $SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force $NewSecret = Set-AzureKeyVaultSecret -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 \ No newline at end of file diff --git a/5-VM-Windows-OMS-UnSecure/README.md b/5-VM-Windows-OMS-UnSecure/README.md index fd6821f..036de9e 100644 --- a/5-VM-Windows-OMS-UnSecure/README.md +++ b/5-VM-Windows-OMS-UnSecure/README.md @@ -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 "" -TemplateFile ".json" +New-AzResourceGroupDeployment -ResourceGroupName "" -TemplateFile ".json" ``` ## Creating a custom ARM template diff --git a/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 1229051..b9a43f0 100644 --- a/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -6,8 +6,8 @@ # #$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 # # Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment # @@ -42,6 +42,6 @@ $SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force $NewSecret = Set-AzureKeyVaultSecret -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 \ No newline at end of file diff --git a/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 b/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 index 1229051..b9a43f0 100644 --- a/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 +++ b/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 @@ -6,8 +6,8 @@ # #$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 # # Once the certificate is created and stored in the vault, the script will provide the parameter values needed for template deployment # @@ -42,6 +42,6 @@ $SecretValue = ConvertTo-SecureString -String $Content -AsPlainText -Force $NewSecret = Set-AzureKeyVaultSecret -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 \ No newline at end of file From b2b99ba12b32e2329e1ea555fa0c5d701f241fb4 Mon Sep 17 00:00:00 2001 From: Jason Gilbertson Date: Mon, 19 Jun 2023 15:15:57 -0400 Subject: [PATCH 3/4] migrate from deprecated Set-AzureKeyVaultSecret to Set-AzKeyVaultSecret --- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- .../New-ServiceFabricClusterCertificate.ps1 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index b9a43f0..5d554b5 100644 --- a/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -39,7 +39,7 @@ $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-AzKeyVault -VaultName $KeyVaultName).ResourceId diff --git a/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index b9a43f0..5d554b5 100644 --- a/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -39,7 +39,7 @@ $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-AzKeyVault -VaultName $KeyVaultName).ResourceId diff --git a/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 index b9a43f0..5d554b5 100644 --- a/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -39,7 +39,7 @@ $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-AzKeyVault -VaultName $KeyVaultName).ResourceId diff --git a/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 index b9a43f0..5d554b5 100644 --- a/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 @@ -39,7 +39,7 @@ $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-AzKeyVault -VaultName $KeyVaultName).ResourceId diff --git a/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index b9a43f0..5d554b5 100644 --- a/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -39,7 +39,7 @@ $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-AzKeyVault -VaultName $KeyVaultName).ResourceId diff --git a/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index b9a43f0..5d554b5 100644 --- a/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -39,7 +39,7 @@ $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-AzKeyVault -VaultName $KeyVaultName).ResourceId diff --git a/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 b/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 index b9a43f0..5d554b5 100644 --- a/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 +++ b/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 @@ -39,7 +39,7 @@ $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-AzKeyVault -VaultName $KeyVaultName).ResourceId From 3ac25ff7dea6d231a498c8dd44c16afabd200410 Mon Sep 17 00:00:00 2001 From: Jason Gilbertson Date: Mon, 19 Jun 2023 15:22:45 -0400 Subject: [PATCH 4/4] add missing -EnabledForTemplateDeployment argument --- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- .../New-ServiceFabricClusterCertificate.ps1 | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 5d554b5..747b390 100644 --- a/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-RHEL-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,13 +1,13 @@ #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-AzResourceGroup -Name $KeyvaultRG -Location WestUS -#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment +#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 # diff --git a/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 5d554b5..747b390 100644 --- a/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Ubuntu-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,13 +1,13 @@ #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-AzResourceGroup -Name $KeyvaultRG -Location WestUS -#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment +#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 # diff --git a/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 index 5d554b5..747b390 100644 --- a/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Ubuntu-1804-1-NodeType-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,13 +1,13 @@ #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-AzResourceGroup -Name $KeyvaultRG -Location WestUS -#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment +#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 # diff --git a/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 index 5d554b5..747b390 100644 --- a/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Windows-1-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 @@ -1,13 +1,13 @@ #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-AzResourceGroup -Name $KeyvaultRG -Location WestUS -#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment +#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 # diff --git a/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 5d554b5..747b390 100644 --- a/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/5-VM-Windows-1-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,13 +1,13 @@ #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-AzResourceGroup -Name $KeyvaultRG -Location WestUS -#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment +#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 # diff --git a/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 b/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 index 5d554b5..747b390 100644 --- a/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 +++ b/7-VM-Ubuntu-3-NodeTypes-Secure/New-ServiceFabricClusterCertificate.ps1 @@ -1,13 +1,13 @@ #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-AzResourceGroup -Name $KeyvaultRG -Location WestUS -#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment +#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 # diff --git a/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 b/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 index 5d554b5..747b390 100644 --- a/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 +++ b/7-VM-Windows-3-NodeTypes-Secure-NSG/New-ServiceFabricClusterCertificate.ps1 @@ -1,13 +1,13 @@ #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-AzResourceGroup -Name $KeyvaultRG -Location WestUS -#New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $KeyvaultRG -Location WestUS -EnabledForDeployment +#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 #