Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user id to default context name to avoid context clashing #6797

Merged
merged 3 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ public bool TryGetContextName(IAzureContext context, out string name)
if (context != null)
{

if (context.Subscription != null)
if (context.Subscription != null && context.Account != null)
{
name = string.Format("{0} - {1}", context.Subscription.Name, context.Subscription.Id);
name = string.Format("{0} ({1}) - {2}", context.Subscription.Name, context.Subscription.Id, context.Account.Id);
result = true;
}
else
Expand Down
32 changes: 17 additions & 15 deletions src/ResourceManager/Profile/Commands.Profile/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- Additional information about change #1
-->
## Current Release
* Add user id to default context name to avoid context clashing
- https://github.com/Azure/azure-powershell/issues/6489
* Updated Common.Strategy library to be able to validate that the current config for a resource is compatible with the target resource. Default is always true, individual resources and overridet the default.
* Updated all help files to include full parameter types and correct input/output types.
* Added ps1xml types to Common.Storage
Expand Down Expand Up @@ -76,7 +78,7 @@
* 'Remove-AzureRmAccount' has been renamed as 'Disconnect-AzureRmAccount'; an alias has been added for the old cmdlet name, and other aliases ('Logout-AzAccount' and 'Logout-AzureRmAccount') have been redirected to the new cmdlet name.
* Corrected Resource Strings to use Connect-AzureRmAccount instead of Login-AzureRmAccount
* Add-AzureRmEnvironment and Set-AzureRmEnvironment
- Added -AzureOperationalInsightsEndpoint and -AzureOperationalInsightsEndpointResourceId as parameters for use with OperationalInsights data plane RP.
- Added -AzureOperationalInsightsEndpoint and -AzureOperationalInsightsEndpointResourceId as parameters for use with OperationalInsights data plane RP.

## Version 4.2.0
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
Expand Down Expand Up @@ -111,22 +113,22 @@
- Use this feature by adding LocationCompleter(string[] validResourceTypes) onto the Location parameter

## Version 3.4.0
* Start-Job Support for AzureRm cmdlets.
* All AzureRmCmdlets add -AzureRmContext parameter, which can accept a context (output of a Context cmdlet).
* Start-Job Support for AzureRm cmdlets.
* All AzureRmCmdlets add -AzureRmContext parameter, which can accept a context (output of a Context cmdlet).
- Common pattern for jobs with context persistence DISABLED: ```Start-Job {param ($context) New-AzureRmVM -AzureRmContext $context [... other parameters]} -ArgumentList (Get-AzureRmContext)```
- Common pattern for jobs with context persistence ENABLED:```Start-Job {New-AzureRmVM [... other parameters]}```
* Persist login information across sessions, new cmdlets:
- Enable-AzureRmContextAutosave - Enable login persistence across sessions.
- Disable-AzureRmContextAutosave - Disable login persistence across sessions.
* Manage context information, new cmdets
- Select-AzureRmContext - Select the active named context.
- Rename-AzureRmContext - Rename an exsiting context for easy reference.
- Remove-AzureRmContext - Remove an existing context.
- Remove-AzureRmAccount - Remove all credentials, subscriptions, and tenants associated with an account.
* Manage context information, cmdlet changes:
- Added Scope = (Process | CurrentUser) to all cmdlets that change credentials
* Persist login information across sessions, new cmdlets:
- Enable-AzureRmContextAutosave - Enable login persistence across sessions.
- Disable-AzureRmContextAutosave - Disable login persistence across sessions.
* Manage context information, new cmdets
- Select-AzureRmContext - Select the active named context.
- Rename-AzureRmContext - Rename an exsiting context for easy reference.
- Remove-AzureRmContext - Remove an existing context.
- Remove-AzureRmAccount - Remove all credentials, subscriptions, and tenants associated with an account.
* Manage context information, cmdlet changes:
- Added Scope = (Process | CurrentUser) to all cmdlets that change credentials
- Get-AzureRmContext - Added ListAvailable parameter to list all saved contexts

## Version 3.3.1

## Version 3.3.0
Expand Down Expand Up @@ -164,7 +166,7 @@
* *Obsolete*: Select-AzureRmProfile is renamed to Import-AzureRmContext, there is an alias to the old cmdlet name, the alias will be removed in the next release.
* The PSAzureContext and PSAzureProfile output types of profile cmdlets will be changed in the next release.
* The Save-AzureRmContext cmdlet will have no OutputType in the next release.
* Fix bug in cmdlet common code to use FIPS-compliant algorithm for data hashes: https://github.com/Azure/azure-powershell/issues/3651
* Fix bug in cmdlet common code to use FIPS-compliant algorithm for data hashes: https://github.com/Azure/azure-powershell/issues/3651

## Version 2.7.0

Expand Down