03-26-2019 10:55 AM
When following the directions below, I always run into an error related to querying the management service.
https://docs.microsoft.com/en-us/azure/virtual-desktop/create-host-pools-azure-marketplace
Error message from the Azure portal:
"error": { "code": "VMExtensionProvisioningError", "message": "VM has reported a failure when processing extension 'dscextension'. Error message: \"DSC Configuration 'FirstSessionHost' completed with error(s). Following are the first few: PowerShell DSC resource MSFT_ScriptResource failed to execute Set-TargetResource functionality with error message: User is not authorized to query the management service.
I'm logged in as a user that in the global admin role in Azure AD, and it's also a user in the Windows Virtual Desktop enterprise application. I've consented to the graph and Azure AD permissions under the enterprise app as well, any ideas?
03-26-2019 05:40 PM
03-26-2019 11:31 PM
03-27-2019 03:43 AM
03-27-2019 08:59 AM
@Christopher Anderson , @Patrick F , @Seth Zwicker : The reason you see the "User is not authorized to query the management service" from the DSC extension is because the user who you provided in the last blade (where you also defined your Windows Virtual Desktop tenant name) does not have permissions in the tenant that you specified. A couple things you can check:
Thanks for testing and your patience here. We're compiling this same information and generating a Troubleshooting guide that hopefully should help you get unblocked yourself!
03-27-2019 09:32 AM
I have the same issue too after following the instructions.
New-RdsTenant -Name 'projectstest' -AadTenantId xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx -AzureSubscriptionId xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
New-RdsTenant : User is not authorized to query the management service.
ActivityId: xxxxxxx-9dec-485a-82ee-xxxxxxxxxxx
Powershell commands to diagnose the failure:
Get-RdsDiagnosticActivities -ActivityId xxxxxxx-9dec-485a-82ee-xxxxxxxxxx
At line:1 char:1
+ New-RdsTenant -Name 'projectstest' -AadTenantId xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : FromStdErr: (Microsoft.RDInf...nt.NewRdsTenant:NewRdsTenant) [New-RdsTenant], RdsPowerSh
ellException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.RDInfra.RDPowershell.Tenant.NewRdsTenant
Followed the guide here https://docs.microsoft.com/en-us/azure/virtual-desktop/tenant-setup-azure-active-directory
Turned off MFA for the account.
Granted permissions for client and server here https://rdweb.wvd.microsoft.com/
Granted permissions here for Virtual desktop https://aad.portal.azure.com
03-27-2019 09:34 AM - edited 03-27-2019 09:36 AM
@christianmontoya I checked those steps again and I'm still not sure what I'm missing. I reproduced the error outside of the template in PowerShell by doing the following:
1. Created a new user account in Azure AD and put it in the TenantCreator role for Windows Virtual Desktop.
2. Opened PowerShell as an admin, and added / logged into the account above using Add-RdsAccount
3. Attempted to call Remove-RdsTenant as part of clean up to try and see if I could execute the template from scratch
03-28-2019 08:24 AM
I was able to work around this issue. Here is what I noted:
1. Regardless of account, you don't seem to be able to delete existing tenant groups once their created using the Remove-RdsTenant account. I always get the "user is not authorized to query the management service" error no matter what I do.
2. Also, one of the steps I may have missed the first time is that the tenant group name you create via PowerShell has to match to what you create via the Azure portal. After creating a new tenant group in Powershell separate from the default one, it worked when I referenced the new tenant group name in the Azure portal. Hopefully at some point, Microsoft will have an end-to-end solution for creating the tenant, tenant group name, and host pool all within the portal.
03-28-2019 10:09 AM
@Christopher Anderson : Just to clarify, the "tenant group" name should always be "Default Tenant Group". Only in very few circumstances does this change. But yes, you always need to provide the same "tenant" name everywhere you go.
03-29-2019 10:57 AM
@Christopher Anderson : Yes, I definitely support the last message, that one of our goals is to have all of this functionality straight from the Azure portal, without having to hop around everywhere.
Thank you for all of the feedback, and keep it coming!
04-04-2019 03:16 AM
04-10-2019 04:37 AM
@Erjen Rijnders, firstly thank you for pulling together that post and the associated PowerShell. It certainly makes the first steps for setting up WVD easier. However, my efforts in this are still failing on that last step in the Azure deployment /dscextension with the error:
" PowerShell DSC resource MSFT_ScriptResource failed to execute Set-TargetResource functionality with error message: User is not authorized to query the management service."
I'm wondering exactly what the step is doing? I've remoted on to the VM which gets created and tired trawling through the event logs but there are no more details. I have also tried using just a UPN rather than your suggestion of service principle. It is a real head scratcher!
I'm going to go off and create a brand new AAD tenant and AAD DS resource just to rule out anything related to our existing corporate AAD tenant. Wish me luck :)
04-10-2019 05:57 AM - edited 04-10-2019 06:02 AM
Hi @andrewstollery, Thanks and welcome. What is the result of this command?
Get-RdsRoleAssignment
You should set something like this.
Especially, the appid must be the same as the app you created earlier:
New-RdsRoleAssignment -RoleDefinitionName "RDS Owner" -ApplicationId $svcPrincipal.AppId -TenantGroupName $myTenantGroupName -TenantName $myTenantName -HostPoolName $hostpoolname
That AppID must be the same as the app you visited in the Azure Portal, creating te new key and used during the deployment of the Azure Marketplace WVD template.
And make sure, that the user you are using joining the VM's to the domain, is also having Owner access on the Azure subscription.
It needs to be able to run PowerShell DSC on the VM's.
04-10-2019 06:12 AM
Hey i am also have the same issue i followed both the microsoft guide and Erjen guild and failing on the DSCextension. I am thinking the problem is with AADDS. Has anyone made it work with AADDS?
thanks
04-10-2019 06:16 AM
@Stavros Mitchell, I have not tested with AAD DS, but from what I know, in the preview version you need a working AD Connect, meaning that you can only use an onprem AD. I hope they remove it from the production version.
04-10-2019 06:26 AM
Hi @Erjen Rijnders, thank you for the prompt reply. Given the number of times I've run this now, I actually get 5 RoleAssigmentIds returned...oops. How do I tidy those up? Using Remove-RdsRoleAssigment I guess? I'll have a crack at that later...
The last one in the list though is the correct one:
I guess the only difference for me is that I am using AAD DS too, which you stated below is not supported. I'm not sure why not? I can get the VM to join the AAD DS domain. It is the DSCextension step which fails.
Anyhow, I'll do some tidying up and also keep progressing with my greenfield AAD, AAD DS and WVD deployment.
04-10-2019 06:47 AM
@andrewstollery, you did create a new key within that app from the Azure Portal right? And you used that key during deployment on step 4?
And the user you are using deploying the VM's, does have owner rights on the Azure Subscription?
I agree it should work, however with AAD DS you don't have access to the RPC-service. So that could be the reason it doesn't work. But still curious if you checked the points I just mentioned.
04-10-2019 06:59 AM
I am pretty sure the issue is AADDS. I think i will set up a VM for active directory and link it to AADDS and see if that corrrects my issue
04-10-2019 07:07 AM
04-10-2019 07:32 AM
04-10-2019 08:25 AM
I'm inclined to agree now. I've finished a completely new setup:
Deployment fails at the /dcsextension step every time with the error "PowerShell DSC resource MSFT_ScriptResource failed to execute Set-TargetResource functionality with the error message: User is not authorized to query the management service"
I'm still not sure I understand why WVD requires a full-blown ADDS domain controller to work? Perhaps a Microsoft representative can shed some light on this? Anyway, just like you, I am not prepared to give up! :)
Next step is to deploy an IaaS ADDS VM and use AAD Connect to sync up to AAD and then run the WVD setup again...watch this space!
04-10-2019 08:29 AM
According to Microsoft Document
A Windows Server Active Directory in sync with Azure Active Directory. This can be enabled through:
I am trying to see how that works I didn't know you can create a new Windows Server Active Directory and sync with AADDS. I have always used AD Connect. Unless i am misunderstanding the requirements
04-10-2019 08:37 AM
04-10-2019 09:02 AM
04-10-2019 09:39 AM
@Stavros Mitchell @andrewstollery : Yes, you would always use Azure AD Connect to synchronize your Windows Server AD up to Azure AD. However, if you are a cloud organization and have no Windows Server AD, then you can use Azure AD Domain Services to create a managed Windows Server AD on the virtual network that would have the same users as your Azure AD.
The intent was that these are each mechanisms that will allow the users to be recognized both "in the cloud" and "on-prem". We can change the wording to make that more clear. Open to suggestions!
04-10-2019 09:53 AM
ok so i got it to work with only AADDS i followed this guide. I think my issue was the users i was putting to allowe. I left it blank this time and it worked
http://www.rebeladmin.com/2019/04/step-step-guide-azure-windows-virtual-desktop-preview/
04-10-2019 10:54 AM - edited 04-10-2019 10:59 AM
I am also having many of the same issues covered in this thread trying to deploy Windows Virtual Desktop Preview.
I have followed all of the directions linked in this thread, including Erjen's very useful blog post and I am still getting the dreaded "User is not authorized to query the management service" failure during the DSCExtension part of the deployment.
My deployment user is a subscription owner, I have my regular AD synced with AAD complete with password hash sync, I created Service Principles with RDS Owner permissions/roles and used the APP IDs and Keys for the Tenant Admin credentials. I have tried deploying without any default users set, but despite all of this I still get the same failure.
This is extremely frustrating.
04-10-2019 11:03 AM
When I try and deploy using my subscription owner UPN for the Tenant Admin credentials instead of the Service principle credentials, I get a different error on the DSCExtention phase of the deployment...
04-10-2019 11:35 AM
@GriffinDodd : Are you able to install the PowerShell locally and try logging in with that service principal? Also, the other requirement for the service principal is that it must be created as a "Converged app" or as "multi-tenant" because our service currently uses a 3rd party Azure AD application for authentication.
04-10-2019 12:45 PM - edited 04-10-2019 01:03 PM
@christianmontoya I created the service principal following the guidelines laid out in Erjens blog post.
I have tried two methods, one where you create the tenant and service principle as illustrated in Erjen's directions, another where you use the Managed Domain as the tenant and use Managed Domain admin credentials, both give the same errors.
Here is how I am creating the tenant...
New-RdsTenant -Name <my tenant name> -AadTenantId <aad id> -AzureSubscriptionId <AZ sub id>
$myTenantGroupName = "Default Tenant Group"
$myTenantName = "<my tenant name>" #As you used in the previous step
$hostpoolname = "<my host pool name>"
# create the service principal:
$aadContext = Connect-AzureAD
$svcPrincipal = New-AzureADApplication -AvailableToOtherTenants $true -DisplayName "Windows Virtual Desktop Svc Principal"
$svcPrincipalCreds = New-AzureADApplicationPasswordCredential -ObjectId $svcPrincipal.ObjectId
# Don't change the URL below.
Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
Set-RdsContext -TenantGroupName $myTenantGroupName
New-RdsHostPool -TenantName $myTenantName -name $hostpoolname
New-RdsRoleAssignment -RoleDefinitionName "RDS Owner" -ApplicationId $svcPrincipal.AppId -TenantGroupName $myTenantGroupName -TenantName $myTenantName -HostPoolName $hostpoolname
04-10-2019 01:06 PM
I created my tenant like this....
New-RdsTenant -Name <my tenant name> -AadTenantId <aad id> -AzureSubscriptionId <az sub id>
$myTenantGroupName = "Default Tenant Group"
$myTenantName = "<my tenant name>" #As you used in the previous step
$hostpoolname = "<my pool name>"
# create the service principal:
$aadContext = Connect-AzureAD
$svcPrincipal = New-AzureADApplication -AvailableToOtherTenants $true -DisplayName "Windows Virtual Desktop Svc Principal"
$svcPrincipalCreds = New-AzureADApplicationPasswordCredential -ObjectId $svcPrincipal.ObjectId
# Don't change the URL below.
Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
Set-RdsContext -TenantGroupName $myTenantGroupName
New-RdsHostPool -TenantName $myTenantName -name $hostpoolname
New-RdsRoleAssignment -RoleDefinitionName "RDS Owner" -ApplicationId $svcPrincipal.AppId -TenantGroupName $myTenantGroupName -TenantName $myTenantName -HostPoolName $hostpoolname
04-10-2019 01:27 PM - edited 04-10-2019 02:28 PM
@christianmontoya See above regarding Tenant and Service Principal creation.
On trying to log in to Azure with the service principal I seem to be able to log in and see the Account ID, a blank subscriptionName (????), TenantID and Environment listed as AzureCloud
04-10-2019 03:13 PM - edited 04-10-2019 03:14 PM
@christianmontoya I recreated the RDS Owner role for the Service Principle Tenant, and I still get this error...
04-11-2019 12:16 AM
@GriffinDodd Did you run the Add-RdsAccount command? To run using Service Principal credentials I run the command:
Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com" -ServicePrincipal -AadTenantId "[add-your-id]"
Then enter the Service Principal AppId and password.
Running get-rdscontext should then show the username as ServicePrincipal.
04-11-2019 08:35 AM - edited 04-11-2019 09:29 AM
@tilikumtim I went through the steps you provided, however my username is returned as blank,
PS C:\WINDOWS\system32> get-rdscontext
DeploymentUrl TenantGroupName UserName
------------- --------------- --------
https://rdbroker.wvd.microsoft.com Default Tenant Group
My role assignment looks like this..
RoleAssignmentId : xxxxx-xxxx-xxxx-xxxx-xxxxxxx
Scope : /Default Tenant Group/LMRVVDTENANT/LMRVpoolname
TenantGroupName : Default Tenant Group
TenantName : LMRVVDTENANT
HostPoolName : LMRVpoolname
DisplayName :
SignInName :
GroupObjectId :
AADTenantId :
AppId : xxxxx-xxxx-xxxx-xxxx-xxxxxxx
RoleDefinitionName : RDS Owner
RoleDefinitionId : xxxxx-xxxx-xxxx-xxxx-xxxxxxx
ObjectId : xxxxx-xxxx-xxxx-xxxx-xxxxxxx
ObjectType : ServicePrincipal
Item :
I inspected the Manifest for my Svc Principal and noticed on line 2 that the appRoles value was empty, is that correct? Should it read "RDS Owner" ???
04-11-2019 09:46 AM
After completely remaking my Tenant and Service Principal I was finally able to to get a successful deployment using my UPN rather than AppID and secret.
However now, I see two Session Desktops (with no icon) in my rdweb feed, double clicking either of them errors out trying to launch an rdp file at an invalid path local path on my PC. Instead of having my proper name of "xxx xxx Dodd" (my user folder) at the beginning of the path, it simply has "Dodd" so obviously it cannot find the RDP file. When I drill down to where the RDP files are stored (along with their icons) and try and manually launch them with the remote desktop app the connection also fails with the error
"The RDP file provided is invalid. Make sure the file contains the full address and is formatted properly or contact your admin for help"
Also when in Office 365, launching the 'Windows Virtual Desktop' app resolves to an invalid URL after first trying to hit a session at account.activedirectory.windowsazure.com/applications/signin/xxxxxx and ends at https://mrs-prod.ame.gbl/mrs-RDInfra-prod
04-11-2019 10:12 AM
I have been able to successfully connect through the web client at
https://rdweb.wvd.microsoft.com/webclient/index.html
although I still see the ghost 'session desktop' icon in my feed from previous failed deployment attempts, so I need to find a way to kill that as that doesn't work.
But progress!!!
04-11-2019 06:50 PM
@GriffinDodd : You can remove that extra "session desktop" by finding that host pool and app group, and running "Remove-RdsAppGroupUser". You can then also remove the app group (Remove-RdsAppGroup) and host pool (Remove-RdsHostPool).
04-11-2019 06:52 PM
@GriffinDodd : Currently, when running service principal, the name does not come up. We are tracking this. However, it does show correctly that it is an RDS Owner (if you look at RoleDefinitionName.
04-12-2019 01:58 PM
Hi All,
My deployment is unable to join ADDS domain.
I continue to get this error, not sure why as I am able to spin up a VM on the VNet and join domain manually. The user is in AAD DC admin group. Am I missing something here?
{ "code": "VMExtensionProvisioningError", "message": "VM has reported a failure when processing extension 'joindomain'. Error message: \"Exception(s) occured while joining Domain '....onmicrosoft.com '\"." }
04-12-2019 02:04 PM
@heng008 : If you can get to the VM (either through a public IP address or by connecting through another VM on the network), you should be able to check out the errors from the domainJoin extension log. It would be under C:\Packages\ and there should be a folder for domainJoin. There should be a log (or a .status) file down in that folder that should explicitly say what the error is. (This is an extension we don't manage, but use, so that's why I'm uncertain of exact file location.)
04-12-2019 02:18 PM
@christianmontoya could you explain how to do this, I'm not much of a powershell ninja
04-12-2019 06:13 PM
I have suffered from this not matter what I have tried I have tried every step even with someone watching over my should and double checkin my work. Must have tried and failed 40 times, and that included rebuilding a new principle tearing down tenants etc... I was doing it because our domains have MFA. I finally said I am just going to try that link that says to Create Host Pool with Powershell. Was done in 15 minutes.... The SPN/APP needs help. Also, order of Docs seems very off to me. Link to PowerShell build of Hostpool Create a host pool with PowerShell
04-17-2019 01:20 PM
@ccbrownkc : What would be the preferred order to help complete the onboarding?
06-13-2019 10:24 PM
@Erjen Rijnders wrote:And make sure, that the user you are using joining the VM's to the domain, is also having Owner access on the Azure subscription.
It needs to be able to run PowerShell DSC on the VM's.
Do you have any pointers to this? I have not seen this mentioned anywhere else, and I am not satisfied with having a local AD user have owner rights on a subscription.
For other reasons I am going to remove my WVD setup and start over, and I want to be sure to do every little bit right this time :)
Thanks!
06-14-2019 12:19 AM
@Oletho I think it was in the Microsoft docs at first but not sure. But at least you can try it for testing purposes en take away the permissions later. The deployment of WVD won't tell you if you have not enough permissions on your subscription. But I think the "Virtual Machine Contributor" role should work too.
06-14-2019 09:19 AM
@Oletho : The local AD user that will domain-join the VMs does not need to have any Azure permissions (my test tenant certainly does not).
06-14-2019 11:44 PM
@christianmontoya then how is it able to push PowerShell DSC commands? You need permissions on your Azure tenant.
06-15-2019 09:38 PM
@Erjen Rijnders @christianmontoya
My hostpool succeeded, domain joining with a local AD user (not AAD sync'ed) with no permissions but joining computers to my local AD. Exactly the behaviour I was hoping for.
I cannot tell about the PS DSC question, but all lights are green and I take that as a good sign.
06-17-2019 03:03 PM
@Erjen Rijnders : The permission to retrieve and run DSC is authorized when you run the template. Afterwards, as long as the VM can reach out and download the DSC package, it will run it (not exactly sure if it runs in the context of the local admin or the Azure VM Agent).