Azure-Samples / azure-files-samples

This repository contains supporting code (PowerShell modules/scripts, ARM templates, etc.) for deploying, configuring, and using Azure Files.
https://docs.microsoft.com/azure/storage/files/storage-files-introduction
MIT License
226 stars 192 forks source link

Join-AzStorageAccount DirectoryServiceOptions Error #188

Open robhiitsd opened 7 months ago

robhiitsd commented 7 months ago

Attempting to join newly created Azure Storage Account to AD DS via running Join-AzStorageAccount from MS article https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-ad-ds-enable#run-join-azstorageaccount

AD Computer object is created, but storage account does not get configured for AD DS. Receives the following error: "Set-AzStorageAccount: Cannot validate argument on parameter 'ActiveDirectoryDomainSid'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. Write-Error: The cmdlet is stopped due to the storage account 'stmtavdapp01' having the DirectoryServiceOptions value: ''. The DirectoryServiceOptions for the account needs to be 'AD' in order to run the cmdlet."

I was able to configure it by running the Set-AZStorageAccount using MS Article: https://learn.microsoft.com/en-us/powershell/module/az.storage/set-azstorageaccount?view=azps-11.2.0#example-11-update-a-storage-account-by-enable-files-active-directory-domain-service-authentication-and-then-show-the-file-identity-based-authentication-setting

This did not have to be done in previous version of AZFilesHybrid module.

Using the following AZFilesHybrid version: ModuleType Version PreRelease Name PSEdition ExportedCommands


Script 0.2.9.0 AzFilesHybrid Core,Desk {Get-IsElevatedSession, Assert-IsElevatedSession, Get-OSPlatfor…