A neat little trick I came across recently was that you can connect to a Teams PowerShell session within the Azure Shell. Even better, you do not need to install or import the module, or even enter your credentials (thanks Managed Identity)! Simply do the following:
- Login to https://shell.azure.com
- Within the PowerShell prompt enter
- Run a Teams PowerShell command
Cs cmdlets (e.g. Get-CsApplicationAccessPolicy) do NOT currently work with the above method and return an error. However, there is a workaround:
- Authenicate with the Teams PowerShell module using a device code
- Once signed in, you can now use Cs cmdlets
This blog post is part of Microsoft Teams Week. Find more great blogs here.
About the Author:
Hi – I’m Lee.
You can follow me on Twitter at @lee_ford
Ford, L. (2021). Use the Teams PowerShell Module in Azure Shell. Available at: https://www.lee-ford.co.uk/use-teams-ps-module-in-az-shell/ [Accessed: 2nd December 2021].