Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.79 KB

powershell-add-user-and-get-subscription-key.md

File metadata and controls

44 lines (30 loc) · 1.79 KB
title description services documentationcenter author manager editor ms.service ms.workload ms.topic ms.date ms.author ms.custom
Azure PowerShell Script Sample - Add a user | Microsoft Docs
Learn how to add a user in API Management and get a subscription key. See a sample script and view additional available resources.
api-management
dlepow
cfowler
api-management
mobile
sample
11/16/2017
danlep
mvc, devx-track-azurepowershell

Add a user

This sample script creates a user in API Management and gets a subscription key.

[!INCLUDE updated-for-az]

[!INCLUDE cloud-shell-try-it.md]

If you choose to install and use the PowerShell locally, this tutorial requires the Azure PowerShell module version 1.0 or later. Run Get-Module -ListAvailable Az to find the version. If you need to upgrade, see Install Azure PowerShell module. If you are running PowerShell locally, you also need to run Connect-AzAccount to create a connection with Azure.

Sample script

[!code-powershellmain]

Clean up resources

When no longer needed, you can use the Remove-AzResourceGroup command to remove the resource group and all related resources.

Remove-AzResourceGroup -Name myResourceGroup

Next steps

For more information on the Azure PowerShell module, see Azure PowerShell documentation.

Additional Azure PowerShell samples for Azure API Management can be found in the PowerShell samples.