Repository: Azure/azure-sdk-for-go
Pull request #17725 (2022-04-25 07:24:53)

[Release] sdk/resourcemanager/resources/armchanges/0.1.0
Fixes https://github.com/Azure/sdk-release-request/issues/2726

Alancere: /azp run prepare-pipelines
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
Alancere: /azp run go - armchanages - ci
azure-pipelines[bot]: <samp>
No pipelines are associated with this pull request.<br>

</samp>
Alancere: /azp run go - armchanges - ci
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>

Patch:
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index cc7d47a5f4..655b5666b8 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -14,43 +14,43 @@
 
 # Catch all for non-code project files and unowned files | folders
 *                             @rickwinter @jhendrixMSFT
-/sdk/                         @rickwinter @chlowell @richardpark-msft @seankane-msft
+/sdk/                         @rickwinter @chlowell @richardpark-msft
 
 # Samples
-/samples/                     @rickwinter @chlowell @jhendrixMSFT @richardpark-msft @seankane-msft
+/samples/                     @rickwinter @chlowell @jhendrixMSFT @richardpark-msft
 
 # PRLabel: %Azure.Core
-/sdk/azcore/                  @rickwinter @chlowell @jhendrixMSFT @richardpark-msft @seankane-msft
+/sdk/azcore/                  @rickwinter @chlowell @jhendrixMSFT @richardpark-msft
 
 # PRLabel: %Azure.Identity
 /sdk/azidentity/              @chlowell @jhendrixMSFT @rickwinter
 
 # PRLabel: %Internal
-/sdk/internal/                @rickwinter @chlowell @jhendrixMSFT @richardpark-msft @seankane-msft
+/sdk/internal/                @rickwinter @chlowell @jhendrixMSFT @richardpark-msft
 
 # PRLabel: %App Configuration
-/sdk/appconfig/               @antkmsft @seankane-msft @jhendrixMSFT
+/sdk/appconfig/               @antkmsft @jhendrixMSFT
 
 # PRLabel: %Cosmos
 /sdk/data/azcosmos/           @ealsur @kirankumarkolli
 
 # PRLabel: %Tables
-/sdk/data/aztables/           @seankane-msft @jhendrixMSFT 
+/sdk/data/aztables/           @jhendrixMSFT
 
 # PRLabel: %KeyVault
-/sdk/keyvault/                @seankane-msft @jhendrixMSFT
+/sdk/keyvault/                @chlowell @jhendrixMSFT
 
 # PRLabel: %Service Bus
-/sdk/messaging/azservicebus   @richardpark-msft @jhendrixMSFT 
+/sdk/messaging/azservicebus   @richardpark-msft @jhendrixMSFT
 
 # PRLabel: %Service Bus
-/sdk/messaging/internal       @richardpark-msft @jhendrixMSFT 
+/sdk/messaging/internal       @richardpark-msft @jhendrixMSFT
 
 # PRLabel: %Mgmt
 /sdk/resourcemanager/         @ArcturusZhang @lirenhe @tadelesh
 
 # PRLabel: %Storage
-/sdk/storage/                 @jhendrixMSFT @seankane-msft
+/sdk/storage/                 @mohsha-msft @zezha-msft @jhendrixMSFT
 
 ###########
 # Eng Sys
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 66908ff155..64fad4e6e6 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -29,7 +29,7 @@ jobs:
       name: $(pool.name)
 
     variables:
-      - template: ./eng/pipelines/templates/variables/globals.yml
+      - template: /eng/pipelines/templates/variables/globals.yml
       - name: GOPATH
         value: '$(system.defaultWorkingDirectory)/work'
       - name: sdkPath
diff --git a/eng/common/scripts/Update-DocsMsMetadata.ps1 b/eng/common/scripts/Update-DocsMsMetadata.ps1
index ca4c74e91f..c0b7d55563 100644
--- a/eng/common/scripts/Update-DocsMsMetadata.ps1
+++ b/eng/common/scripts/Update-DocsMsMetadata.ps1
@@ -129,13 +129,12 @@ author: $author
 ms.author: $msauthor
 ms.date: $date
 ms.topic: reference
-ms.prod: azure
-ms.technology: azure
 ms.devlang: $Language
 ms.service: $service
 ---
 "@
 
+  $ReadmeContent = $ReadmeContent -replace "https://docs.microsoft.com(/en-us)?/?", "/"
   return "$header`n$ReadmeContent"
 }
 
diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client-samples.yml b/eng/pipelines/templates/jobs/archetype-sdk-client-samples.yml
index 16d0dc2b86..59fa5fffab 100644
--- a/eng/pipelines/templates/jobs/archetype-sdk-client-samples.yml
+++ b/eng/pipelines/templates/jobs/archetype-sdk-client-samples.yml
@@ -12,7 +12,7 @@ stages:
     - job: Build
       displayName: Build on
       variables:
-        - template: ../variables/globals.yml
+        - template: /eng/pipelines/templates/variables/globals.yml
       strategy:
         matrix:
           Linux_Go118:
@@ -48,7 +48,7 @@ stages:
     - job: Analyze
       displayName: Analyze
       variables:
-        - template: ../variables/globals.yml
+        - template: /eng/pipelines/templates/variables/globals.yml
       pool:
         name: azsdk-pool-mms-ubuntu-2004-general
 
diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml
index ea039a0a65..76012fdb74 100644
--- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml
+++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml
@@ -79,7 +79,7 @@ stages:
     - job: Test
       displayName: Build and Test on
       variables:
-        - template: ../variables/globals.yml
+        - template: /eng/pipelines/templates/variables/globals.yml
       strategy:
         matrix:
           Linux_Go118:
@@ -124,7 +124,7 @@ stages:
     - job: Analyze
       displayName: Analyze
       variables:
-        - template: ../variables/globals.yml
+        - template: /eng/pipelines/templates/variables/globals.yml
       pool:
         name: azsdk-pool-mms-ubuntu-2004-general
 
diff --git a/eng/tools/generator/cmd/v2/common/changlogProcessor.go b/eng/tools/generator/cmd/v2/common/changlogProcessor.go
index 89905a6d89..2a2402f596 100644
--- a/eng/tools/generator/cmd/v2/common/changlogProcessor.go
+++ b/eng/tools/generator/cmd/v2/common/changlogProcessor.go
@@ -15,11 +15,14 @@ import (
 
 	"github.com/Azure/azure-sdk-for-go/eng/tools/generator/repo"
 	"github.com/Azure/azure-sdk-for-go/eng/tools/internal/exports"
+	"github.com/go-git/go-git/v5"
+	"github.com/go-git/go-git/v5/config"
 	"github.com/go-git/go-git/v5/plumbing"
 )
 
 const (
 	sdk_tag_fetch_url = "https://api.github.com/repos/Azure/azure-sdk-for-go/git/refs/tags"
+	sdk_remote_url    = "https://github.com/Azure/azure-sdk-for-go.git"
 )
 
 func GetAllVersionTags(rpName, namespaceName string) ([]string, error) {
@@ -110,6 +113,23 @@ func GetExportsFromTag(sdkRepo repo.SDKRepository, packagePath, tag string) (*ex
 		return nil, err
 	}
 
+	// create remote with center sdk repo
+	remoteName := "release_remote"
+	_, err = sdkRepo.CreateRemote(&config.RemoteConfig{Name: remoteName, URLs: []string{sdk_remote_url}})
+	if err != nil {
+		if err != git.ErrRemoteExists {
+			return nil, err
+		}
+	}
+
+	// fetch tag from remote
+	err = sdkRepo.Fetch(&git.FetchOptions{RemoteName: remoteName, RefSpecs: []config.RefSpec{config.RefSpec(tag + ":" + tag)}})
+	if err != nil {
+		if err.Error() != "already up-to-date" {
+			return nil, err
+		}
+	}
+
 	// checkout to the specific tag
 	err = sdkRepo.CheckoutTag(strings.TrimPrefix(tag, "ref/tags/"))
 	if err != nil {
@@ -130,6 +150,12 @@ func GetExportsFromTag(sdkRepo repo.SDKRepository, packagePath, tag string) (*ex
 		return nil, err
 	}
 
+	// remove remote
+	err = sdkRepo.DeleteRemote(remoteName)
+	if err != nil {
+		return nil, err
+	}
+
 	// restore current change
 	err = sdkRepo.StashPop()
 	if err != nil {
diff --git a/eng/tools/generator/cmd/v2/common/fileProcessor.go b/eng/tools/generator/cmd/v2/common/fileProcessor.go
index 81d3fe8029..d8037d731e 100644
--- a/eng/tools/generator/cmd/v2/common/fileProcessor.go
+++ b/eng/tools/generator/cmd/v2/common/fileProcessor.go
@@ -33,7 +33,7 @@ const (
 var (
 	v2BeginRegex             = regexp.MustCompile("^```\\s*yaml\\s*\\$\\(go\\)\\s*&&\\s*\\$\\((track2|v2)\\)")
 	v2EndRegex               = regexp.MustCompile("^\\s*```\\s*$")
-	newClientMethodNameRegex = regexp.MustCompile("^New.+Client$")
+	newClientMethodNameRegex = regexp.MustCompile("^New.*Client$")
 	versionLineRegex         = regexp.MustCompile(`moduleVersion\s*=\s*\".*v\d+\.\d+\.\d+\"`)
 	changelogVersionRegex    = regexp.MustCompile(`##\s*(?P<version>\d+\.\d+\.\d+)\s*\((\d{4}-\d{2}-\d{2}|Unreleased)\)`)
 	packageConfigRegex       = regexp.MustCompile(`\$\((package-.+)\)`)
diff --git a/eng/tools/generator/repo/workTree.go b/eng/tools/generator/repo/workTree.go
index 217617d61a..7f949b46a8 100644
--- a/eng/tools/generator/repo/workTree.go
+++ b/eng/tools/generator/repo/workTree.go
@@ -27,6 +27,10 @@ type WorkTree interface {
 	StashPop() error
 	Head() (*plumbing.Reference, error)
 	Tags() (storer.ReferenceIter, error)
+	Remotes() ([]*git.Remote, error)
+	DeleteRemote(name string) error
+	CreateRemote(c *config.RemoteConfig) (*git.Remote, error)
+	Fetch(o *git.FetchOptions) error
 }
 
 type CheckoutOptions git.CheckoutOptions
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/azcore/log/log.go b/sdk/azcore/log/log.go
index dc1271b13a..7bde29d0a4 100644
--- a/sdk/azcore/log/log.go
+++ b/sdk/azcore/log/log.go
@@ -17,18 +17,18 @@ type Event = log.Event
 const (
 	// EventRequest entries contain information about HTTP requests.
 	// This includes information like the URL, query parameters, and headers.
-	EventRequest = log.EventRequest
+	EventRequest Event = "Request"
 
 	// EventResponse entries contain information about HTTP responses.
 	// This includes information like the HTTP status code, headers, and request URL.
-	EventResponse = log.EventResponse
+	EventResponse Event = "Response"
 
 	// EventRetryPolicy entries contain information specific to the retry policy in use.
-	EventRetryPolicy = log.EventRetryPolicy
+	EventRetryPolicy Event = "Retry"
 
 	// EventLRO entries contain information specific to long-running operations.
-	// This includes information like polling location, operation state and sleep intervals.
-	EventLRO = log.EventLRO
+	// This includes information like polling location, operation state, and sleep intervals.
+	EventLRO Event = "LongRunningOperation"
 )
 
 // SetEvents is used to control which events are written to
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
 		}
diff --git a/sdk/data/azcosmos/CHANGELOG.md b/sdk/data/azcosmos/CHANGELOG.md
index 6bd050a4d5..e062a92998 100644
--- a/sdk/data/azcosmos/CHANGELOG.md
+++ b/sdk/data/azcosmos/CHANGELOG.md
@@ -4,6 +4,7 @@
 
 ### Features Added
 * Added single partition query support.
+* Added Azure AD authentication support through `azcosmos.NewClient`
 
 ### Breaking Changes
 * This module now requires Go 1.18
diff --git a/sdk/data/azcosmos/README.md b/sdk/data/azcosmos/README.md
index ac0bd012e2..50792db7b4 100644
--- a/sdk/data/azcosmos/README.md
+++ b/sdk/data/azcosmos/README.md
@@ -44,13 +44,29 @@ The following section provides several code snippets covering some of the most c
 
 ### Create Cosmos Client
 
+The clients support different forms of authentication. The azcosmos library supports authorization via Azure Active Directory or an account key.
+
+**Using Azure Active Directory**
+
+```go
+import "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+
+cred, err := azidentity.NewDefaultAzureCredential(nil)
+handle(err)
+client, err := azcosmos.NewClient("myAccountEndpointURL", cred, nil)
+handle(err)
+```
+
+**Using account keys**
+
 ```go
 const (
     cosmosDbEndpoint = "someEndpoint"
     cosmosDbKey = "someKey"
 )
 
-cred, _ := azcosmos.NewKeyCredential(cosmosDbKey)
+cred, err := azcosmos.NewKeyCredential(cosmosDbKey)
+handle(err)
 client, err := azcosmos.NewClientWithKey(cosmosDbEndpoint, cred, nil)
 handle(err)
 ```
diff --git a/sdk/data/azcosmos/cosmos_client.go b/sdk/data/azcosmos/cosmos_client.go
index c9df942bf2..b1d62a73cb 100644
--- a/sdk/data/azcosmos/cosmos_client.go
+++ b/sdk/data/azcosmos/cosmos_client.go
@@ -7,9 +7,12 @@ import (
 	"bytes"
 	"context"
 	"errors"
+	"fmt"
 	"net/http"
+	"net/url"
 	"time"
 
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
 	azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
@@ -26,15 +29,27 @@ func (c *Client) Endpoint() string {
 	return c.endpoint
 }
 
-// NewClientWithKey creates a new instance of Cosmos client with the specified values. It uses the default pipeline configuration.
+// NewClientWithKey creates a new instance of Cosmos client with shared key authentication. It uses the default pipeline configuration.
 // endpoint - The cosmos service endpoint to use.
 // cred - The credential used to authenticate with the cosmos service.
 // options - Optional Cosmos client options.  Pass nil to accept default values.
 func NewClientWithKey(endpoint string, cred KeyCredential, o *ClientOptions) (*Client, error) {
-	return &Client{endpoint: endpoint, pipeline: newPipeline(cred, o)}, nil
+	return &Client{endpoint: endpoint, pipeline: newPipeline([]policy.Policy{newSharedKeyCredPolicy(cred)}, o)}, nil
 }
 
-func newPipeline(cred KeyCredential, options *ClientOptions) azruntime.Pipeline {
+// NewClient creates a new instance of Cosmos client with Azure AD access token authentication. It uses the default pipeline configuration.
+// endpoint - The cosmos service endpoint to use.
+// cred - The credential used to authenticate with the cosmos service.
+// options - Optional Cosmos client options.  Pass nil to accept default values.
+func NewClient(endpoint string, cred azcore.TokenCredential, o *ClientOptions) (*Client, error) {
+	scope, err := createScopeFromEndpoint(endpoint)
+	if err != nil {
+		return nil, err
+	}
+	return &Client{endpoint: endpoint, pipeline: newPipeline([]policy.Policy{azruntime.NewBearerTokenPolicy(cred, scope, nil), &cosmosBearerTokenPolicy{}}, o)}, nil
+}
+
+func newPipeline(authPolicy []policy.Policy, options *ClientOptions) azruntime.Pipeline {
 	if options == nil {
 		options = &ClientOptions{}
 	}
@@ -42,15 +57,24 @@ func newPipeline(cred KeyCredential, options *ClientOptions) azruntime.Pipeline
 	return azruntime.NewPipeline("azcosmos", serviceLibVersion,
 		azruntime.PipelineOptions{
 			PerCall: []policy.Policy{
-				newSharedKeyCredPolicy(cred),
 				&headerPolicies{
 					enableContentResponseOnWrite: options.EnableContentResponseOnWrite,
 				},
 			},
+			PerRetry: authPolicy,
 		},
 		&options.ClientOptions)
 }
 
+func createScopeFromEndpoint(endpoint string) ([]string, error) {
+	u, err := url.Parse(endpoint)
+	if err != nil {
+		return nil, err
+	}
+
+	return []string{fmt.Sprintf("%s://%s/.default", u.Scheme, u.Hostname())}, nil
+}
+
 // NewDatabase returns a struct that represents a database and allows database level operations.
 // id - The id of the database.
 func (c *Client) NewDatabase(id string) (*DatabaseClient, error) {
diff --git a/sdk/data/azcosmos/cosmos_policy_bearer_token.go b/sdk/data/azcosmos/cosmos_policy_bearer_token.go
new file mode 100644
index 0000000000..dfba0e9b3c
--- /dev/null
+++ b/sdk/data/azcosmos/cosmos_policy_bearer_token.go
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azcosmos
+
+import (
+	"errors"
+	"fmt"
+	"net/http"
+
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+)
+
+const lenBearerTokenPrefix = len("Bearer ")
+
+type cosmosBearerTokenPolicy struct {
+}
+
+func (b *cosmosBearerTokenPolicy) Do(req *policy.Request) (*http.Response, error) {
+	currentAuthorization := req.Raw().Header.Get(headerAuthorization)
+	if currentAuthorization == "" {
+		return nil, errors.New("authorization header is missing")
+	}
+
+	token := currentAuthorization[lenBearerTokenPrefix:]
+	req.Raw().Header.Set(headerAuthorization, fmt.Sprintf("type=aad&ver=1.0&sig=%v", token))
+	return req.Next()
+}
diff --git a/sdk/data/azcosmos/doc.go b/sdk/data/azcosmos/doc.go
index 30ccb34271..b8689fa183 100644
--- a/sdk/data/azcosmos/doc.go
+++ b/sdk/data/azcosmos/doc.go
@@ -12,6 +12,19 @@ The azcosmos package is capable of:
 
 Creating the Client
 
+Types of Credentials
+The clients support different forms of authentication. The azcosmos library supports
+authorization via Azure Active Directory or an account key.
+
+Using Azure Active Directory
+To create a client, you can use any of the TokenCredential implementations provided by `azidentity`.
+	cred, err := azidentity.NewClientSecretCredential("tenantId", "clientId", "clientSecret")
+	handle(err)
+	client, err := azcosmos.NewClient("myAccountEndpointURL", cred, nil)
+	handle(err)
+
+
+Using account keys
 To create a client, you will need the account's endpoint URL and a key credential.
 
 	cred, err := azcosmos.NewKeyCredential("myAccountKey")
diff --git a/sdk/data/azcosmos/go.mod b/sdk/data/azcosmos/go.mod
index 53a61a5260..f1f166c940 100644
--- a/sdk/data/azcosmos/go.mod
+++ b/sdk/data/azcosmos/go.mod
@@ -5,14 +5,22 @@ go 1.18
 require (
 	github.com/Azure/azure-sdk-for-go v63.2.0+incompatible
 	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0
+	github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0
 	github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2
 	github.com/stretchr/testify v1.7.0
 )
 
 require (
+	github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
+	github.com/google/uuid v1.1.1 // indirect
+	github.com/kylelemons/godebug v1.1.0 // indirect
+	github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
+	golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
 	golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
+	golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
 	golang.org/x/text v0.3.7 // indirect
 	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
 )
diff --git a/sdk/data/azcosmos/go.sum b/sdk/data/azcosmos/go.sum
index 11b87f3d51..edd062b165 100644
--- a/sdk/data/azcosmos/go.sum
+++ b/sdk/data/azcosmos/go.sum
@@ -2,13 +2,28 @@ github.com/Azure/azure-sdk-for-go v63.2.0+incompatible h1:OIqkK/zTGqVUuzpEvY0B1Y
 github.com/Azure/azure-sdk-for-go v63.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
 github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ=
 github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y=
 github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2 h1:Px2KVERcYEg2Lv25AqC2hVr0xUWaq94wuEObLIkYzmA=
 github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2/go.mod h1:CdSJQNNzZhCkwDaV27XV1w48ZBPtxe7mlrZAsPNxD5g=
+github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c=
+github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
 github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
+github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
+github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
+github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU=
+github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
+github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
 github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
+github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
+github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI=
+github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -16,6 +31,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
+golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY=
@@ -23,6 +40,9 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
+golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
@@ -31,6 +51,7 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
diff --git a/sdk/internal/CHANGELOG.md b/sdk/internal/CHANGELOG.md
index 7037ab1c6d..57b8543446 100644
--- a/sdk/internal/CHANGELOG.md
+++ b/sdk/internal/CHANGELOG.md
@@ -1,10 +1,11 @@
 # Release History
 
-## 0.9.3 (Unreleased)
+## 0.10.0 (Unreleased)
 
 ### Features Added
 
 ### Breaking Changes
+* Removed logging constants from the `log` package.
 
 ### Bugs Fixed
 
diff --git a/sdk/internal/log/log.go b/sdk/internal/log/log.go
index a4e94a9def..2f8e1b5cc0 100644
--- a/sdk/internal/log/log.go
+++ b/sdk/internal/log/log.go
@@ -12,32 +12,13 @@ import (
 	"time"
 )
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// NOTE: The following are exported as public surface area from azcore.  DO NOT MODIFY
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
 // Event is used to group entries.  Each group can be toggled on or off.
 type Event string
 
-const (
-	// EventRequest entries contain information about HTTP requests.
-	// This includes information like the URL, query parameters, and headers.
-	EventRequest Event = "Request"
-
-	// EventResponse entries containe information about HTTP responses.
-	// This includes information like the HTTP status code, headers, and request URL.
-	EventResponse Event = "Response"
-
-	// EventRetryPolicy entries contain information specific to the rety policy in use.
-	EventRetryPolicy Event = "Retry"
-
-	// EventLRO entries contian information specific to long-running operations.
-	// This includes information like polling location, operation state, and sleep intervals.
-	EventLRO Event = "LongRunningOperation"
-)
-
-// logger controls which events to log and writing to the underlying log.
-type logger struct {
-	cls []Event
-	lst func(Event, string)
-}
-
 // SetEvents is used to control which events are written to
 // the log.  By default all log events are writen.
 func SetEvents(cls ...Event) {
@@ -49,6 +30,10 @@ func SetListener(lst func(Event, string)) {
 	log.lst = lst
 }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// END PUBLIC SURFACE AREA
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
 // Should returns true if the specified log event should be written to the log.
 // By default all log events will be logged.  Call SetEvents() to limit
 // the log events for logging.
@@ -88,11 +73,17 @@ func Writef(cls Event, format string, a ...interface{}) {
 	log.lst(cls, fmt.Sprintf(format, a...))
 }
 
-// TestResetEvents is used for testing purposes only.
+// TestResetEvents is used for TESTING PURPOSES ONLY.
 func TestResetEvents() {
 	log.cls = nil
 }
 
+// logger controls which events to log and writing to the underlying log.
+type logger struct {
+	cls []Event
+	lst func(Event, string)
+}
+
 // the process-wide logger
 var log logger
 
diff --git a/sdk/internal/version.go b/sdk/internal/version.go
index c6e912f390..3790db2d43 100644
--- a/sdk/internal/version.go
+++ b/sdk/internal/version.go
@@ -11,5 +11,5 @@ const (
 	Module = "internal"
 
 	// Version is the semantic version (see http://semver.org) of this module.
-	Version = "v0.9.3"
+	Version = "v0.10.0"
 )
diff --git a/sdk/resourcemanager/resources/armchanges/CHANGELOG.md b/sdk/resourcemanager/resources/armchanges/CHANGELOG.md
new file mode 100644
index 0000000000..b57048df1f
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Release History
+
+## 0.1.0 (2022-04-25)
+
+- Init release.
\ No newline at end of file
diff --git a/sdk/resourcemanager/resources/armchanges/LICENSE.txt b/sdk/resourcemanager/resources/armchanges/LICENSE.txt
new file mode 100644
index 0000000000..dc0c2ffb3d
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/sdk/resourcemanager/resources/armchanges/README.md b/sdk/resourcemanager/resources/armchanges/README.md
new file mode 100644
index 0000000000..e5eae0e9e6
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/README.md
@@ -0,0 +1,77 @@
+# Azure resources Module for Go
+
+[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armchanges)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armchanges)
+
+The `armchanges` module provides operations for working with Azure resources.
+
+[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/resources/armchanges)
+
+# Getting started
+
+## Prerequisites
+
+- an [Azure subscription](https://azure.microsoft.com/free/)
+- Go 1.18 or above
+
+## Install the package
+
+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
+
+Install the Azure resources module:
+
+```sh
+go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armchanges
+```
+
+## Authorization
+
+When creating a client, you will need to provide a credential for authenticating with Azure resources.  The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
+
+```go
+cred, err := azidentity.NewDefaultAzureCredential(nil)
+```
+
+For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
+
+## Clients
+
+Azure resources modules consist of one or more clients.  A client groups a set of related APIs, providing access to its functionality within the specified subscription.  Create one or more clients to access the APIs you require using your credential.
+
+```go
+client, err := armchanges.NewClient(<subscription ID>, cred, nil)
+```
+
+You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
+
+```go
+options := arm.ClientOptions{
+    ClientOptions: azcore.ClientOptions {
+        Cloud: cloud.AzureChina,
+    },
+}
+client, err := armchanges.NewClient(<subscription ID>, cred, &options)
+```
+
+## Provide Feedback
+
+If you encounter bugs or have suggestions, please
+[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `resources` label.
+
+# Contributing
+
+This project welcomes contributions and suggestions. Most contributions require
+you to agree to a Contributor License Agreement (CLA) declaring that you have
+the right to, and actually do, grant us the rights to use your contribution.
+For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
+
+When you submit a pull request, a CLA-bot will automatically determine whether
+you need to provide a CLA and decorate the PR appropriately (e.g., label,
+comment). Simply follow the instructions provided by the bot. You will only
+need to do this once across all repos using our CLA.
+
+This project has adopted the
+[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
+For more information, see the
+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
+additional questions or comments.
\ No newline at end of file
diff --git a/sdk/resourcemanager/resources/armchanges/autorest.md b/sdk/resourcemanager/resources/armchanges/autorest.md
new file mode 100644
index 0000000000..4616dc1a3d
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/autorest.md
@@ -0,0 +1,13 @@
+### AutoRest Configuration
+
+> see https://aka.ms/autorest
+
+``` yaml
+azure-arm: true
+require:
+- https://github.com/Azure/azure-rest-api-specs/blob/3f9dbfe11cd5d35b1a98815d20b340e636df0601/specification/resources/resource-manager/readme.md
+- https://github.com/Azure/azure-rest-api-specs/blob/3f9dbfe11cd5d35b1a98815d20b340e636df0601/specification/resources/resource-manager/readme.go.md
+license-header: MICROSOFT_MIT_NO_VERSION
+module-version: 0.1.0
+package-changes: true
+```
\ No newline at end of file
diff --git a/sdk/resourcemanager/resources/armchanges/build.go b/sdk/resourcemanager/resources/armchanges/build.go
new file mode 100644
index 0000000000..06808ddaa0
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/build.go
@@ -0,0 +1,7 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+// This file enables 'go generate' to regenerate this specific SDK
+//go:generate pwsh.exe ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/resources/armchanges
+
+package armchanges
diff --git a/sdk/resourcemanager/resources/armchanges/ci.yml b/sdk/resourcemanager/resources/armchanges/ci.yml
new file mode 100644
index 0000000000..10138bc4d2
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/ci.yml
@@ -0,0 +1,28 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+trigger:
+  branches:
+    include:
+      - main
+      - feature/*
+      - hotfix/*
+      - release/*
+  paths:
+    include:
+    - sdk/resourcemanager/resources/armchanges/
+
+pr:
+  branches:
+    include:
+      - main
+      - feature/*
+      - hotfix/*
+      - release/*
+  paths:
+    include:
+    - sdk/resourcemanager/resources/armchanges/
+
+stages:
+- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+  parameters:
+    IncludeRelease: true
+    ServiceDirectory: 'resourcemanager/resources/armchanges'
diff --git a/sdk/resourcemanager/resources/armchanges/go.mod b/sdk/resourcemanager/resources/armchanges/go.mod
new file mode 100644
index 0000000000..4dcfaf2342
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/go.mod
@@ -0,0 +1,21 @@
+module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armchanges
+
+go 1.18
+
+require (
+	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0
+	github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0
+)
+
+require (
+	github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect
+	github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect
+	github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
+	github.com/google/uuid v1.1.1 // indirect
+	github.com/kylelemons/godebug v1.1.0 // indirect
+	github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect
+	golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
+	golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
+	golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
+	golang.org/x/text v0.3.7 // indirect
+)
diff --git a/sdk/resourcemanager/resources/armchanges/go.sum b/sdk/resourcemanager/resources/armchanges/go.sum
new file mode 100644
index 0000000000..56d1c32628
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/go.sum
@@ -0,0 +1,53 @@
+github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y=
+github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo=
+github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
+github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c=
+github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
+github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
+github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
+github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
+github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU=
+github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
+github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
+github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
+github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
+github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI=
+github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
+golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY=
+golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
+golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
diff --git a/sdk/resourcemanager/resources/armchanges/zz_generated_client.go b/sdk/resourcemanager/resources/armchanges/zz_generated_client.go
new file mode 100644
index 0000000000..4d97779147
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/zz_generated_client.go
@@ -0,0 +1,210 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armchanges
+
+import (
+	"context"
+	"errors"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+	armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+	"net/http"
+	"net/url"
+	"strconv"
+	"strings"
+)
+
+// Client contains the methods for the Changes group.
+// Don't use this type directly, use NewClient() instead.
+type Client struct {
+	host           string
+	subscriptionID string
+	pl             runtime.Pipeline
+}
+
+// NewClient creates a new instance of Client with the specified values.
+// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
+// credential - used to authorize requests. Usually a credential from azidentity.
+// options - pass nil to accept the default values.
+func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) {
+	if options == nil {
+		options = &arm.ClientOptions{}
+	}
+	ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint
+	if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok {
+		ep = c.Endpoint
+	}
+	pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options)
+	if err != nil {
+		return nil, err
+	}
+	client := &Client{
+		subscriptionID: subscriptionID,
+		host:           ep,
+		pl:             pl,
+	}
+	return client, nil
+}
+
+// Get - Obtains the specified change resource for the target resource
+// If the operation fails it returns an *azcore.ResponseError type.
+// resourceGroupName - The name of the resource group.
+// resourceProviderNamespace - The name of the resource provider namespace.
+// resourceType - The name of the resource type.
+// resourceName - The name of the resource.
+// changeResourceID - The ID of the change resource
+// options - ClientGetOptions contains the optional parameters for the Client.Get method.
+func (client *Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, resourceType string, resourceName string, changeResourceID string, options *ClientGetOptions) (ClientGetResponse, error) {
+	req, err := client.getCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, resourceType, resourceName, changeResourceID, options)
+	if err != nil {
+		return ClientGetResponse{}, err
+	}
+	resp, err := client.pl.Do(req)
+	if err != nil {
+		return ClientGetResponse{}, err
+	}
+	if !runtime.HasStatusCode(resp, http.StatusOK) {
+		return ClientGetResponse{}, runtime.NewResponseError(resp)
+	}
+	return client.getHandleResponse(resp)
+}
+
+// getCreateRequest creates the Get request.
+func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, resourceType string, resourceName string, changeResourceID string, options *ClientGetOptions) (*policy.Request, error) {
+	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes/{changeResourceId}"
+	if client.subscriptionID == "" {
+		return nil, errors.New("parameter client.subscriptionID cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+	if resourceGroupName == "" {
+		return nil, errors.New("parameter resourceGroupName cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+	if resourceProviderNamespace == "" {
+		return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+	if resourceType == "" {
+		return nil, errors.New("parameter resourceType cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(resourceType))
+	if resourceName == "" {
+		return nil, errors.New("parameter resourceName cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName))
+	if changeResourceID == "" {
+		return nil, errors.New("parameter changeResourceID cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{changeResourceId}", url.PathEscape(changeResourceID))
+	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
+	if err != nil {
+		return nil, err
+	}
+	reqQP := req.Raw().URL.Query()
+	reqQP.Set("api-version", "2022-05-01")
+	req.Raw().URL.RawQuery = reqQP.Encode()
+	req.Raw().Header.Set("Accept", "application/json")
+	return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, error) {
+	result := ClientGetResponse{}
+	if err := runtime.UnmarshalAsJSON(resp, &result.ChangeResourceResult); err != nil {
+		return ClientGetResponse{}, err
+	}
+	return result, nil
+}
+
+// NewListPager - Obtains a list of change resources from the past 14 days for the target resource
+// If the operation fails it returns an *azcore.ResponseError type.
+// resourceGroupName - The name of the resource group.
+// resourceProviderNamespace - The name of the resource provider namespace.
+// resourceType - The name of the resource type.
+// resourceName - The name of the resource.
+// options - ClientListOptions contains the optional parameters for the Client.List method.
+func (client *Client) NewListPager(resourceGroupName string, resourceProviderNamespace string, resourceType string, resourceName string, options *ClientListOptions) *runtime.Pager[ClientListResponse] {
+	return runtime.NewPager(runtime.PageProcessor[ClientListResponse]{
+		More: func(page ClientListResponse) bool {
+			return page.NextLink != nil && len(*page.NextLink) > 0
+		},
+		Fetcher: func(ctx context.Context, page *ClientListResponse) (ClientListResponse, error) {
+			var req *policy.Request
+			var err error
+			if page == nil {
+				req, err = client.listCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, resourceType, resourceName, options)
+			} else {
+				req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)
+			}
+			if err != nil {
+				return ClientListResponse{}, err
+			}
+			resp, err := client.pl.Do(req)
+			if err != nil {
+				return ClientListResponse{}, err
+			}
+			if !runtime.HasStatusCode(resp, http.StatusOK) {
+				return ClientListResponse{}, runtime.NewResponseError(resp)
+			}
+			return client.listHandleResponse(resp)
+		},
+	})
+}
+
+// listCreateRequest creates the List request.
+func (client *Client) listCreateRequest(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, resourceType string, resourceName string, options *ClientListOptions) (*policy.Request, error) {
+	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes"
+	if client.subscriptionID == "" {
+		return nil, errors.New("parameter client.subscriptionID cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+	if resourceGroupName == "" {
+		return nil, errors.New("parameter resourceGroupName cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+	if resourceProviderNamespace == "" {
+		return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+	if resourceType == "" {
+		return nil, errors.New("parameter resourceType cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(resourceType))
+	if resourceName == "" {
+		return nil, errors.New("parameter resourceName cannot be empty")
+	}
+	urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName))
+	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
+	if err != nil {
+		return nil, err
+	}
+	reqQP := req.Raw().URL.Query()
+	reqQP.Set("api-version", "2022-05-01")
+	if options != nil && options.Top != nil {
+		reqQP.Set("$top", strconv.FormatInt(*options.Top, 10))
+	}
+	if options != nil && options.SkipToken != nil {
+		reqQP.Set("$skipToken", *options.SkipToken)
+	}
+	req.Raw().URL.RawQuery = reqQP.Encode()
+	req.Raw().Header.Set("Accept", "application/json")
+	return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *Client) listHandleResponse(resp *http.Response) (ClientListResponse, error) {
+	result := ClientListResponse{}
+	if err := runtime.UnmarshalAsJSON(resp, &result.ChangeResourceListResult); err != nil {
+		return ClientListResponse{}, err
+	}
+	return result, nil
+}
diff --git a/sdk/resourcemanager/resources/armchanges/zz_generated_constants.go b/sdk/resourcemanager/resources/armchanges/zz_generated_constants.go
new file mode 100644
index 0000000000..3a240e5d50
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/zz_generated_constants.go
@@ -0,0 +1,74 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armchanges
+
+const (
+	moduleName    = "armchanges"
+	moduleVersion = "v0.1.0"
+)
+
+// ChangeCategory - The entity that made the change
+type ChangeCategory string
+
+const (
+	// ChangeCategoryUser - User initiated change
+	ChangeCategoryUser ChangeCategory = "User"
+	// ChangeCategorySystem - System initiated change
+	ChangeCategorySystem ChangeCategory = "System"
+)
+
+// PossibleChangeCategoryValues returns the possible values for the ChangeCategory const type.
+func PossibleChangeCategoryValues() []ChangeCategory {
+	return []ChangeCategory{
+		ChangeCategoryUser,
+		ChangeCategorySystem,
+	}
+}
+
+// ChangeType - The type of change that was captured in the resource
+type ChangeType string
+
+const (
+	// ChangeTypeUpdate - An existing resource underwent a change
+	ChangeTypeUpdate ChangeType = "Update"
+	// ChangeTypeDelete - An existing resource was deleted
+	ChangeTypeDelete ChangeType = "Delete"
+	// ChangeTypeCreate - A newly created resource
+	ChangeTypeCreate ChangeType = "Create"
+)
+
+// PossibleChangeTypeValues returns the possible values for the ChangeType const type.
+func PossibleChangeTypeValues() []ChangeType {
+	return []ChangeType{
+		ChangeTypeUpdate,
+		ChangeTypeDelete,
+		ChangeTypeCreate,
+	}
+}
+
+// PropertyChangeType - The type of change that occurred
+type PropertyChangeType string
+
+const (
+	// PropertyChangeTypeUpdate - An existing property underwent a change
+	PropertyChangeTypeUpdate PropertyChangeType = "Update"
+	// PropertyChangeTypeInsert - A property was newly created
+	PropertyChangeTypeInsert PropertyChangeType = "Insert"
+	// PropertyChangeTypeRemove - An existing property was deleted
+	PropertyChangeTypeRemove PropertyChangeType = "Remove"
+)
+
+// PossiblePropertyChangeTypeValues returns the possible values for the PropertyChangeType const type.
+func PossiblePropertyChangeTypeValues() []PropertyChangeType {
+	return []PropertyChangeType{
+		PropertyChangeTypeUpdate,
+		PropertyChangeTypeInsert,
+		PropertyChangeTypeRemove,
+	}
+}
diff --git a/sdk/resourcemanager/resources/armchanges/zz_generated_models.go b/sdk/resourcemanager/resources/armchanges/zz_generated_models.go
new file mode 100644
index 0000000000..4cc0d5ea18
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/zz_generated_models.go
@@ -0,0 +1,143 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armchanges
+
+// ChangeAttributes - Details about the change resource
+type ChangeAttributes struct {
+	// READ-ONLY; The number of changes this resource captures
+	ChangesCount *int64 `json:"changesCount,omitempty" azure:"ro"`
+
+	// READ-ONLY; The ARM correlation ID of the change resource
+	CorrelationID *string `json:"correlationId,omitempty" azure:"ro"`
+
+	// READ-ONLY; The GUID of the new snapshot
+	NewResourceSnapshotID *string `json:"newResourceSnapshotId,omitempty" azure:"ro"`
+
+	// READ-ONLY; The GUID of the previous snapshot
+	PreviousResourceSnapshotID *string `json:"previousResourceSnapshotId,omitempty" azure:"ro"`
+
+	// READ-ONLY; The time the change(s) on the target resource ocurred
+	Timestamp *string `json:"timestamp,omitempty" azure:"ro"`
+}
+
+// ChangeBase - An individual change on the target resource
+type ChangeBase struct {
+	// READ-ONLY; The entity that made the change
+	ChangeCategory *ChangeCategory `json:"changeCategory,omitempty" azure:"ro"`
+
+	// READ-ONLY; The target resource property value after the change
+	NewValue *string `json:"newValue,omitempty" azure:"ro"`
+
+	// READ-ONLY; The target resource property value before the change
+	PreviousValue *string `json:"previousValue,omitempty" azure:"ro"`
+
+	// READ-ONLY; The type of change that occurred
+	PropertyChangeType *PropertyChangeType `json:"propertyChangeType,omitempty" azure:"ro"`
+}
+
+// ChangeProperties - The properties of a change
+type ChangeProperties struct {
+	// Details about the change resource
+	ChangeAttributes *ChangeAttributes `json:"changeAttributes,omitempty"`
+
+	// A dictionary with changed property name as a key and the change details as the value
+	Changes map[string]*ChangeBase `json:"changes,omitempty"`
+
+	// READ-ONLY; The type of change that was captured in the resource
+	ChangeType *ChangeType `json:"changeType,omitempty" azure:"ro"`
+
+	// READ-ONLY; The fully qualified ID of the target resource that was changed
+	TargetResourceID *string `json:"targetResourceId,omitempty" azure:"ro"`
+
+	// READ-ONLY; The namespace and type of the resource
+	TargetResourceType *string `json:"targetResourceType,omitempty" azure:"ro"`
+}
+
+// ChangeResourceListResult - The list of resources
+type ChangeResourceListResult struct {
+	// The link used to get the next page of Change Resources
+	NextLink *string `json:"nextLink,omitempty"`
+
+	// The list of resources
+	Value []*ChangeResourceResult `json:"value,omitempty"`
+}
+
+// ChangeResourceResult - Change Resource
+type ChangeResourceResult struct {
+	// The properties of a change
+	Properties *ChangeProperties `json:"properties,omitempty"`
+
+	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+	ID *string `json:"id,omitempty" azure:"ro"`
+
+	// READ-ONLY; The name of the resource
+	Name *string `json:"name,omitempty" azure:"ro"`
+
+	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+	Type *string `json:"type,omitempty" azure:"ro"`
+}
+
+// ClientGetOptions contains the optional parameters for the Client.Get method.
+type ClientGetOptions struct {
+	// placeholder for future optional parameters
+}
+
+// ClientListOptions contains the optional parameters for the Client.List method.
+type ClientListOptions struct {
+	// (Optional) The page-continuation token
+	SkipToken *string
+	// (Optional) Set the maximum number of results per response.
+	Top *int64
+}
+
+// ErrorAdditionalInfo - The resource management error additional info.
+type ErrorAdditionalInfo struct {
+	// READ-ONLY; The additional info.
+	Info interface{} `json:"info,omitempty" azure:"ro"`
+
+	// READ-ONLY; The additional info type.
+	Type *string `json:"type,omitempty" azure:"ro"`
+}
+
+// ErrorDetail - The error detail.
+type ErrorDetail struct {
+	// READ-ONLY; The error additional info.
+	AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"`
+
+	// READ-ONLY; The error code.
+	Code *string `json:"code,omitempty" azure:"ro"`
+
+	// READ-ONLY; The error details.
+	Details []*ErrorDetail `json:"details,omitempty" azure:"ro"`
+
+	// READ-ONLY; The error message.
+	Message *string `json:"message,omitempty" azure:"ro"`
+
+	// READ-ONLY; The error target.
+	Target *string `json:"target,omitempty" azure:"ro"`
+}
+
+// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations.
+// (This also follows the OData error response format.).
+type ErrorResponse struct {
+	// The error object.
+	Error *ErrorDetail `json:"error,omitempty"`
+}
+
+// Resource - Common fields that are returned in the response for all Azure Resource Manager resources
+type Resource struct {
+	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+	ID *string `json:"id,omitempty" azure:"ro"`
+
+	// READ-ONLY; The name of the resource
+	Name *string `json:"name,omitempty" azure:"ro"`
+
+	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+	Type *string `json:"type,omitempty" azure:"ro"`
+}
diff --git a/sdk/resourcemanager/resources/armchanges/zz_generated_models_serde.go b/sdk/resourcemanager/resources/armchanges/zz_generated_models_serde.go
new file mode 100644
index 0000000000..36d6a42923
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/zz_generated_models_serde.go
@@ -0,0 +1,55 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armchanges
+
+import (
+	"encoding/json"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
+	"reflect"
+)
+
+// MarshalJSON implements the json.Marshaller interface for type ChangeProperties.
+func (c ChangeProperties) MarshalJSON() ([]byte, error) {
+	objectMap := make(map[string]interface{})
+	populate(objectMap, "changeAttributes", c.ChangeAttributes)
+	populate(objectMap, "changeType", c.ChangeType)
+	populate(objectMap, "changes", c.Changes)
+	populate(objectMap, "targetResourceId", c.TargetResourceID)
+	populate(objectMap, "targetResourceType", c.TargetResourceType)
+	return json.Marshal(objectMap)
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ChangeResourceListResult.
+func (c ChangeResourceListResult) MarshalJSON() ([]byte, error) {
+	objectMap := make(map[string]interface{})
+	populate(objectMap, "nextLink", c.NextLink)
+	populate(objectMap, "value", c.Value)
+	return json.Marshal(objectMap)
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorDetail.
+func (e ErrorDetail) MarshalJSON() ([]byte, error) {
+	objectMap := make(map[string]interface{})
+	populate(objectMap, "additionalInfo", e.AdditionalInfo)
+	populate(objectMap, "code", e.Code)
+	populate(objectMap, "details", e.Details)
+	populate(objectMap, "message", e.Message)
+	populate(objectMap, "target", e.Target)
+	return json.Marshal(objectMap)
+}
+
+func populate(m map[string]interface{}, k string, v interface{}) {
+	if v == nil {
+		return
+	} else if azcore.IsNullValue(v) {
+		m[k] = nil
+	} else if !reflect.ValueOf(v).IsNil() {
+		m[k] = v
+	}
+}
diff --git a/sdk/resourcemanager/resources/armchanges/zz_generated_response_types.go b/sdk/resourcemanager/resources/armchanges/zz_generated_response_types.go
new file mode 100644
index 0000000000..9587314680
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/zz_generated_response_types.go
@@ -0,0 +1,19 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armchanges
+
+// ClientGetResponse contains the response from method Client.Get.
+type ClientGetResponse struct {
+	ChangeResourceResult
+}
+
+// ClientListResponse contains the response from method Client.List.
+type ClientListResponse struct {
+	ChangeResourceListResult
+}


Test patch:
diff --git a/eng/common/testproxy/docker-start-proxy.ps1 b/eng/common/testproxy/docker-start-proxy.ps1
index c15fc37a7e..5cdeebf590 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/test-proxy:${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..86b34733bf 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.20220427.1
diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml
index 7b905e0622..f959471f5d 100644
--- a/eng/pipelines/templates/jobs/live.tests.yml
+++ b/eng/pipelines/templates/jobs/live.tests.yml
@@ -42,7 +42,7 @@ jobs:
       matrix: $[ ${{ parameters.Matrix }} ]
 
     variables:
-      - template: ../variables/globals.yml
+      - template: /eng/pipelines/templates/variables/globals.yml
       - name: ArmTemplateParameters
         value: '@{}'
 
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)
 	}
 }
diff --git a/sdk/data/azcosmos/cosmos_client_test.go b/sdk/data/azcosmos/cosmos_client_test.go
index 1eab3dcba3..6bda337e82 100644
--- a/sdk/data/azcosmos/cosmos_client_test.go
+++ b/sdk/data/azcosmos/cosmos_client_test.go
@@ -354,6 +354,22 @@ func TestSendQuery(t *testing.T) {
 	}
 }
 
+func TestCreateScopeFromEndpoint(t *testing.T) {
+	url := "https://foo.documents.azure.com:443/"
+	scope, err := createScopeFromEndpoint(url)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	if scope[0] != "https://foo.documents.azure.com/.default" {
+		t.Errorf("Expected %v, but got %v", "https://foo.documents.azure.com/.default", scope[0])
+	}
+
+	if len(scope) != 1 {
+		t.Errorf("Expected %v, but got %v", 1, len(scope))
+	}
+}
+
 type pipelineVerifier struct {
 	requests []pipelineVerifierRequest
 }
diff --git a/sdk/data/azcosmos/cosmos_policy_bearer_token_test.go b/sdk/data/azcosmos/cosmos_policy_bearer_token_test.go
new file mode 100644
index 0000000000..e5d3eecade
--- /dev/null
+++ b/sdk/data/azcosmos/cosmos_policy_bearer_token_test.go
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azcosmos
+
+import (
+	"context"
+	"net/http"
+	"testing"
+
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+	azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+	"github.com/Azure/azure-sdk-for-go/sdk/internal/mock"
+)
+
+func TestConvertBearerToken(t *testing.T) {
+	srv, close := mock.NewTLSServer()
+	defer close()
+	srv.SetResponse(mock.WithStatusCode(http.StatusOK))
+
+	verifier := bearerTokenVerify{}
+	pl := azruntime.NewPipeline("azcosmostest", "v1.0.0", azruntime.PipelineOptions{PerCall: []policy.Policy{&mockAuthPolicy{}, &cosmosBearerTokenPolicy{}, &verifier}}, &policy.ClientOptions{Transport: srv})
+	req, err := azruntime.NewRequest(context.Background(), http.MethodGet, srv.URL())
+	req.SetOperationValue(pipelineRequestOptions{
+		isWriteOperation: true,
+	})
+
+	if err != nil {
+		t.Fatalf("unexpected error: %v", err)
+	}
+
+	_, err = pl.Do(req)
+	if err != nil {
+		t.Fatalf("unexpected error: %v", err)
+	}
+
+	if verifier.authHeaderContent != "type=aad&ver=1.0&sig=this is a test token" {
+		t.Fatalf("Expected auth header content to be 'type=aad&ver=1.0&sig=this is a test token', got %s", verifier.authHeaderContent)
+	}
+}
+
+type bearerTokenVerify struct {
+	authHeaderContent string
+}
+
+func (p *bearerTokenVerify) Do(req *policy.Request) (*http.Response, error) {
+	p.authHeaderContent = req.Raw().Header.Get(headerAuthorization)
+
+	return req.Next()
+}
+
+type mockAuthPolicy struct{}
+
+func (p *mockAuthPolicy) Do(req *policy.Request) (*http.Response, error) {
+	req.Raw().Header.Set(headerAuthorization, "Bearer this is a test token")
+
+	return req.Next()
+}
diff --git a/sdk/data/azcosmos/emulator_cosmos_aad_test.go b/sdk/data/azcosmos/emulator_cosmos_aad_test.go
new file mode 100644
index 0000000000..8a1502507f
--- /dev/null
+++ b/sdk/data/azcosmos/emulator_cosmos_aad_test.go
@@ -0,0 +1,140 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azcosmos
+
+import (
+	"context"
+	"encoding/json"
+	"testing"
+)
+
+func TestAAD(t *testing.T) {
+	emulatorTests := newEmulatorTests(t)
+	client := emulatorTests.getClient(t)
+
+	database := emulatorTests.createDatabase(t, context.TODO(), client, "aadTest")
+	defer emulatorTests.deleteDatabase(t, context.TODO(), database)
+	properties := ContainerProperties{
+		ID: "aContainer",
+		PartitionKeyDefinition: PartitionKeyDefinition{
+			Paths: []string{"/id"},
+		},
+	}
+
+	_, err := database.CreateContainer(context.TODO(), properties, nil)
+	if err != nil {
+		t.Fatalf("Failed to create container: %v", err)
+	}
+
+	aadClient := emulatorTests.getAadClient(t)
+
+	item := map[string]string{
+		"id":    "1",
+		"value": "2",
+	}
+
+	container, _ := aadClient.NewContainer("aadTest", "aContainer")
+	pk := NewPartitionKeyString("1")
+
+	marshalled, err := json.Marshal(item)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	itemResponse, err := container.CreateItem(context.TODO(), pk, marshalled, nil)
+	if err != nil {
+		t.Fatalf("Failed to create item: %v", err)
+	}
+
+	if itemResponse.SessionToken == "" {
+		t.Fatalf("Session token is empty")
+	}
+
+	// No content on write by default
+	if len(itemResponse.Value) != 0 {
+		t.Fatalf("Expected empty response, got %v", itemResponse.Value)
+	}
+
+	itemResponse, err = container.ReadItem(context.TODO(), pk, "1", nil)
+	if err != nil {
+		t.Fatalf("Failed to read item: %v", err)
+	}
+
+	if len(itemResponse.Value) == 0 {
+		t.Fatalf("Expected non-empty response, got %v", itemResponse.Value)
+	}
+
+	var itemResponseBody map[string]interface{}
+	err = json.Unmarshal(itemResponse.Value, &itemResponseBody)
+	if err != nil {
+		t.Fatalf("Failed to unmarshal item response: %v", err)
+	}
+	if itemResponseBody["id"] != "1" {
+		t.Fatalf("Expected id to be 1, got %v", itemResponseBody["id"])
+	}
+	if itemResponseBody["value"] != "2" {
+		t.Fatalf("Expected value to be 2, got %v", itemResponseBody["value"])
+	}
+
+	item["value"] = "3"
+	marshalled, err = json.Marshal(item)
+	if err != nil {
+		t.Fatal(err)
+	}
+	itemResponse, err = container.ReplaceItem(context.TODO(), pk, "1", marshalled, &ItemOptions{EnableContentResponseOnWrite: true})
+	if err != nil {
+		t.Fatalf("Failed to replace item: %v", err)
+	}
+
+	// Explicitly requesting body on write
+	if len(itemResponse.Value) == 0 {
+		t.Fatalf("Expected non-empty response, got %v", itemResponse.Value)
+	}
+
+	err = json.Unmarshal(itemResponse.Value, &itemResponseBody)
+	if err != nil {
+		t.Fatalf("Failed to unmarshal item response: %v", err)
+	}
+	if itemResponseBody["id"] != "1" {
+		t.Fatalf("Expected id to be 1, got %v", itemResponseBody["id"])
+	}
+	if itemResponseBody["value"] != "3" {
+		t.Fatalf("Expected value to be 3, got %v", itemResponseBody["value"])
+	}
+
+	item["value"] = "4"
+	marshalled, err = json.Marshal(item)
+	if err != nil {
+		t.Fatal(err)
+	}
+	itemResponse, err = container.UpsertItem(context.TODO(), pk, marshalled, &ItemOptions{EnableContentResponseOnWrite: true})
+	if err != nil {
+		t.Fatalf("Failed to upsert item: %v", err)
+	}
+
+	// Explicitly requesting body on write
+	if len(itemResponse.Value) == 0 {
+		t.Fatalf("Expected non-empty response, got %v", itemResponse.Value)
+	}
+
+	err = json.Unmarshal(itemResponse.Value, &itemResponseBody)
+	if err != nil {
+		t.Fatalf("Failed to unmarshal item response: %v", err)
+	}
+	if itemResponseBody["id"] != "1" {
+		t.Fatalf("Expected id to be 1, got %v", itemResponseBody["id"])
+	}
+	if itemResponseBody["value"] != "4" {
+		t.Fatalf("Expected value to be 4, got %v", itemResponseBody["value"])
+	}
+
+	itemResponse, err = container.DeleteItem(context.TODO(), pk, "1", nil)
+	if err != nil {
+		t.Fatalf("Failed to replace item: %v", err)
+	}
+
+	if len(itemResponse.Value) != 0 {
+		t.Fatalf("Expected empty response, got %v", itemResponse.Value)
+	}
+}
diff --git a/sdk/data/azcosmos/emulator_tests.go b/sdk/data/azcosmos/emulator_tests.go
index d0a1793995..c8994ab939 100644
--- a/sdk/data/azcosmos/emulator_tests.go
+++ b/sdk/data/azcosmos/emulator_tests.go
@@ -5,8 +5,14 @@ package azcosmos
 
 import (
 	"context"
+	"encoding/base64"
 	"os"
+	"strconv"
 	"testing"
+	"time"
+
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
 )
 
 type emulatorTests struct {
@@ -36,6 +42,16 @@ func (e *emulatorTests) getClient(t *testing.T) *Client {
 	return client
 }
 
+func (e *emulatorTests) getAadClient(t *testing.T) *Client {
+	cred := &emulatorTokenCredential{}
+	client, err := NewClient(e.host, cred, nil)
+	if err != nil {
+		t.Fatalf("Failed to create client: %v", err)
+	}
+
+	return client
+}
+
 func (e *emulatorTests) createDatabase(
 	t *testing.T,
 	ctx context.Context,
@@ -64,3 +80,47 @@ func (e *emulatorTests) deleteDatabase(
 		t.Fatalf("Failed to delete database: %v", err)
 	}
 }
+
+type emulatorTokenCredential struct {
+}
+
+func (c *emulatorTokenCredential) GetToken(ctx context.Context, options policy.TokenRequestOptions) (*azcore.AccessToken, error) {
+	header := `{"typ":"JWT","alg":"RS256","x5t":"CosmosEmulatorPrimaryMaster","kid":"CosmosEmulatorPrimaryMaster"}`
+	unixNow := time.Now().Unix()
+	expiration := unixNow + 7200
+	payload := `{ 
+		"appid":"localhost", 
+		"aio":"",
+		"appidacr":"1",
+		"idp": "https://localhost:8081/",
+		"oid": "96313034-4739-43cb-93cd-74193adbe5b6",
+		"rh": "",
+		"sub": "localhost",
+		"tid": "EmulatorFederation",
+		"uti": "",
+		"ver": "1.0",
+		"scp": "user_impersonation",
+		"groups":[ 
+			"7ce1d003-4cb3-4879-b7c5-74062a35c66e",
+			"e99ff30c-c229-4c67-ab29-30a6aebc3e58",
+			"5549bb62-c77b-4305-bda9-9ec66b85d9e4",
+			"c44fd685-5c58-452c-aaf7-13ce75184f65",
+			"be895215-eab5-43b7-9536-9ef8fe130330"], 
+		"nbf":` + strconv.FormatInt(unixNow, 10) + `, 
+		"exp":` + strconv.FormatInt(expiration, 10) + `, 
+		"iat":` + strconv.FormatInt(unixNow, 10) + `,
+		"iss":"https://sts.fake-issuer.net/7b1999a1-dfd7-440e-8204-00170979b984",
+		"aud":"https://localhost.localhost" 
+	}`
+
+	headerBase64 := base64.RawURLEncoding.EncodeToString([]byte(header))
+	payloadBase64 := base64.RawURLEncoding.EncodeToString([]byte(payload))
+	masterKeyBase64 := base64.RawURLEncoding.EncodeToString([]byte("C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="))
+
+	token := headerBase64 + "." + payloadBase64 + "." + masterKeyBase64
+
+	return &azcore.AccessToken{
+		Token:     token,
+		ExpiresOn: time.Unix(expiration, 0),
+	}, nil
+}
diff --git a/sdk/data/azcosmos/example_test.go b/sdk/data/azcosmos/example_test.go
index 9d927a8f9f..32d5161468 100644
--- a/sdk/data/azcosmos/example_test.go
+++ b/sdk/data/azcosmos/example_test.go
@@ -12,9 +12,32 @@ import (
 	"time"
 
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
+	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
 	"github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos"
 )
 
+func ExampleNewClient() {
+	endpoint, ok := os.LookupEnv("AZURE_COSMOS_ENDPOINT")
+	if !ok {
+		panic("AZURE_COSMOS_ENDPOINT could not be found")
+	}
+
+	// Obtain a TokenCredential for the current environment
+	// Alternatively, you could use any of the other credential types
+	// For example, azidentity.NewClientSecretCredential("tenantId", "clientId", "clientSecret")
+	cred, err := azidentity.NewDefaultAzureCredential(nil)
+	if err != nil {
+		panic(err)
+	}
+
+	client, err := azcosmos.NewClient(endpoint, cred, nil)
+	if err != nil {
+		panic(err)
+	}
+
+	fmt.Println(client)
+}
+
 func ExampleNewClientWithKey() {
 	endpoint, ok := os.LookupEnv("AZURE_COSMOS_ENDPOINT")
 	if !ok {
diff --git a/sdk/internal/log/log_test.go b/sdk/internal/log/log_test.go
index 79b3fd64d2..8cc8b55a18 100644
--- a/sdk/internal/log/log_test.go
+++ b/sdk/internal/log/log_test.go
@@ -10,6 +10,11 @@ import (
 	"testing"
 )
 
+const (
+	EventRequest  Event = "Request"
+	EventResponse Event = "Response"
+)
+
 func TestLoggingdefault(t *testing.T) {
 	// ensure logging with nil listener doesn't fail
 	SetListener(nil)
diff --git a/sdk/resourcemanager/resources/armchanges/ze_generated_example_changes_client_test.go b/sdk/resourcemanager/resources/armchanges/ze_generated_example_changes_client_test.go
new file mode 100644
index 0000000000..a1fe1c0248
--- /dev/null
+++ b/sdk/resourcemanager/resources/armchanges/ze_generated_example_changes_client_test.go
@@ -0,0 +1,72 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armchanges_test
+
+import (
+	"context"
+	"log"
+
+	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armchanges"
+)
+
+// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Resources/stable/2022-05-01/examples/ListChanges.json
+func ExampleClient_NewListPager() {
+	cred, err := azidentity.NewDefaultAzureCredential(nil)
+	if err != nil {
+		log.Fatalf("failed to obtain a credential: %v", err)
+	}
+	ctx := context.Background()
+	client, err := armchanges.NewClient("<subscription-id>", cred, nil)
+	if err != nil {
+		log.Fatalf("failed to create client: %v", err)
+	}
+	pager := client.NewListPager("<resource-group-name>",
+		"<resource-provider-namespace>",
+		"<resource-type>",
+		"<resource-name>",
+		&armchanges.ClientListOptions{Top: nil,
+			SkipToken: nil,
+		})
+	for pager.More() {
+		nextResult, err := pager.NextPage(ctx)
+		if err != nil {
+			log.Fatalf("failed to advance page: %v", err)
+		}
+		for _, v := range nextResult.Value {
+			// TODO: use page item
+			_ = v
+		}
+	}
+}
+
+// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Resources/stable/2022-05-01/examples/GetChange.json
+func ExampleClient_Get() {
+	cred, err := azidentity.NewDefaultAzureCredential(nil)
+	if err != nil {
+		log.Fatalf("failed to obtain a credential: %v", err)
+	}
+	ctx := context.Background()
+	client, err := armchanges.NewClient("<subscription-id>", cred, nil)
+	if err != nil {
+		log.Fatalf("failed to create client: %v", err)
+	}
+	res, err := client.Get(ctx,
+		"<resource-group-name>",
+		"<resource-provider-namespace>",
+		"<resource-type>",
+		"<resource-name>",
+		"<change-resource-id>",
+		nil)
+	if err != nil {
+		log.Fatalf("failed to finish the request: %v", err)
+	}
+	// TODO: use response item
+	_ = res
+}