Giter Site home page Giter Site logo

burakmercan / azure-starter-for-wvd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marcelmeurer/azure-starter-for-wvd

0.0 0.0 0.0 28.38 MB

Azure Starter for Windows Virtual Desktop - a self-service web app to let the user start and deallocate there personal VDI's

CSS 0.27% JavaScript 91.74% HTML 7.95% ASP.NET 0.04%

azure-starter-for-wvd's Introduction

Azure Starter for Windows Virtual Desktop

Azure Starter for WVD is a self-service portal to let users start and deallocate there own personal VDI's running in Windows Virtual Desktop.

Users can easily log on to the web app using their Azure AD credentials. The personal assigned VDI's are listed can be switched on or off. Switching off deallocates the VDI in Azure to avoid unnecessary costs.

Roadmap

  • Preview
  • Review preview and make some improvements
  • Automatically deallocate unused VDIs / session hosts
  • Allow some customization

Screenshot

Install-WVDStarter-14

Assigned VDIs / session hosts

An administrator can assign a user to a VDI / session host with PowerShell or with #WVDAdmin - or, a user has been assigned automatically after the first login to a session host. Install-WVDStarter-00

Azure Starter for WVD is a web app to be deployed in the customer's subscription and tenant. To rollout, the solution clicks Deploy to Azure. After rolling out the solution, an Azure service principal has to be created to allow logon to the web app and to start/deallocate the VMs / session hosts. The service principal manages the VMs / session hosts - the users don't need access to the Azure portal.

Rollout the solution by clicking deploy to Azure

Install-WVDStarter-01

After the deployment open the created web app and copy the generated URL to configure your service principal.

Install-WVDStarter-02

Create a service principal

To work with the portal you need a service principal (function account) with the permission to start and deallocate session hosts in your WVD tenant or tenants.

To create a service principal go to your Azure Ad -> App registration -> New registration and type a name for your principal like “ svc_WVDStarter” and press “register”.

Install-WVDStarter-03

Click on "Authentication" and the platform "Web".

Install-WVDStarter-04

Enter the redirect URI. The redirect URI is the generated URL from above appended with "/.auth/login/aad/callback". E.g.: https://wvdstarter-j34z4nrielvjy.azurewebsites.net/.auth/login/aad/callback

Additionally, select "ID Tokens".

Install-WVDStarter-05

Click on “certificates & secrets”. Click “new client secret”, select a validity period and a description (like “Key01”). Press “add”.

Install-WVDStarter-06

Copy the generated key directly - it will never be displayed again. Note the key for later.

Install-WVDStarter-07

Go to “Overview”. Note the “Application (client) ID” and the “Directory (tenant) ID” as well.

Install-WVDStarter-08

You have to use PowerShell to give the service principal the appropriated permission to access the WVD tenant(s).

Import-Module -Name Microsoft.RDInfra.RDPowerShell 
# log on with an administrative user account to your  
Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"   

# give your service principal the right permission 
New-RdsRoleAssignment -TenantName "Builder City" -RoleDefinitionName "RDS Reader" -ApplicationId 85b995d2-3xxx-xxxx-xxxx-000000000000

Install-WVDStarter-09

Open the Azure portal and go to the resource groups. Go into each resource group containing your Azure VMs / VDIs / session hosts "Virtual Machine Contributor" (not the classic one), click “Access control (IAM)” -> select “Add” -> Add role assignment. Select “contributor” and search in “select” for your service principal name. Click the principal and save the settings.

WVD Spring Update: Add the service principal with the Reader Role permission to the resource group containing the host pools

Install-WVDStarter-12

Install-WVDStarter-13

Enter the data from the portal service principal into the portal configuration. Go to the deployed resources and open the web app. Open configuration and change the following values:

  • ida:ClientId
  • ida:ClientSecret
  • ida:TenantId your Azure AD tenant id

Install-WVDStarter-10

Restart the web app.

Install-WVDStarter-11

Access the web app and log in with an user account having access to assigned VDIs / session hosts. Recommendation: Do this once with a global admin to consent in behalf of all users.

Install-WVDStarter-14

Auto-deallocate unused VDIs

The version from 2020.02.09 supports a new feature to deallocate per automatically personal assigned session hosts are not used over a specific time. If you have an older installation, you need to update it.

This feature runs in the background and is independent of users logged on to the web site of WVD Starter. It's monitors session hosts and de-allocates them if there was no session for at least the last n-minutes.

Note: If the engine is still running and a session host / VM has been de-allocated by the engine, don't start this VM from the portal. If no user connects, the VM will still be running.

To use this feature, configure the following settings on the web app running WVD Starter.

  • config:autoDeallocateMinutes Define the minimum time in minutes after no session is connected to deallocate the session host ;0 to disable.
  • config:autoDeallocateHostPools A comma-separated string value with the name of the host pools which should be processed. Add Use the real name (not the friendly name). An empty value handles all persistent host pools.
  • config:autoDeallocateCronJobMinutes Define the time in minutes in what interval the engine checks the power state and deallocate session hosts.

Install-WVDStarter-16

Hints:

  • Use group or local policies to log off disconnected sessions after a specific time.
  • Use a value for config:autoDeallocateMinutes high enough to allow users to log in after the start of the session host.
  • The effective time of deallocating sessions varies because of the different actions, caches, and triggering the cronjob. It can take twice of the configured time of config:autoDeallocateMinutes or config:autoDeallocateCronJobMinutes.
  • Don't forget to update the solution.

Windows Virtual Desktop Spring Update

The version from May the 10th supports the WVD Spring update. To activate the spring update configure the following settings on the web app running WVD Starter.

  • config:featureMode 0=Fall update only, 1=Spring and Fall update, 2=Spring update only
  • Add the service principal with the Reader Role permission to the resource group containing the host pools

Remote Desktop to VM support

If you configure, you can list tagged VMs in Azure for a user and allow users to start and stop this VM - independently from WVD. The user can then access the VM directly via RDP on the internal IP address. It's for administrative work only (check the MS licensing to do that) and allows multiple VMs per user/admin. The user/admin doesn't need access to the Azure Portal to do that. Keep in mind that auto-deallocating will not work for this kind of VMs.

Screen shot: https://twitter.com/MarcelMeurer/status/1323655038624038918

  • config:featureMode 0 Classic (Fall update) 1 ARM, Classic 2 ARM 3 Classic, RDS 4 ARM, Classic, RDS 5 ARM, RDS 6 RDS
  • Add the service principal with the Virtual Machine Contributor Role permission to the resource group containing the VMs
  • Tag the VM with the UPN of the user: RDS.User

Customization

A licensed version can be customized with a logo and a custom header. Additionally, a custom css file can be referenced. Start customizing by adding or editing the app setting on the deployed web app (all settings are optional):

custom:LogoUrl

custom:Header

custom:CSS

custom:IgnoreAboutAndContact

Setting Value
custom:LogoUrl Url to you logo
custom:Header A custom text like "VDI Starter for Company"
custom:CSS Url to a custom css file (use an Azure blob storage and configure the CORS setting to let it work)
custom:IgnoreAboutAndContact "1" remove the buttons for About and Contact in the web app

Update your deployment to the newest version

Azure App Starter for WVD can be updated from GitHub very quickly. Open the web app in the Azure portal, navigate to "Deployment Center" and click "Refresh". This pulls a newer version from the repo to update the app.

Install-WVDStarter-15

License

The software is provided "As is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

This software is free to use as a community edition without support for non-commercial environments. To get a special quote for a supported and commercial version, contact [email protected].

To activate a license code change the settings on the web app running WVD Starter:

  • LicenseKey Enter the license key provided

Working with different Azure AD tenants (Microsoft Demo Environment)

Usually, the WVD tenant and the resources (sessions hosts) are in the same AAD tenant. If this not read this document to use Azure Starter for WVD in this environment: 2-Tenant-Environment.md

Deploy to Azure

azure-starter-for-wvd's People

Contributors

marcelmeurer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.