Updating the virtual machine scale. To add a secret crash with a VHD error

I deployed a Virtual Machine Scale Set (VMSS) for Azure as part of a Service Fabric cluster. When I try to redistribute the template, it has improved a bit to update VMSS with an additional secret, I get the following error. I checked that the parameters that I use are correct.

"type": "Microsoft.Compute/virtualMachineScaleSets", // ... "osProfile": { // ... "secrets": [ { "sourceVault": { "id": "[parameters('sourceVaultValue')]" }, "vaultCertificates": [ { "certificateStore": "[parameters('certificateStoreValue')]", "certificateUrl": "[parameters('certificateUrlValue')]" }, { // ******* ADDED ******* "certificateStore": "[parameters('certificateStoreValue')]", "certificateUrl": "[parameters('sslCertificateUrlValue')]" } // ******* ADDED ******* ] } ] }, // ... 
  New-AzureRmResourceGroupDeployment: 5:46:20 PM - Resource Microsoft.Compute / virtualMachineScaleSets 'Primary' failed with message
 'VHD Containers currently being used by any Virtual Machine Scale Set VM instances may not be removed.  To remove a VHD Container, all
 Virtual Machine Scale Set VM instances using it must first be deleted. '
 At D: \ myapp \ deploy \ deploy.ps1: 104 char: 5
 + New-AzureRmResourceGroupDeployment -ResourceGroupName $ resourceGr ...
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
     + CategoryInfo: NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
     + FullyQualifiedErrorId: Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand
0
source share
1 answer

I was able to get around this using PowerShell instead, based on this answer . But I still would like to find a way to deploy ARM templates to add new certificates or other secrets to an existing VMSS deployment.

UPDATE: It turns out that when I copied the ARM template, I changed the settings for the storage account, but the Service Fabric is already configured to use the previous auto-generated names.

0
source

Source: https://habr.com/ru/post/1242685/


All Articles