@@ -236,7 +236,8 @@ function BuildBicepFile([System.IO.FileSystemInfo] $file)
236236 return $templateFilePath
237237}
238238
239- function BuildDeploymentOutputs ([string ]$serviceDirectoryPrefix , [object ]$azContext , [object ]$deployment ) {
239+ function BuildDeploymentOutputs ([string ]$serviceName , [object ]$azContext , [object ]$deployment ) {
240+ $serviceDirectoryPrefix = BuildServiceDirectoryPrefix $serviceName
240241 # Add default values
241242 $deploymentOutputs = [Ordered ]@ {
242243 " ${serviceDirectoryPrefix} CLIENT_ID" = $TestApplicationId ;
@@ -249,6 +250,7 @@ function BuildDeploymentOutputs([string]$serviceDirectoryPrefix, [object]$azCont
249250 " ${serviceDirectoryPrefix} AZURE_AUTHORITY_HOST" = $azContext.Environment.ActiveDirectoryAuthority ;
250251 " ${serviceDirectoryPrefix} RESOURCE_MANAGER_URL" = $azContext.Environment.ResourceManagerUrl ;
251252 " ${serviceDirectoryPrefix} SERVICE_MANAGEMENT_URL" = $azContext.Environment.ServiceManagementUrl ;
253+ " AZURE_SERVICE_DIRECTORY" = $serviceName.ToUpperInvariant ();
252254 }
253255
254256 MergeHashes $EnvironmentVariables $ (Get-Variable deploymentOutputs)
@@ -268,8 +270,7 @@ function BuildDeploymentOutputs([string]$serviceDirectoryPrefix, [object]$azCont
268270}
269271
270272function SetDeploymentOutputs ([string ]$serviceName , [object ]$azContext , [object ]$deployment , [object ]$templateFile ) {
271- $serviceDirectoryPrefix = $serviceName.ToUpperInvariant () + " _"
272- $deploymentOutputs = BuildDeploymentOutputs $serviceDirectoryPrefix $azContext $deployment
273+ $deploymentOutputs = BuildDeploymentOutputs $serviceName $azContext $deployment
273274
274275 if ($OutFile ) {
275276 if (! $IsWindows ) {
@@ -300,7 +301,7 @@ function SetDeploymentOutputs([string]$serviceName, [object]$azContext, [object]
300301 $EnvironmentVariables [$key ] = $value
301302
302303 if ($CI ) {
303- if (ShouldMarkValueAsSecret $serviceDirectoryPrefix $key $value $notSecretValues ) {
304+ if (ShouldMarkValueAsSecret $serviceName $key $value $notSecretValues ) {
304305 # Treat all ARM template output variables as secrets since "SecureString" variables do not set values.
305306 # In order to mask secrets but set environment variables for any given ARM template, we set variables twice as shown below.
306307 LogVsoCommand " ##vso[task.setvariable variable=_$key ;issecret=true;]$value "
0 commit comments