From 110110a43f12fab80a01bee36291d7840bbd8496 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 14 Apr 2020 13:33:32 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools repository (#72) --- eng/common/TestResources/README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/eng/common/TestResources/README.md b/eng/common/TestResources/README.md index 522bbc6b0..89e61a4cb 100644 --- a/eng/common/TestResources/README.md +++ b/eng/common/TestResources/README.md @@ -1,7 +1,7 @@ # Live Test Resource Management Running and recording live tests often requires first creating some resources -in Azure. Service directories that include a test-resources.yml file require +in Azure. Service directories that include a test-resources.json file require running [New-TestResources.ps1][] to create these resources and output environment variables you must set. @@ -11,6 +11,11 @@ scenarios as well as on hosted agents for continuous integration testing. * [New-TestResources.ps1][] - Creates new test resources for a given service. * [Remove-TestResources.ps1][] - Deletes previously created resources. +## Prerequisites + +1. Install [PowerShell][] version 7.0 or newer. +2. Install the [Azure PowerShell][PowerShellAz]. + ## On the Desktop To set up your Azure account to run live tests, you'll need to log into Azure, @@ -68,13 +73,20 @@ setx AZURE_SEARCH_STORAGE_KEY $env:AZURE_SEARCH_STORAGE_KEY ``` After running or recording live tests, if you do not plan on further testing -you can remove the test resources you created above by running +you can remove the test resources you created above by running: [Remove-TestResources.ps1][]: ```powershell Remove-TestResources.ps1 -BaseName 'myusername' -Force ``` +If you created a new service principal as shown above, you might also remove it: + +```powershell +Remove-AzADServicePrincipal -ApplicationId $sp.ApplicationId -Force + +``` + If you persisted environment variables, you should also remove those as well. ## In CI @@ -109,4 +121,6 @@ PowerShell markdown documentation created with [platyPS][]. [New-TestResources.ps1]: ./New-TestResources.ps1.md [Remove-TestResources.ps1]: ./Remove-TestResources.ps1.md + [PowerShell]: https://github.com/PowerShell/PowerShell + [PowerShellAz]: https://docs.microsoft.com/powershell/azure/install-az-ps [platyPS]: https://github.com/PowerShell/platyPS