Skip to content

Commit e0fca46

Browse files
authored
[2.0] Passed Azure config to toolkit build env. (#14527)
1 parent 92920d5 commit e0fca46

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

toolkit/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ all: toolchain go-tools chroot-tools
193193
# its help will be displayed at the top of the help output.
194194
include $(SCRIPTS_DIR)/help.mk
195195

196+
# Set-up the Azure configuration for the build
197+
include $(SCRIPTS_DIR)/azure_config.mk
198+
196199
# Misc function defines
197200
# Variable prerequisite tracking
198201
include $(SCRIPTS_DIR)/utils.mk

toolkit/scripts/azure_config.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# By default pass original user's Azure configuration if running as root.
5+
# Running as root is required by how the toolkit operates while
6+
# in most cases the user expects to still use their Azure configuration, thus the default.
7+
ifneq ($(SUDO_USER),)
8+
export AZURE_CONFIG_DIR ?= $(shell sudo -u "$(SUDO_USER)" bash -c 'echo $${AZURE_CONFIG_DIR:-$${HOME}/.azure}')
9+
endif

0 commit comments

Comments
 (0)