Single-Command Power Platform Hands-on-Lab Configuration

Single-Command Power Platform Hands-on-Lab Configuration

This article is contributed. See the original author and article here.

Suppose you are a community leader or an instructor who will run a hands-on lab session for Power Platform. You got content for it. Now it’s time for setting up the lab environment. There are roughly three approaches for the preparation.


 



  1. Ask the participants to bring their existing Power Platform environment,

  2. Ask the participants to set up their environment by themselves, or

  3. The session leader is preparing the environment for the participants to use.


 


Each effort has its pros and cons like:


 



  1. The first approach would be the easiest and the most convenient for the instructor because it’s based on the assumption that everyone is ready for the exercise. However, you never know if every participant has the same configurations as you expect. It really depends on their organisation’s policy. After all, you, as the session leader, will probably suffer from a lot of unexpected circumstances.

  2. The second one can be convenient for you as the session leader. It might be as tricky as the first approach. Delegating the environment set-up efforts to the participants may make you free, but at the same time, you should provide an instructional document very thoroughly and carefully. Even if you do so, it entirely depends on the participants’ capability. After all, you should start the lab session by confirming the environment set-up anyway.

  3. The last option goes to you as the session leader. You prepare everything for the participants. They just come, sit and practice. If you do this set-up by hand, it would be awful. You will not want to do that.


 


Therefore, as a hands-on lab session leader, I’m going to discuss how to automate all the provisioning process and minimise human intervention by running one PowerShell script.


 



The PowerShell script used in this post is downloadable from this GitHub repository.



 


One-Liner Script


 


Let’s say you use the following information for the admin account.


 



  • Tenant Name: powerplatformhandsonlab

  • Tenant URL: powerplatformhandsonlab.onmicrosoft.com

  • Admin E-mail: admin@powerplatformhandsonlab.onmicrosoft.com

  • Admin Password: Pa$$W0rd!@#$


 


With this information, how can you set up the lab environment in just one go? Here’s the entire script and you just run the command below.


 


    ./Set-Environment.ps1 `
-AdminUsername “admin” `
-AdminPassword “Pa`$`$W0rd!@#`$” `
-TenantName “powerplatformhandsonlab”

 


Wait, what? What’s going on? Here’s the magic. Let’s find them together.


 


Create Microsoft 365 Tenant


 


The first step to do as the session leader is to create a Microsoft 365 tenant. Microsoft 365 offers a free trial for 30 days. It includes 25 seats, including the admin account, which is suitable for the lab. Click this link, http://aka.ms/Office365E5Trial, and create the Microsoft 365 E5 plan’s trial tenant.


 


Microsoft 365 E5 Trial Landing Page


 


After filling out the form below, you get the trial tenant!


 


Microsoft 365 E5 Trial Sign-up Page


 


As you’ve got a new tenant, let’s configure the lab environment in PowerShell. Please note that you HAVE TO use the PowerShell console with the admin privilege.


 


Provisioning Order


 


There is no particular order for the environment provisioning. However, I would recommend following this order because there’s incompatibility found between PowerShell modules especially between Power Apps and AzureAD:


 



  1. Activate Microsoft Dataverse for Power Platform Default Environment

  2. Add User Accounts

  3. Assign Microsoft 365 Roles to Accounts

  4. Assign Microsoft 365 Licenses to Accounts

  5. Assign Azure Roles to Accounts


 


If you do the Microsoft Dataverse initialisation later than Azure AD, you will get an error. I’ll discuss it later how to avoid it.


 



NOTE: To use any of the PowerShell module mentioned in this post, you need PowerShell v5.1 running on Windows. PowerShell Core (v6 and later) doesn’t support this scenario. For more details about this, refer to this page, Connect to Microsoft 365 with PowerShell.



 


Install AzureAD Module


 


You can add a new user account to a Microsoft 365 tenant through the AzureAD module. As of this writing, the latest version of the module is 2.0.2.130. Use the Install-Module cmdlet to install the module. If you append these two parameters, -Force -AllowClobber (line #3), it always installs the newest version regardless it’s already installed or not.


 


    Install-Module -Name AzureAD `
-Scope AllUsers -Repository PSGallery `
-Force -AllowClobber

 


Log-in to AzureAD as Admin


 


After installing the module, log into the Azure AD as the tenant admin. For automation, you should stay within the console. Therefore, the following command is more efficient for sign-in.


 


    $tenantName = “powerplatformhandsonlab”
$adminUpn = “admin@$tenantName.onmicrosoft.com”
$adminPW = ConvertTo-SecureString “Pa`$`$W0rd!@#`$” -AsPlainText -Force
$adminCredential = New-Object `
-TypeName System.Management.Automation.PSCredential `
-ArgumentList ($adminUpn, $adminPW)

$connected = Connect-AzureAD -Credential $adminCredential


 


Add User Accounts


 


It’s time to add user accounts. As the trial tenant includes 25 licenses, you can add up to 24 accounts. For more details to add a new user account, refer to this document, Create Microsoft 365 User Accounts with PowerShell. But you just run the following commands. Here are some assumptions:


 



  • Each user has the same password of UserPa$$W0rd!@#$ for convenience, and it’s not allowed change (line #2-4).

  • Each user has the same location where the tenant resides. For now, it’s KR (line #6).

  • You need to create up to 24 accounts, so ForEach-Object is the go (line #9).

  • All user accounts created are added to the $users array object (line #18).


 


    $userPWProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$userPWProfile.Password = “UserPa`$`$W0rd!@#`$”
$userPWProfile.EnforceChangePasswordPolicy = $false
$userPWProfile.ForceChangePasswordNextLogin = $false

$usageLocation = “KR”

$users = @()
(1..24) | ForEach-Object {
$user = New-AzureADUser `
-DisplayName $(“PPUser” + $_.ToString(“00”)) -GivenName $(“User” + $_.ToString(“00”)) -SurName “PP” `
-UserPrincipalName $(“ppuser” + $_.ToString(“00”) + “@$tenantName.onmicrosoft.com”) `
-UsageLocation $usageLocation `
-MailNickName $(“ppuser” + $_.ToString(“00”)) `
-PasswordProfile $userPWProfile `
-AccountEnabled $true

$users += $user
}


 


Assign Microsoft 365 Roles to User Accounts


 


The user accounts need to have appropriate Microsoft 365 roles. As it’s the hands-on lab configuration, you can assign the Power Platform admin role to each user account. For more details of the Microsoft roles assignment, refer to this Assign Admin Roles to Microsoft 365 User Accounts with PowerShell page. Run the following command to activate the Power Platform admin role.


 


    $roleName=”Power Platform Administrator”

$role = Get-AzureADDirectoryRole | Where-Object { $_.DisplayName -eq $roleName }
if ($role -eq $null) {
$roleTemplate = Get-AzureADDirectoryRoleTemplate | Where-Object { $_.DisplayName -eq $roleName }
$enabled = Enable-AzureADDirectoryRole -RoleTemplateId $roleTemplate.ObjectId

$role = Get-AzureADDirectoryRole | Where-Object { $_.DisplayName -eq $roleName }
}


 


The admin role has now been stored in the $role object. Now, iterate the $users array to assign the role.


 


    $users | ForEach-Object {
$assigned = Add-AzureADDirectoryRoleMember `
-ObjectId $role.ObjectId `
-RefObjectId $_.ObjectId
}

 


Assign License to User Accounts


 


To use Power Platform within the tenant, each user MUST have a license for it. You can assign the license through the PowerShell command. For more details, visit this Assign Microsoft 365 licenses to user accounts with PowerShell page.


 


First of all, let’s find out the licenses. As soon as you create the trial tenant, there SHOULD be only one license, whose name is ENTERPRISEPREMIUM.


 


    Get-AzureADSubscribedSku

 


Then, run the following command to assign the license to all users by iterating the $users array.


 


    $sku = Get-AzureADSubscribedSku

$license = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicense
$license.SkuId = $sku.SkuId

$licensesToAssign = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses
$licensesToAssign.AddLicenses = $license

$users | ForEach-Object {
$assigned = Set-AzureADUserLicense -ObjectId $_.ObjectId -AssignedLicenses $licensesToAssign
}


 


So far, you’ve completed automating processes to create a trial tenant, create user accounts, and assign roles and licenses.


 


Activate Microsoft Dataverse for Power Platform Default Environment


 


Power Platform internally uses Microsoft Dataverse as its database. Microsoft Dataverse is fundamentally essential for other Microsoft 365 services to use. You can also initialise it through PowerShell commands. For more details, visit the Power Apps Cmdlets for Administrators page.


 


First, you need to install both PowerShell modules, Microsoft.PowerApps.Administration.PowerShell and Microsoft.PowerApps.PowerShell. Like the previous installation process, use the -Force -AllowClobber option to install the modules or reinstall both if they already exist (line #3, 7).


 


    Install-Module -Name Microsoft.PowerApps.Administration.PowerShell `
-Scope AllUsers -Repository PSGallery `
-Force -AllowClobber

Install-Module -Name Microsoft.PowerApps.PowerShell `
-Scope AllUsers -Repository PSGallery `
-Force -AllowClobber


 


Log into the Power Apps admin environment, using $adminUpn and $adminPW values.


 


    $connected = Add-PowerAppsAccount -Username $adminUpn -Password $adminPW

 



NOTE: You might not be able to log into the Power Apps admin environment with the following error.


 


Unable to Login to Power Apps Environment


 


It’s because the internal log-in process for both Microsoft 365 tenant and Power Apps environment are different from each other. If it happens to you, don’t panic. Just open a new PowerShell console with an admin privilege and attempt to log in.



 


Here are some assumptions for the Microsoft Dataverse initialisation:


 



  • Initialise Microsoft Dataverse on the default environment (line #1),

  • Follow the currency settings of the default environment (line #5), and

  • Follow the language settings of the default environment (line #10).


 


    $paenv = Get-AdminPowerAppEnvironment -Default
if ($paenv.CommonDataServiceDatabaseProvisioningState -ne “Succeeded”) {
$currency = Get-AdminPowerAppCdsDatabaseCurrencies `
-LocationName $paenv.Location | Where-Object {
$_.IsTenantDefaultCurrency -eq $true
}

$language = Get-AdminPowerAppCdsDatabaseLanguages `
-LocationName $paenv.Location | Where-Object {
$_.IsTenantDefaultLanguage -eq $true
}

$activated = New-AdminPowerAppCdsDatabase `
-EnvironmentName $paenv.EnvironmentName `
-CurrencyName $currency.CurrencyName `
-LanguageName $language.LanguageName
}


 


Assign Azure Subscription


 


Building custom connectors is inevitable while using Power Platform. In this case, you might need to handle resources on Azure, which requires an Azure subscription. If you create the trial tenant for Microsoft 365, you can also activate the trial Azure subscription. As it requires credit card verification, it MUST be done within Azure Portal. If you log into Azure Portal with your admin account, you can see the following screen.


 


Azure Subscription Trial Page


 


Click the Start button to sign-up for the trial subscription.


 


Azure Subscription Trial Sign-up Page


 


Once completing the trial subscription, log in to Azure using the PowerShell command below. The $adminCredential object is the same one used for Azure AD log-in.


 


    $connected = Connect-AzAccount -Credential $adminCredential

 



NOTE: You SHOULD install the Az module beforehand.


 


    Install-Module -Name Az -Scope AllUsers -Repository PSGallery -Force -AllowClobber


 


Only a limited number of resources are available in the trial subscription. For custom connectors, mainly Azure Logic Apps, Asture Storage Account, Azure Virtual Network, Azure API Management and Azure Cosmos DB are supposed to use. Therefore, to use those resources, run the following command to register those resource providers.


 


    $namespaces = @(
“Microsoft.Logic”,
“Microsoft.Storage”,
“Microsoft.Network”,
“Microsoft.ApiManagement”,
“Microsoft.DocumentDB”
)

$namespaces | ForEach-Object {
$provider = Get-AzResourceProvider `
-ProviderNamespace $_ | Where-Object { $_.RegistrationState -eq “Registered” }
if (($provider -eq $null) -or ($provider.Count -eq 0)) {
$registered = Register-AzResourceProvider -ProviderNamespace $_
}
}


 


Then, assign the subscription to each user account. For Azure Roles, visit this Assign Azure Roles Using Azure PowerShell page for more details.


 



NOTE: Instead of scoping the entire subscription to each user account, it’s better to create a resource group for each user, scope to the resource group and assign it to each account. For the resource group, you need a location. In this example, koreacentral is used.



 


    $role = Get-AzRoleDefinition | Where-Object { $_.Name -eq “Contributor” }
$location = “koreacentral”

$users | ForEach-Object {
$rg = Get-AzResourceGroup | Where-Object {
$_.ResourceGroupName -eq $(“rg-” + $_.MailNickName)
}
if ($rg -eq $null) {
$rg = New-AzResourceGroup `
-Name $(“rg-” + $_.MailNickName) `
-Location $location
}

$assigned = New-AzRoleAssignment `
-ObjectId $_.ObjectId `
-RoleDefinitionId $role.Id `
-Scope $rg.ResourceId
}


 


All users are now able to access to Azure resources for the exercise.


 




 


So far, we’ve walked through how to automatically provision a Power Platform environment for hands-on labs, using PowerShell. Now, if you are going to run a hands-on lab session and need a new environment, simply run the code above. Then, it’s all good to go!


 


This article was originally published on Dev Kimchi.

How to show profile picture in Person column in SharePoint list/library?

How to show profile picture in Person column in SharePoint list/library?

This article is contributed. See the original author and article here.

Introduction


 


Currently, Microsoft released a new update to the show profile picture of the user column in the SharePoint list/library. So in this article, we will see how to use this feature in our list or library. for more details refer to this.


 


 


How to use it?


 


1. Log in to any SharePoint Modern Site.


2. Move to the modern list/library


3. Create a Person column in List/Library as below,


 


 


22.png


 


4. Turn on to show profile photo to see profile URL.


 


1.png


 


 


4. Then create a list item and check it in the list/library view.


 


3.png


 


Summary


 


In this article, we have seen how to show the profile picture in the person column.


 


Hope this helps!


 


Sharing is caring!


 

New Video blog – Apply DLP policies to Non Microsoft Cloud Applications!

This article is contributed. See the original author and article here.

We recently announced the addition of integration of unified data loss prevention with Microsoft Cloud App Security (MCAS), allowing you to extend data protection to non-Microsoft cloud apps. For example, say a user is trying to share a document in a third-party app on his or her mobile device. Because Microsoft Cloud App Security helps protect cloud apps, the same DLP policy will be triggered, both the end-user and the admin will receive a notification, and in this case, the link will be automatically disabled.


Watch our short video to understand how this works and don’t forget to vote for more videos!


 


https://8gportalvhdsf9v440s15hrt.blob.core.windows.net/videos/Security%20Privacy%20Compliance/EndpointDLPUsecasesUnallowedApps.mp4


aka.ms/mipc/vblogsvote


 


Thank you!

Rapid Development with Azure Spring Cloud Webinar and Workshop

This article is contributed. See the original author and article here.

Spring is the #1 framework for Java and millions of developers love using it. Spring Boot and Spring Cloud provide a robust platform for developing and operating microservice applications. The challenge many developers face is having to create, configure, and maintain Spring Cloud infrastructure. Setting up scaling, installing and managing multiple components, and wiring up the application to your logging can be complex and take time away from working on your apps.


 


That is why VMware and Microsoft teamed up to create Azure Spring Cloud – a fully managed service for Spring Boot and .NET Core apps operated by Microsoft. Azure Spring Cloud makes it easy to get your apps to production. Azure Spring Cloud abstracts away the complexity of infrastructure and Spring Cloud middleware management, so you can focus on building your business logic and let Azure take care of dynamic scaling, security patches, compliance standards, and high availability.


 


With a few clicks, you can provision an Azure Spring Cloud instance. After configuring a couple dependencies in your POM file, your Spring Cloud app is automatically wired up with Spring Cloud Config Server and Service Registry. Furthermore, you can deploy and scale Spring Boot applications in seconds.


 


Sounds great right? I bet you’re wondering how you can learn more. Microsoft and VMware have you covered with a webinar and workshop series where you can see how easy it is to get up and running with Azure Spring Cloud. It’s free and open to all – just register for using the links below. We’ll see you there!


 


 


Rapid Development with Azure Spring Cloud Webinar and Workshop


 


Webinar date/time: April 15 – 11:00 AM PDT and then available on-demand


Register: Sign-up now


Join Josh Long (Developer Advocate at VMware) and Julien Dubois (Cloud Developer Advocate at Microsoft) as they provide an overview of Azure Spring Cloud and demo some of the topics that will be covered in the hands-on workshop. You’ll see how to: 



  • Deploy an application using a JAR file or code.

  • Scale up and down based on load or schedule using Autoscale.

  • Monitor your apps with logs, metrics, and tracing using Application Insights.

  • And more! And it can all be done in just a few minutes.


 


Workshop date and time options:



  • April 21 – 11:00 AM PDT | 2:00 PM EDT

  • April 28 – 12:00 AM PDT | 8:00 AM BST

  • May 5 – 6:00 PM PDT | 9:00 AM SGT


Register: Sign-up today


Join the experts from VMware and Microsoft at this virtual event will give you an introduction to Java and Spring microservice architecture and application development You will:



  • Create an Azure Spring Cloud cluster and build Spring Cloud microservices that use Azure Cosmos DB and Azure Database for MySQL.

  • Configure a Spring Cloud Config server that is managed by Azure Spring Cloud and set up application logs to easily troubleshoot common issues.

  • Put it all together to create a complete microservice stack and learn how to make microservices talk to each other for efficient communication.

  • And more!

Introducing Modern Comments in Microsoft Word

Introducing Modern Comments in Microsoft Word

This article is contributed. See the original author and article here.

Workplace collaboration is evolving—and so is Microsoft Word. Today, we’re pleased to announce expanded availability of our new modern commenting experience across Word platforms


 


Modern comments sets the stage for a richer Word collaboration experience for you and your teams by enabling modern features such as @mention notifications and more. It aligns how comments work across Office on different endpoints, so that you and your team can rely on a consistent experience regardless of whether you’re using Word, Excel, or PowerPoint on any platform.


 


Modern comments was first introduced on the mobile and Web versions of Word where we iterated based on feedback.  Now it is rolling out to Production on Word for Windows, and Current Channel (Preview) on Word for Mac!   


 



 


Here’s a look at what to expect:


 


Stay in control 


With modern comments, you no longer have to worry about your comments being seen by others before you’re finished editing them. After you draft a new comment or reply, click the Post button or use the keyboard shortcut Ctrl+Enter (Windows) or Cmd + Enter (MacOS) to share your thoughts with others.   Now, a comment or reply can only be edited by the person who created it. 


 

reply.gif


 


Flexibility in how you view and interact with comments 


In Word you’ll find comments to the right of your page, by default. In this view, contextual comments are side-by-side with the page content, to help you focus on the feedback that’s most relevant to the part of the document you’re working on.  


In the Comments pane, you can see a single list of all comments in your document, including resolved comments.  To switch between the contextual view and the Comments pane, simply click the Comments button in the upper right corner of your Word window. 


 

pane.gif


 


Resolve comment threads 


Comments in documents generally represent questions, ideas, or concerns about the content. When those have been addressed, comments allow you to mark that thread as resolved. Resolved comment threads won’t appear in the contextual view (though you can still find them in the Comments pane) to help you stay focused on what’s active. 


 


reply.gif


 


Improved @mentions in comments


Users have been adding names to comments for years. Now, if you’re an enterprise user working on cloud files, you can more easily use an @mention to call out to one or more of your colleagues in your organization or school.  Just highlight some text, click the Comment button, type your comment, and @mention anyone you want to see it.


 


When you post your comment, anybody that you’ve @mentioned in it will get an email notification. Whoever started the comment thread will also be notified. Notification emails let your collaborators know there’s been new activity in the comment thread, gives them a preview of the document content where the comment was made, as well as the comment you left. They can reply to your comment from the email, or they can click a link in the notification email to open the document and go straight to the comment if they want to see more context. 


 


Better collaboration practices for today’s remote world


These new commenting experiences are ideal for today’s remote teams who may be working together from across town or around the world.  Comments eliminate the need to coordinate schedules or conduct in-person discussions, providing greater flexibility and enabling collaborators to provide better insights.  A consistent experience across applications makes everything flow smoothly.


 


We’re continuing to iterate on Modern comments and other collaboration features in Office, and your feedback plays an invaluable role in the process.  If you have the new commenting experience in Word, let us know what you think and what you’d like to see next!  


 


If you don’t have Modern Comments yet but can’t wait to try it, join our Office Insider Program.


 


See our support page for more information: Using Modern Comments in Word.