Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.98k forks source link

az aks use-dev-spaces create .bash_profile cause .profile not load #7574

Open doggy8088 opened 6 years ago

doggy8088 commented 6 years ago

Describe the bug After I run az aks use-dev-spaces -g RGName -n Name, the .bash_profile is created.

source /etc/bash_completion.d/azds

These are two common files .profile and .bash_profile in bash environment, but only one file will be applied. The .bash_profile is first priority. But in WSL, only .profile exists by default.

For example, in my box, I don't have a .bash_profile by default. All my profile settings are write in .profile file. After run az aks user-dev-spaces command, the .bash_profile been created. After I re-open WSL again, the .profile file is ignored because there is a .bash_profile file exist.

To Reproduce az aks use-dev-spaces -g RGName -n Name under WSL.

Expected behavior If there is a .profile file, use this one. If there is already has a .bash_profile, then use .bash_profile.

Environment summary

Bash on Windows

$ lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
$ az --version
azure-cli (2.0.47)

acr (2.1.6)
acs (2.3.6)
advisor (0.6.0)
ams (0.2.3)
appservice (0.2.5)
backup (1.2.1)
batch (3.4.0)
batchai (0.4.3)
billing (0.2.0)
botservice (0.1.1)
cdn (0.1.1)
cloud (2.1.0)
cognitiveservices (0.2.3)
command-modules-nspkg (2.0.2)
configure (2.0.18)
consumption (0.4.0)
container (0.3.5)
core (2.0.47)
cosmosdb (0.2.1)
dla (0.2.3)
dls (0.1.3)
dms (0.1.1)
eventgrid (0.2.0)
eventhubs (0.3.0)
extension (0.2.2)
feedback (2.1.4)
find (0.2.12)
hdinsight (0.1.0)
interactive (0.3.30)
iot (0.3.3)
iotcentral (0.1.2)
keyvault (2.2.4)
lab (0.1.1)
maps (0.3.2)
monitor (0.2.4)
network (2.2.6)
nspkg (3.0.3)
policyinsights (0.1.0)
profile (2.1.1)
rdbms (0.3.2)
redis (0.3.2)
relay (0.1.2)
reservations (0.4.0)
resource (2.1.4)
role (2.1.7)
search (0.1.1)
servicebus (0.3.0)
servicefabric (0.1.4)
signalr (1.0.0)
sql (2.1.4)
storage (2.2.2)
telemetry (1.0.0)
vm (2.2.4)

Extensions:
alias (0.5.1)
dev-spaces-preview (0.1.6)

Python location '/opt/az/bin/python3'
Extensions directory '/home/will/.azure/cliextensions'

Python (Linux) 3.6.5 (default, Oct  4 2018, 05:49:33)
[GCC 7.3.0]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

jluk commented 4 years ago

@saurabsa is it possible for you to look at this dev spaces issue as well?