Repository: Azure/azure-sdk-for-go
Pull request #17731 (2022-04-25 21:44:09)

Sync eng/common directory with azure-sdk-tools for PR 3212
Sync eng/common directory with azure-sdk-tools for PR https://github.com/Azure/azure-sdk-tools/pull/3212  See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

scbedd: JS/Python/Go aztables all pass. Locally debugging.

Patch:
diff --git a/sdk/azcore/CHANGELOG.md b/sdk/azcore/CHANGELOG.md
index 0e87951b90..7c04a18624 100644
--- a/sdk/azcore/CHANGELOG.md
+++ b/sdk/azcore/CHANGELOG.md
@@ -6,6 +6,7 @@
 
 ### Breaking Changes
 * Renamed `cloud.Configuration.LoginEndpoint` to `.ActiveDirectoryAuthorityHost`
+* Renamed `cloud.AzurePublicCloud` to `cloud.AzurePublic`
 * Removed `AuxiliaryTenants` field from `arm/ClientOptions` and `arm/policy/BearerTokenOptions`
 * Removed `TokenRequestOptions.TenantID`
 * `Poller[T].PollUntilDone()` now takes an `options *PollUntilDoneOptions` param instead of `freq time.Duration`
diff --git a/sdk/azcore/arm/arm.go b/sdk/azcore/arm/arm.go
index 055353650c..3a0cb64429 100644
--- a/sdk/azcore/arm/arm.go
+++ b/sdk/azcore/arm/arm.go
@@ -17,7 +17,7 @@ func init() {
 		Audience: "https://management.core.usgovcloudapi.net",
 		Endpoint: "https://management.usgovcloudapi.net",
 	}
-	cloud.AzurePublicCloud.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
+	cloud.AzurePublic.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
 		Audience: "https://management.core.windows.net/",
 		Endpoint: "https://management.azure.com",
 	}
diff --git a/sdk/azcore/arm/runtime/pipeline.go b/sdk/azcore/arm/runtime/pipeline.go
index a68054705c..6b9a242cea 100644
--- a/sdk/azcore/arm/runtime/pipeline.go
+++ b/sdk/azcore/arm/runtime/pipeline.go
@@ -46,7 +46,7 @@ func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azr
 }
 
 func getConfiguration(o *azpolicy.ClientOptions) (cloud.ServiceConfiguration, error) {
-	c := cloud.AzurePublicCloud
+	c := cloud.AzurePublic
 	if !reflect.ValueOf(o.Cloud).IsZero() {
 		c = o.Cloud
 	}
diff --git a/sdk/azcore/cloud/cloud.go b/sdk/azcore/cloud/cloud.go
index 232792ca4c..9d077a3e12 100644
--- a/sdk/azcore/cloud/cloud.go
+++ b/sdk/azcore/cloud/cloud.go
@@ -15,8 +15,8 @@ var (
 	AzureGovernment = Configuration{
 		ActiveDirectoryAuthorityHost: "https://login.microsoftonline.us/", Services: map[ServiceName]ServiceConfiguration{},
 	}
-	// AzurePublicCloud contains configuration for Azure Public Cloud.
-	AzurePublicCloud = Configuration{
+	// AzurePublic contains configuration for Azure Public Cloud.
+	AzurePublic = Configuration{
 		ActiveDirectoryAuthorityHost: "https://login.microsoftonline.com/", Services: map[ServiceName]ServiceConfiguration{},
 	}
 )
diff --git a/sdk/azidentity/azidentity.go b/sdk/azidentity/azidentity.go
index 341601bdd9..7a3e4454eb 100644
--- a/sdk/azidentity/azidentity.go
+++ b/sdk/azidentity/azidentity.go
@@ -42,7 +42,7 @@ func setAuthorityHost(cc cloud.Configuration) (string, error) {
 		if len(cc.Services) > 0 {
 			return "", errors.New("missing ActiveDirectoryAuthorityHost for specified cloud")
 		}
-		host = cloud.AzurePublicCloud.ActiveDirectoryAuthorityHost
+		host = cloud.AzurePublic.ActiveDirectoryAuthorityHost
 		if envAuthorityHost := os.Getenv(azureAuthorityHost); envAuthorityHost != "" {
 			host = envAuthorityHost
 		}


Test patch:
diff --git a/eng/common/testproxy/docker-start-proxy.ps1 b/eng/common/testproxy/docker-start-proxy.ps1
index c15fc37a7e..c34c9d38d8 100644
--- a/eng/common/testproxy/docker-start-proxy.ps1
+++ b/eng/common/testproxy/docker-start-proxy.ps1
@@ -38,8 +38,7 @@ catch {
 
 $SELECTED_IMAGE_TAG = $(Get-Content "$PSScriptRoot/target_version.txt" -Raw).Trim()
 $CONTAINER_NAME = "ambitious_azsdk_test_proxy"
-$LINUX_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-lin:${SELECTED_IMAGE_TAG}"
-$WINDOWS_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-win:${SELECTED_IMAGE_TAG}"
+$IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy:${SELECTED_IMAGE_TAG}"
 
 if($VersionOverride) { 
     Write-Host "Overriding default target proxy version of '$SELECTED_IMAGE_TAG' with override $VersionOverride."
@@ -58,8 +57,6 @@ function Get-Proxy-Container(){
                 | Select-Object -First 1)
 }
 
-
-$SelectedImage = $LINUX_IMAGE_SOURCE
 $Initial = ""
 $AdditionalContainerArgs = "--add-host=host.docker.internal:host-gateway"
 
@@ -67,7 +64,6 @@ $AdditionalContainerArgs = "--add-host=host.docker.internal:host-gateway"
 # however, in CI, windows images default to _windows_ containers. We cannot swap them. We can tell if we're in a CI build by
 # checking for the environment variable TF_BUILD.
 if ($IsWindows -and $env:TF_BUILD){
-    $SelectedImage = $WINDOWS_IMAGE_SOURCE
     $Initial = "C:"
     $AdditionalContainerArgs = ""
 }
@@ -93,9 +89,9 @@ if ($Mode -eq "start"){
     else {
         $attempts = 0
         Write-Host "Attempting creation of Docker host $CONTAINER_NAME"
-        Write-Host "docker container create -v `"${root}:${Initial}/srv/testproxy`" $AdditionalContainerArgs -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $SelectedImage"
+        Write-Host "docker container create -v `"${root}:${Initial}/srv/testproxy`" $AdditionalContainerArgs -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $IMAGE_SOURCE"
         while($attempts -lt 3){
-            docker container create -v "${root}:${Initial}/srv/testproxy" $AdditionalContainerArgs -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $SelectedImage
+            docker container create -v "${root}:${Initial}/srv/testproxy" $AdditionalContainerArgs -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $IMAGE_SOURCE
 
             if($LASTEXITCODE -ne 0){
                 $attempts += 1
diff --git a/eng/common/testproxy/target_version.txt b/eng/common/testproxy/target_version.txt
index ac34389c60..a72b151d94 100644
--- a/eng/common/testproxy/target_version.txt
+++ b/eng/common/testproxy/target_version.txt
@@ -1,1 +1,1 @@
-1.0.0-dev.20220224.2
+1.0.0-dev.20220426.1
diff --git a/eng/pipelines/templates/steps/build-test.yml b/eng/pipelines/templates/steps/build-test.yml
index 17dc761ac5..b06ca963f8 100644
--- a/eng/pipelines/templates/steps/build-test.yml
+++ b/eng/pipelines/templates/steps/build-test.yml
@@ -48,6 +48,9 @@ steps:
 
   - ${{ if eq(parameters.TestProxy, true) }}:
     - template: /eng/common/testproxy/test-proxy-tool.yml
+      parameters:
+        targetVersion: '1.0.0-dev.20220224.2'
+
 
   - task: PowerShell@2
     displayName: 'Run Tests'
diff --git a/sdk/azcore/arm/runtime/pipeline_test.go b/sdk/azcore/arm/runtime/pipeline_test.go
index 239bce745a..056a1c3a2d 100644
--- a/sdk/azcore/arm/runtime/pipeline_test.go
+++ b/sdk/azcore/arm/runtime/pipeline_test.go
@@ -167,7 +167,7 @@ func TestPipelineWithCustomPolicies(t *testing.T) {
 }
 
 func TestPipelineAudience(t *testing.T) {
-	for _, c := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublicCloud} {
+	for _, c := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublic} {
 		srv, close := mock.NewServer()
 		defer close()
 		srv.AppendResponse(mock.WithStatusCode(200))
diff --git a/sdk/azidentity/azidentity_test.go b/sdk/azidentity/azidentity_test.go
index e936ba15ad..10c33ac5ab 100644
--- a/sdk/azidentity/azidentity_test.go
+++ b/sdk/azidentity/azidentity_test.go
@@ -156,7 +156,7 @@ func setEnvironmentVariables(t *testing.T, vars map[string]string) {
 }
 
 func Test_WellKnownHosts(t *testing.T) {
-	for _, cloud := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublicCloud} {
+	for _, cloud := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublic} {
 		host, err := setAuthorityHost(cloud)
 		if err != nil {
 			t.Fatal(err)
@@ -196,7 +196,7 @@ func Test_DefaultAuthorityHost(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	if authorityHost != cloud.AzurePublicCloud.ActiveDirectoryAuthorityHost {
+	if authorityHost != cloud.AzurePublic.ActiveDirectoryAuthorityHost {
 		t.Fatal("unexpected default host: " + authorityHost)
 	}
 }