Skip to content

Commit

Permalink
Support env vars with hyphens when printing output (Azure#15818)
Browse files Browse the repository at this point in the history
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
  • Loading branch information
azure-sdk and JoshLove-msft authored Oct 9, 2020
1 parent 259df39 commit 7075347
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ $shell, $shellExportFormat = if (($parentProcessName = (Get-Process -Id $PID).Pa
} elseif (@('bash', 'csh', 'tcsh', 'zsh') -contains $parentProcessName) {
'shell', 'export {0}={1}'
} else {
'PowerShell', '$env:{0} = ''{1}'''
'PowerShell', '${{env:{0}}} = ''{1}'''
}

# Deploy the templates
Expand Down
32 changes: 16 additions & 16 deletions eng/common/TestResources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ Along with some log messages, this will output environment variables based on
your current shell like in the following example:

```powershell
$env:AZURE_TENANT_ID = '<<secret>>'
$env:AZURE_CLIENT_ID = '<<secret>>'
$env:AZURE_CLIENT_SECRET = '<<secret>>'
$env:AZURE_SUBSCRIPTION_ID = 'YOUR SUBSCRIPTION ID'
$env:AZURE_RESOURCE_GROUP = 'rg-myusername'
$env:AZURE_LOCATION = 'westus2'
$env:AZURE_SEARCH_STORAGE_NAME = 'myusernamestg'
$env:AZURE_SEARCH_STORAGE_KEY = '<<secret>>'
${env:AZURE_TENANT_ID} = '<<secret>>'
${env:AZURE_CLIENT_ID} = '<<secret>>'
${env:AZURE_CLIENT_SECRET} = '<<secret>>'
${env:AZURE_SUBSCRIPTION_ID} = 'YOUR SUBSCRIPTION ID'
${env:AZURE_RESOURCE_GROUP} = 'rg-myusername'
${env:AZURE_LOCATION} = 'westus2'
${env:AZURE_SEARCH_STORAGE_NAME} = 'myusernamestg'
${env:AZURE_SEARCH_STORAGE_KEY} = '<<secret>>'
```

For security reasons we do not set these environment variables automatically
Expand All @@ -62,14 +62,14 @@ applications started outside the terminal, you could copy and paste the
following commands:

```powershell
setx AZURE_TENANT_ID $env:AZURE_TENANT_ID
setx AZURE_CLIENT_ID $env:AZURE_CLIENT_ID
setx AZURE_CLIENT_SECRET $env:AZURE_CLIENT_SECRET
setx AZURE_SUBSCRIPTION_ID $env:AZURE_SUBSCRIPTION_ID
setx AZURE_RESOURCE_GROUP $env:AZURE_RESOURCE_GROUP
setx AZURE_LOCATION $env:AZURE_LOCATION
setx AZURE_SEARCH_STORAGE_NAME $env:AZURE_SEARCH_STORAGE_NAME
setx AZURE_SEARCH_STORAGE_KEY $env:AZURE_SEARCH_STORAGE_KEY
setx AZURE_TENANT_ID ${env:AZURE_TENANT_ID}
setx AZURE_CLIENT_ID ${env:AZURE_CLIENT_ID}
setx AZURE_CLIENT_SECRET ${env:AZURE_CLIENT_SECRET}
setx AZURE_SUBSCRIPTION_ID ${env:AZURE_SUBSCRIPTION_ID}
setx AZURE_RESOURCE_GROUP ${env:AZURE_RESOURCE_GROUP}
setx AZURE_LOCATION ${env:AZURE_LOCATION}
setx AZURE_SEARCH_STORAGE_NAME ${env:AZURE_SEARCH_STORAGE_NAME}
setx AZURE_SEARCH_STORAGE_KEY ${env:AZURE_SEARCH_STORAGE_KEY}
```

After running or recording live tests, if you do not plan on further testing
Expand Down

0 comments on commit 7075347

Please sign in to comment.