Azure Stack TP2: SQL Resource Provider Install Error – System.Management.Automation.ValidationMetadataException: The argument is null or empty.

When installing the SQL Resource Provider on Azure Stack TP2, I encountered the following error:

VERBOSE: Download of SQLServer Failed. (Elapsed: 00:00:00.0386220)
WARNING: Can not execute [C:\Users\AzureStackAdmin\Desktop\Resource
Providers\SQL\Prerequisites\BlobStorage\Download-File.ps1] command at 1 time(s). Will retry. The error:
System.Management.Automation.ValidationMetadataException: The argument is null or empty. Provide an argument that is
not null or empty, and then try the command again.
at System.Management.Automation.ValidateNotNullOrEmptyAttribute.Validate(Object arguments, EngineIntrinsics
engineIntrinsics)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter,
CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)

When starting the deployment process I specified a local path to the SQL Server ISO file, as opposed to having the setup download it for me.  The issue comes from the way that the install script reads the path value specified…

As you can see, the DependancyFilesLocalPath is passed directly to a Get-ChildItem command which is in turn passed to the Download-File command.  The issue was that I had placed the ISO in the same folder as the rest of the SQL RP scripts, and that folder included subfolders.  I resolved the error by moving the ISO to it’s own subfolder and updating the DependancyFilesLocalPath parameter accordingly.

Azure Stack TP2: Install Error – Function ‘ConfigureAAD’ in module ‘Roles\AAD\AAD.psd1’ raised an exception: The remote server returned an error: (401) Unauthorized

 

While running InstallAzureStackPOC.ps1 to install Azure Stack TP2, I encountered the following error:

Function ‘ConfigureAAD’ in module ‘Roles\AAD\AAD.psd1’ raised an exception: The remote server returned an error: (401) Unauthorized

I did some digging online and found a helpful thread on the MDSN Azure Forum.

The issue turned out to be that the system clock was one hour behind on the Azure Stack host and all of the VMs created by the install process.  This causes the communication from the MAS-WAS01 machine to Azure Active Directory to fail. I opted to correct the time separately on each server, but this would also be the perfect candidate for automating with a single script.  Perhaps using something like this?

Once the time was corrected throughout the environment, I was able to resume where I left off using the following command:

Note: if you are using a new PowerShell session, you will have to run the following commands to import the required modules:

With the time corrected I was able to complete the installation without any additional errors.