55
66param (
77 [hashtable ] $AdditionalParameters = @ {},
8- [hashtable ] $DeploymentOutputs
8+ [hashtable ] $DeploymentOutputs ,
9+
10+ [Parameter (ParameterSetName = ' Provisioner' , Mandatory = $true )]
11+ [ValidateNotNullOrEmpty ()]
12+ [string ] $TenantId ,
13+
14+ [Parameter ()]
15+ [ValidatePattern (' ^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$' )]
16+ [string ] $TestApplicationId ,
17+
18+ # Captures any arguments from eng/New-TestResources.ps1 not declared here (no parameter errors).
19+ [Parameter (ValueFromRemainingArguments = $true )]
20+ $RemainingArguments
921)
1022
1123$ErrorActionPreference = ' Stop'
@@ -16,14 +28,14 @@ if ($CI) {
1628 Write-Host " Skipping post-provisioning script because resources weren't deployed"
1729 return
1830 }
19- az login -- service- principal - u $DeploymentOutputs [ ' AZIDENTITY_CLIENT_ID ' ] - p $DeploymentOutputs [ ' AZIDENTITY_CLIENT_SECRET ' ] -- tenant $DeploymentOutputs [ ' AZIDENTITY_TENANT_ID ' ]
31+ az login -- federated - token $ env: OIDC_TOKEN -- service- principal - t $TenantId - u $TestApplicationId
2032 az account set -- subscription $DeploymentOutputs [' AZIDENTITY_SUBSCRIPTION_ID' ]
2133}
2234
2335Write-Host " Building container"
2436$image = " $ ( $DeploymentOutputs [' AZIDENTITY_ACR_LOGIN_SERVER' ]) /azidentity-managed-id-test"
2537Set-Content - Path " $PSScriptRoot /Dockerfile" - Value @"
26- FROM mcr.microsoft.com/oss/go/microsoft/golang:latest as builder
38+ FROM mcr.microsoft.com/oss/go/microsoft/golang:latest AS builder
2739ENV GOARCH=amd64 GOWORK=off
2840COPY . /azidentity
2941WORKDIR /azidentity/testdata/managed-id-test
@@ -53,9 +65,9 @@ az container create -g $rg -n $aciName --image $image `
5365 -- role " Storage Blob Data Reader" `
5466 -- scope $ ($DeploymentOutputs [' AZIDENTITY_STORAGE_ID' ]) `
5567 - e AZIDENTITY_STORAGE_NAME= $ ($DeploymentOutputs [' AZIDENTITY_STORAGE_NAME' ]) `
56- AZIDENTITY_STORAGE_NAME_USER_ASSIGNED= $ ($DeploymentOutputs [' AZIDENTITY_STORAGE_NAME_USER_ASSIGNED' ]) `
57- AZIDENTITY_USER_ASSIGNED_IDENTITY= $ ($DeploymentOutputs [' AZIDENTITY_USER_ASSIGNED_IDENTITY' ]) `
58- FUNCTIONS_CUSTOMHANDLER_PORT= 80
68+ AZIDENTITY_STORAGE_NAME_USER_ASSIGNED= $ ($DeploymentOutputs [' AZIDENTITY_STORAGE_NAME_USER_ASSIGNED' ]) `
69+ AZIDENTITY_USER_ASSIGNED_IDENTITY= $ ($DeploymentOutputs [' AZIDENTITY_USER_ASSIGNED_IDENTITY' ]) `
70+ FUNCTIONS_CUSTOMHANDLER_PORT= 80
5971Write-Host " ##vso[task.setvariable variable=AZIDENTITY_ACI_NAME;]$aciName "
6072
6173# Azure Functions deployment: copy the Windows binary from the Docker image, deploy it in a zip
0 commit comments