Skip to content

Commit

Permalink
fix: grept apply
Browse files Browse the repository at this point in the history
  • Loading branch information
azure-verified-modules[bot] committed Mar 2, 2025
1 parent 8ec6dff commit 259863a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
9 changes: 4 additions & 5 deletions avm
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ if [ -z "$1" ]; then
exit 1
fi

# Mount .azure directory if it exists
AZURE_VOLUME=""
if [ -d "$HOME/.azure" ]; then
AZURE_VOLUME="-v $HOME/.azure:/home/runtimeuser/.azure"
# Check if AZURE_CONFIG_DIR is set, if not, set it to ~/.azure
if [ -z "$AZURE_CONFIG_DIR" ]; then
AZURE_CONFIG_DIR="$HOME/.azure"
fi

# Check if we are running in a container
# If we are then just run make directly
if [ -z "$AVM_IN_CONTAINER" ]; then
$CONTAINER_RUNTIME run --pull always --user "$(id -u):$(id -g)" --rm $AZURE_VOLUME -v "$(pwd)":/src -w /src -e GITHUB_TOKEN -e GITHUB_REPOSITORY -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make "$1"
$CONTAINER_RUNTIME run --pull always --user "$(id -u):$(id -g)" --rm -v "$(pwd)":/src -w /src -v $AZURE_CONFIG_DIR:/azureconfig -e AZURE_CONFIG_DIR=/azureconfig -e GITHUB_TOKEN -e GITHUB_REPOSITORY -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make "$1"
else
make "$1"
fi
2 changes: 1 addition & 1 deletion avm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ IF "%~1"=="" (
)

REM Run the make target with CONTAINER_RUNTIME
%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -e GITHUB_TOKEN -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1
%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -e GITHUB_TOKEN -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1

ENDLOCAL
17 changes: 7 additions & 10 deletions main.telemetry.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ resource "random_uuid" "telemetry" {
resource "modtm_telemetry" "telemetry" {
count = var.enable_telemetry ? 1 : 0

tags = merge({
subscription_id = one(data.azapi_client_config.telemetry).subscription_id
tenant_id = one(data.azapi_client_config.telemetry).tenant_id
module_source = one(data.modtm_module_source.telemetry).module_source
module_version = one(data.modtm_module_source.telemetry).module_version
random_id = one(random_uuid.telemetry).result
alz_library_references = jsonencode(one(data.alz_metadata.telemetry).alz_library_references)
},
var.partner_id != null ? { partner_id = var.partner_id } : {}
)
tags = {
subscription_id = one(data.azapi_client_config.telemetry).subscription_id
tenant_id = one(data.azapi_client_config.telemetry).tenant_id
module_source = one(data.modtm_module_source.telemetry).module_source
module_version = one(data.modtm_module_source.telemetry).module_version
random_id = one(random_uuid.telemetry).result
}
}

0 comments on commit 259863a

Please sign in to comment.