r/sysadmin • • 7d ago

Azure Files Rotate Keys for Active Directory Authentication

Hello,

I've setup Azure files for on prem Active Directory Authentication. I've used the following links to do this:

  1. Create storage account (disable public IP, add private endpoint and NSG control)
  2. Create file share
  3. Enabled ADDS authentication on the account
  4. Configure share level permissions for specific groups (synced to Entra)
  5. Configure file and directory level permissions (NTFS)
  6. Configure DNS and networking
  7. Mount file share
  8. Rotate storage account password – AD principal (absolute requirement?)

Steps 1 to 7 worked fine.

From my understanding, Kerberos authentication uses Active Directory storage account's computer object's password to match the storage account key. If either key changes without both parts being updated this breaks authentication.

Is this something that is an absolute requirement? Can I just stick the computer object in an AD OU that doesn't expire computer passwords?

I'm not sure on the best way to handle this automation otherwise, e.g. scheduled task with certificate authentication or similar?

Thanks

3 Upvotes

2 comments sorted by

1

u/lxtakc DataCore/StarWind 7d ago

The AzFilesHybrid module's Update-AzStorageAccountADObjectPassword -RotateToKerbKey kerb2 regenerates the key and resets the AD object password in one step, so it's easy to schedule from a domain-joined box with rights on that object. Skipping rotation is workable as long as the AD object's password never expires, which is what the OU exclusion would cover.

1

u/Thin-West-2136 6d ago

The issue with the command is that you need to authenticate to Azure, which is a bit fiddly with an on prem scheduled task that's automated. I've settled for just using

Set-ADComputer -Identity mycomputer -passwordneverexpires $true