https://pulumi.com logo
Title
i

icy-doctor-13719

10/21/2022, 1:56 PM
I am using an
AzureNative.Sql.Server
database. I want to make a small configuration change to the DB server, but pulumi wants to delete and replace the entire database server, all of the databases, etc. Is there a way to avoid this? I’ve tried making the change manually and
pulumi refresh
as well with same results.
c

clever-sunset-76585

10/21/2022, 6:24 PM
What's the configuration change that you are making? It's possible that that change does not support an in-ppace update. Also you should consider setting the resource option
protect
so that you don't accidentally execute a replacement that would delete the original db resource.
i

icy-doctor-13719

10/21/2022, 6:24 PM
Basically adding a managed identity … added:
Identity = new Pulumi.AzureNative.Sql.Inputs.ResourceIdentityArgs
            {
                Type = Pulumi.AzureNative.Sql.IdentityType.SystemAssigned
            },
interesting, ill take a look at
protect
… wasn’t aware of this one yet
c

clever-sunset-76585

10/21/2022, 11:38 PM
Hmm that's interesting...can you run a preview with the
--diff
flag and post the detailed diff for your db resource here?
i

icy-doctor-13719

11/03/2022, 4:59 PM
Sorry for delay … here is an example:
--azure-native:sql:Server: (delete-replaced)
 +-azure-native:sql:Server: (replace)
      ~ administrators: {
          ~ login: "sp-pulumi-production" => "sp-pulumi-nonproduction"
        }
 ++azure-native:sql:Server: (create-replacement)
      ~ administrators: {
          ~ login: "sp-pulumi-production" => "sp-pulumi-nonproduction"
        }
(reviving in case anyone has any thoughts) in this particular case … i’m literally only changing the display name of the administrator account and it wants to delete and completely replace the database, and all dependents
c

clever-sunset-76585

11/06/2022, 4:14 AM
Your detailed diff seems to indicate that there was already an identity assigned. It's possible that changing the identity is not an in-place update. Also the
administrators
property and the
identity
seem to have the same description. Even though you set the
identity
property it seems that the
administrators
property is changing? That seems odd. Any chance you can post the entire code related to the SQL Server resource?
i

icy-doctor-13719

11/07/2022, 1:52 AM
i think the problem is the one listed here : https://github.com/pulumi/pulumi-azure-native/issues/1738 … basically Azure API not Pulumi is causing this ridiculousness 😅
c

clever-sunset-76585

11/07/2022, 4:24 AM
Ah yes. Yeah the real issue is described in this comment: https://github.com/pulumi/pulumi-azure-native/issues/1738#issuecomment-1144987215.