Repository: Azure/azure-sdk-for-go
Pull request #17402 (2022-03-29 18:41:25)

[KeyVault] Updating internal to go1.18
This will need a release after the azcore release


Patch:
diff --git a/eng/common/pipelines/templates/steps/check-spelling.yml b/eng/common/pipelines/templates/steps/check-spelling.yml
index 2da6ca62b7..f9f0cf2704 100644
--- a/eng/common/pipelines/templates/steps/check-spelling.yml
+++ b/eng/common/pipelines/templates/steps/check-spelling.yml
@@ -8,8 +8,6 @@
 
 parameters:
   ContinueOnError: true
-  TargetBranch: $(System.PullRequest.TargetBranch)
-  SourceBranch: HEAD
   CspellConfigPath: ./.vscode/cspell.json
 
 steps:
@@ -26,8 +24,6 @@ steps:
         targetType: filePath
         filePath: eng/common/scripts/check-spelling-in-changed-files.ps1
         arguments: >-
-          -TargetBranch "origin/$("${{ parameters.TargetBranch }}" -replace "refs/heads/")"
-          -SourceBranch ${{ parameters.SourceBranch }}
           -CspellConfigPath ${{ parameters.CspellConfigPath }}
           -ExitWithError:(!$${{ parameters.ContinueOnError }})
         pwsh: true
diff --git a/eng/common/scripts/check-spelling-in-changed-files.ps1 b/eng/common/scripts/check-spelling-in-changed-files.ps1
index 50b4f71bab..55bc3d0339 100644
--- a/eng/common/scripts/check-spelling-in-changed-files.ps1
+++ b/eng/common/scripts/check-spelling-in-changed-files.ps1
@@ -23,17 +23,6 @@ and then uses the mutated config file to call cspell. In the case of success
 the temporary file is deleted. In the case of failure the temporary file, whose
 location was logged to the console, remains on disk.
 
-.PARAMETER TargetBranch
-Git ref to compare changes. This is usually the "base" (GitHub) or "target" 
-(DevOps) branch for which a pull request would be opened.
-
-.PARAMETER SourceBranch
-Git ref to use instead of changes in current repo state. Use `HEAD` here to 
-check spelling of files that have been committed and exclude any new files or
-modified files that are not committed. This is most useful in CI scenarios where
-builds may have modified the state of the repo. Leaving this parameter blank  
-includes files for whom changes have not been committed.
-
 .PARAMETER SpellCheckRoot
 Root folder from which to generate relative paths for spell checking. Mostly
 used in testing.
@@ -49,7 +38,7 @@ Exit with error code 1 if spelling errors are detected.
 Run test functions against the script logic
 
 .EXAMPLE
-./eng/common/scripts/check-spelling-in-changed-files.ps1 -TargetBranch 'target_branch_name'
+./eng/common/scripts/check-spelling-in-changed-files.ps1 
 
 This will run spell check with changes in the current branch with respect to 
 `target_branch_name`
@@ -58,12 +47,6 @@ This will run spell check with changes in the current branch with respect to
 
 [CmdletBinding()]
 Param (
-    [Parameter()]
-    [string] $TargetBranch,
-
-    [Parameter()]
-    [string] $SourceBranch,
-
     [Parameter()]
     [string] $CspellConfigPath = (Resolve-Path "$PSScriptRoot/../../../.vscode/cspell.json"),
 
@@ -101,7 +84,6 @@ function Test-Exit0WhenAllFilesExcluded() {
 
     # Act
     &"$PSScriptRoot/check-spelling-in-changed-files.ps1" `
-        -TargetBranch HEAD~1 `
         -CspellConfigPath "./.vscode/cspell.json" `
         -SpellCheckRoot "./" `
         -ExitWithError
@@ -120,7 +102,6 @@ function Test-Exit1WhenIncludedFileHasSpellingError() {
 
     # Act
     &"$PSScriptRoot/check-spelling-in-changed-files.ps1" `
-        -TargetBranch HEAD~1 `
         -CspellConfigPath "./.vscode/cspell.json" `
         -SpellCheckRoot "./" `
         -ExitWithError
@@ -139,7 +120,6 @@ function Test-Exit0WhenIncludedFileHasNoSpellingError() {
 
     # Act
     &"$PSScriptRoot/check-spelling-in-changed-files.ps1" `
-        -TargetBranch HEAD~1 `
         -CspellConfigPath "./.vscode/cspell.json" `
         -SpellCheckRoot "./" `
         -ExitWithError
@@ -162,7 +142,6 @@ function Test-Exit1WhenChangedFileAlreadyHasSpellingError() {
 
     # Act
     &"$PSScriptRoot/check-spelling-in-changed-files.ps1" `
-        -TargetBranch HEAD~1 `
         -CspellConfigPath "./.vscode/cspell.json" `
         -SpellCheckRoot "./" `
         -ExitWithError
@@ -185,7 +164,6 @@ function Test-Exit0WhenUnalteredFileHasSpellingError() {
 
     # Act
     &"$PSScriptRoot/check-spelling-in-changed-files.ps1" `
-        -TargetBranch HEAD~1 `
         -CspellConfigPath "./.vscode/cspell.json" `
         -SpellCheckRoot "./" `
         -ExitWithError
@@ -204,7 +182,6 @@ function Test-Exit0WhenSpellingErrorsAndNoExitWithError() {
 
     # Act
     &"$PSScriptRoot/check-spelling-in-changed-files.ps1" `
-        -TargetBranch HEAD~1 `
         -CspellConfigPath "./.vscode/cspell.json" `
         -SpellCheckRoot "./"
 
@@ -287,7 +264,7 @@ if (!(Test-Path $CspellConfigPath)) {
 }
 
 # Lists names of files that were in some way changed between the
-# current $SourceBranch and $TargetBranch. Excludes files that were deleted to
+# current branch and default target branch. Excludes files that were deleted to
 # prevent errors in Resolve-Path
 $changedFilesList = Get-ChangedFiles
 
diff --git a/eng/common/scripts/job-matrix/Create-JobMatrix.ps1 b/eng/common/scripts/job-matrix/Create-JobMatrix.ps1
index 729342ca6f..6eba7e8795 100644
--- a/eng/common/scripts/job-matrix/Create-JobMatrix.ps1
+++ b/eng/common/scripts/job-matrix/Create-JobMatrix.ps1
@@ -19,6 +19,10 @@ param (
 
 . $PSScriptRoot/job-matrix-functions.ps1
 
+if (!(Test-Path $ConfigPath)) {
+    Write-Error "ConfigPath '$ConfigPath' does not exist."
+    exit 1
+}
 $config = GetMatrixConfigFromJson (Get-Content $ConfigPath)
 # Strip empty string filters in order to be able to use azure pipelines yaml join()
 $Filters = $Filters | Where-Object { $_ }
diff --git a/eng/common/scripts/job-matrix/job-matrix-functions.ps1 b/eng/common/scripts/job-matrix/job-matrix-functions.ps1
index 25ff756950..7d36752135 100644
--- a/eng/common/scripts/job-matrix/job-matrix-functions.ps1
+++ b/eng/common/scripts/job-matrix/job-matrix-functions.ps1
@@ -355,6 +355,10 @@ function ProcessImport([MatrixParameter[]]$matrix, [String]$selection, [Array]$n
         return $matrix, @()
     }
 
+    if (!(Test-Path $importPath)) {
+        Write-Error "`$IMPORT path '$importPath' does not exist."
+        exit 1
+    }
     $importedMatrixConfig = GetMatrixConfigFromJson (Get-Content $importPath)
     $importedMatrix = GenerateMatrix `
                         -config $importedMatrixConfig `
@@ -515,15 +519,12 @@ function CreateMatrixCombinationScalar([MatrixParameter[]]$permutation, [Hashtab
 
     # The maximum allowed matrix name length is 100 characters
     $name = $names -join "_"
+    if ($name -and $name[0] -match "^[0-9]") {
+        $name = "job_" + $name  # Azure Pipelines only supports job names starting with letters
+    }
     if ($name.Length -gt 100) {
         $name = $name[0..99] -join ""
     }
-    $stripped = $name -replace "^[^A-Za-z]*", ""  # strip leading digits
-    if ($stripped -eq "") {
-        $name = "job_" + $name  # Handle names that consist entirely of numbers
-    } else {
-        $name = $stripped
-    }
 
     return @{
         name = $name
diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1
index 6f69d846d5..fd4d6193e3 100644
--- a/eng/scripts/Language-Settings.ps1
+++ b/eng/scripts/Language-Settings.ps1
@@ -69,6 +69,12 @@ function Get-go-PackageInfoFromPackageFile($pkg, $workingDirectory)
     $releaseNotes = ""
     $packageProperties = Get-GoModuleProperties $pkg.Directory
 
+    # We have some cases when processing service directories that non-shipping projects like perfdata
+    # we just want to exclude them as opposed to returning a property with invalid data.
+    if (!$packageProperties) {
+      return $null
+    }
+
     if ($packageProperties.ChangeLogPath -and $packageProperties.Version)
     {
       $releaseNotes = Get-ChangeLogEntryAsString -ChangeLogLocation $packageProperties.ChangeLogPath `
diff --git a/sdk/azcore/CHANGELOG.md b/sdk/azcore/CHANGELOG.md
index 63cf0a64c0..f832b753ab 100644
--- a/sdk/azcore/CHANGELOG.md
+++ b/sdk/azcore/CHANGELOG.md
@@ -1,16 +1,33 @@
 # Release History
 
-## 0.23.0 (Unreleased)
+## 0.23.1 (Unreleased)
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
+
+## 0.23.0 (2022-04-04)
 
 ### Features Added
 * Added `runtime.Pager[T any]` and `runtime.Poller[T any]` supporting types for central, generic, implementations.
+* Added `cloud` package with a new API for cloud configuration
+* Added `FinalStateVia` field to `runtime.NewPollerOptions[T any]` type.
 
 ### Breaking Changes
 * Removed the `Poller` type-alias to the internal poller implementation.
 * Added `Ptr[T any]` and `SliceOfPtrs[T any]` in the `to` package and removed all non-generic implementations.
 * `NullValue` and `IsNullValue` now take a generic type parameter instead of an interface func parameter.
-
-### Bugs Fixed
+* Replaced `arm.Endpoint` with `cloud` API
+  * Removed the `endpoint` parameter from `NewRPRegistrationPolicy()`
+  * `arm/runtime.NewPipeline()` and `.NewRPRegistrationPolicy()` now return an `error`
+* Refactored `NewPoller` and `NewPollerFromResumeToken` funcs in `arm/runtime` and `runtime` packages.
+  * Removed the `pollerID` parameter as it's no longer required.
+  * Created optional parameter structs and moved optional parameters into them.
+* Changed `FinalStateVia` field to a `const` type.
 
 ### Other Changes
 * Converted expiring resource and dependent types to use generics.
diff --git a/sdk/azcore/arm/arm.go b/sdk/azcore/arm/arm.go
new file mode 100644
index 0000000000..055353650c
--- /dev/null
+++ b/sdk/azcore/arm/arm.go
@@ -0,0 +1,24 @@
+//go:build go1.16
+// +build go1.16
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package arm
+
+import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+
+func init() {
+	cloud.AzureChina.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
+		Audience: "https://management.core.chinacloudapi.cn",
+		Endpoint: "https://management.chinacloudapi.cn",
+	}
+	cloud.AzureGovernment.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
+		Audience: "https://management.core.usgovcloudapi.net",
+		Endpoint: "https://management.usgovcloudapi.net",
+	}
+	cloud.AzurePublicCloud.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
+		Audience: "https://management.core.windows.net/",
+		Endpoint: "https://management.azure.com",
+	}
+}
diff --git a/sdk/azcore/arm/client_options.go b/sdk/azcore/arm/client_options.go
index deca402c54..998408e07c 100644
--- a/sdk/azcore/arm/client_options.go
+++ b/sdk/azcore/arm/client_options.go
@@ -8,18 +8,6 @@ package arm
 
 import "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
 
-// Endpoint is the base URL for Azure Resource Manager.
-type Endpoint string
-
-const (
-	// AzureChina is the Azure Resource Manager China cloud endpoint.
-	AzureChina Endpoint = "https://management.chinacloudapi.cn/"
-	// AzureGovernment is the Azure Resource Manager US government cloud endpoint.
-	AzureGovernment Endpoint = "https://management.usgovcloudapi.net/"
-	// AzurePublicCloud is the Azure Resource Manager public cloud endpoint.
-	AzurePublicCloud Endpoint = "https://management.azure.com/"
-)
-
 // ClientOptions contains configuration settings for a client's pipeline.
 type ClientOptions struct {
 	policy.ClientOptions
@@ -29,7 +17,4 @@ type ClientOptions struct {
 
 	// DisableRPRegistration disables the auto-RP registration policy. Defaults to false.
 	DisableRPRegistration bool
-
-	// Endpoint is the base URL for Azure Resource Manager. Defaults to AzurePublicCloud.
-	Endpoint Endpoint
 }
diff --git a/sdk/azcore/arm/internal/pollers/async/async.go b/sdk/azcore/arm/internal/pollers/async/async.go
index b76ef60240..b4f3f0f23d 100644
--- a/sdk/azcore/arm/internal/pollers/async/async.go
+++ b/sdk/azcore/arm/internal/pollers/async/async.go
@@ -20,12 +20,6 @@ import (
 // Kind is the identifier of this type in a resume token.
 const Kind = "Azure-AsyncOperation"
 
-const (
-	finalStateAsync = "azure-async-operation"
-	finalStateLoc   = "location" //nolint
-	finalStateOrig  = "original-uri"
-)
-
 // Applicable returns true if the LRO is using Azure-AsyncOperation.
 func Applicable(resp *http.Response) bool {
 	return resp.Header.Get(shared.HeaderAzureAsync) != ""
@@ -49,14 +43,14 @@ type Poller struct {
 	Method string `json:"method"`
 
 	// The value of final-state-via from swagger, can be the empty string.
-	FinalState string `json:"finalState"`
+	FinalState pollers.FinalStateVia `json:"finalState"`
 
 	// The LRO's current state.
 	CurState string `json:"state"`
 }
 
 // New creates a new Poller from the provided initial response and final-state type.
-func New(resp *http.Response, finalState string, pollerID string) (*Poller, error) {
+func New(resp *http.Response, finalState pollers.FinalStateVia, pollerID string) (*Poller, error) {
 	log.Write(log.EventLRO, "Using Azure-AsyncOperation poller.")
 	asyncURL := resp.Header.Get(shared.HeaderAzureAsync)
 	if asyncURL == "" {
@@ -115,9 +109,9 @@ func (p *Poller) FinalGetURL() string {
 		// for PATCH and PUT, the final GET is on the original resource URL
 		return p.OrigURL
 	} else if p.Method == http.MethodPost {
-		if p.FinalState == finalStateAsync {
+		if p.FinalState == pollers.FinalStateViaAzureAsyncOp {
 			return ""
-		} else if p.FinalState == finalStateOrig {
+		} else if p.FinalState == pollers.FinalStateViaOriginalURI {
 			return p.OrigURL
 		} else if p.LocURL != "" {
 			// ideally FinalState would be set to "location" but it isn't always.
diff --git a/sdk/azcore/arm/runtime/pipeline.go b/sdk/azcore/arm/runtime/pipeline.go
index 48775a7f51..1628d51112 100644
--- a/sdk/azcore/arm/runtime/pipeline.go
+++ b/sdk/azcore/arm/runtime/pipeline.go
@@ -7,25 +7,30 @@
 package runtime
 
 import (
+	"errors"
+	"reflect"
+
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
 	armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pipeline"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
+	azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
 	azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
 )
 
 // NewPipeline creates a pipeline from connection options.
 // The telemetry policy, when enabled, will use the specified module and version info.
-func NewPipeline(module, version string, cred shared.TokenCredential, plOpts azruntime.PipelineOptions, options *arm.ClientOptions) pipeline.Pipeline {
+func NewPipeline(module, version string, cred shared.TokenCredential, plOpts azruntime.PipelineOptions, options *arm.ClientOptions) (pipeline.Pipeline, error) {
 	if options == nil {
 		options = &arm.ClientOptions{}
 	}
-	ep := options.Endpoint
-	if len(ep) == 0 {
-		ep = arm.AzurePublicCloud
+	conf, err := getConfiguration(&options.ClientOptions)
+	if err != nil {
+		return pipeline.Pipeline{}, err
 	}
 	authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{
-		Scopes:           []string{shared.EndpointToScope(string(ep))},
+		Scopes:           []string{conf.Audience + "/.default"},
 		AuxiliaryTenants: options.AuxiliaryTenants,
 	})
 	perRetry := make([]pipeline.Policy, 0, len(plOpts.PerRetry)+1)
@@ -33,10 +38,25 @@ func NewPipeline(module, version string, cred shared.TokenCredential, plOpts azr
 	plOpts.PerRetry = append(perRetry, authPolicy)
 	if !options.DisableRPRegistration {
 		regRPOpts := armpolicy.RegistrationOptions{ClientOptions: options.ClientOptions}
-		regPolicy := NewRPRegistrationPolicy(string(ep), cred, &regRPOpts)
+		regPolicy, err := NewRPRegistrationPolicy(cred, &regRPOpts)
+		if err != nil {
+			return pipeline.Pipeline{}, err
+		}
 		perCall := make([]pipeline.Policy, 0, len(plOpts.PerCall)+1)
 		copy(perCall, plOpts.PerCall)
 		plOpts.PerCall = append(perCall, regPolicy)
 	}
-	return azruntime.NewPipeline(module, version, plOpts, &options.ClientOptions)
+	return azruntime.NewPipeline(module, version, plOpts, &options.ClientOptions), nil
+}
+
+func getConfiguration(o *azpolicy.ClientOptions) (cloud.ServiceConfiguration, error) {
+	c := cloud.AzurePublicCloud
+	if !reflect.ValueOf(o.Cloud).IsZero() {
+		c = o.Cloud
+	}
+	if conf, ok := c.Services[cloud.ResourceManager]; ok && conf.Endpoint != "" && conf.Audience != "" {
+		return conf, nil
+	} else {
+		return conf, errors.New("provided Cloud field is missing Azure Resource Manager configuration")
+	}
 }
diff --git a/sdk/azcore/arm/runtime/policy_register_rp.go b/sdk/azcore/arm/runtime/policy_register_rp.go
index 67a104b133..7d798169fc 100644
--- a/sdk/azcore/arm/runtime/policy_register_rp.go
+++ b/sdk/azcore/arm/runtime/policy_register_rp.go
@@ -46,23 +46,26 @@ func setDefaults(r *armpolicy.RegistrationOptions) {
 	}
 }
 
-// NewRPRegistrationPolicy creates a policy object configured using the specified endpoint,
-// credentials and options.  The policy controls if an unregistered resource provider should
-// automatically be registered. See https://aka.ms/rps-not-found for more information.
-// Pass nil to accept the default options; this is the same as passing a zero-value options.
-func NewRPRegistrationPolicy(endpoint string, cred shared.TokenCredential, o *armpolicy.RegistrationOptions) azpolicy.Policy {
+// NewRPRegistrationPolicy creates a policy object configured using the specified options.
+// The policy controls whether an unregistered resource provider should automatically be
+// registered. See https://aka.ms/rps-not-found for more information.
+func NewRPRegistrationPolicy(cred shared.TokenCredential, o *armpolicy.RegistrationOptions) (azpolicy.Policy, error) {
 	if o == nil {
 		o = &armpolicy.RegistrationOptions{}
 	}
-	authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{Scopes: []string{shared.EndpointToScope(endpoint)}})
+	conf, err := getConfiguration(&o.ClientOptions)
+	if err != nil {
+		return nil, err
+	}
+	authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{Scopes: []string{conf.Audience + "/.default"}})
 	p := &rpRegistrationPolicy{
-		endpoint: endpoint,
+		endpoint: conf.Endpoint,
 		pipeline: runtime.NewPipeline(shared.Module, shared.Version, runtime.PipelineOptions{PerRetry: []pipeline.Policy{authPolicy}}, &o.ClientOptions),
 		options:  *o,
 	}
 	// init the copy
 	setDefaults(&p.options)
-	return p
+	return p, nil
 }
 
 type rpRegistrationPolicy struct {
diff --git a/sdk/azcore/arm/runtime/poller.go b/sdk/azcore/arm/runtime/poller.go
index 4450f52bd0..cc03ad097f 100644
--- a/sdk/azcore/arm/runtime/poller.go
+++ b/sdk/azcore/arm/runtime/poller.go
@@ -22,26 +22,58 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/internal/log"
 )
 
+// FinalStateVia is the enumerated type for the possible final-state-via values.
+type FinalStateVia = pollers.FinalStateVia
+
+const (
+	// FinalStateViaAzureAsyncOp indicates the final payload comes from the Azure-AsyncOperation URL.
+	FinalStateViaAzureAsyncOp = pollers.FinalStateViaAzureAsyncOp
+
+	// FinalStateViaLocation indicates the final payload comes from the Location URL.
+	FinalStateViaLocation = pollers.FinalStateViaLocation
+
+	// FinalStateViaOriginalURI indicates the final payload comes from the original URL.
+	FinalStateViaOriginalURI = pollers.FinalStateViaOriginalURI
+
+	// FinalStateViaOpLocation indicates the final payload comes from the Operation-Location URL.
+	FinalStateViaOpLocation = pollers.FinalStateViaOpLocation
+)
+
+// NewPollerOptions contains the optional parameters for NewPoller.
+type NewPollerOptions[T any] struct {
+	// FinalStateVia contains the final-state-via value for the LRO.
+	FinalStateVia FinalStateVia
+
+	// Response contains a preconstructed response type.
+	// The final payload will be unmarshaled into it and returned.
+	Response *T
+}
+
 // NewPoller creates a Poller based on the provided initial response.
-// pollerID - a unique identifier for an LRO.  it's usually the client.Method string.
-func NewPoller[T any](pollerID string, finalState string, resp *http.Response, pl pipeline.Pipeline, rt *T) (*Poller[T], error) {
+func NewPoller[T any](resp *http.Response, pl pipeline.Pipeline, options *NewPollerOptions[T]) (*Poller[T], error) {
+	if options == nil {
+		options = &NewPollerOptions[T]{}
+	}
 	defer resp.Body.Close()
 	// this is a back-stop in case the swagger is incorrect (i.e. missing one or more status codes for success).
 	// ideally the codegen should return an error if the initial response failed and not even create a poller.
 	if !pollers.StatusCodeValid(resp) {
 		return nil, errors.New("the LRO failed or was cancelled")
 	}
+	tName, err := pollers.PollerTypeName[T]()
+	if err != nil {
+		return nil, err
+	}
 	// determine the polling method
 	var lro pollers.Operation
-	var err error
 	if async.Applicable(resp) {
-		lro, err = async.New(resp, finalState, pollerID)
+		lro, err = async.New(resp, options.FinalStateVia, tName)
 	} else if loc.Applicable(resp) {
-		lro, err = loc.New(resp, pollerID)
+		lro, err = loc.New(resp, tName)
 	} else if body.Applicable(resp) {
 		// must test body poller last as it's a subset of the other pollers.
 		// TODO: this is ambiguous for PATCH/PUT if it returns a 200 with no polling headers (sync completion)
-		lro, err = body.New(resp, pollerID)
+		lro, err = body.New(resp, tName)
 	} else if m := resp.Request.Method; resp.StatusCode == http.StatusAccepted && (m == http.MethodDelete || m == http.MethodPost) {
 		// if we get here it means we have a 202 with no polling headers.
 		// for DELETE and POST this is a hard error per ARM RPC spec.
@@ -54,14 +86,27 @@ func NewPoller[T any](pollerID string, finalState string, resp *http.Response, p
 	}
 	return &Poller[T]{
 		pt: pollers.NewPoller(lro, resp, pl),
-		rt: rt,
+		rt: options.Response,
 	}, nil
 }
 
+// NewPollerFromResumeTokenOptions contains the optional parameters for NewPollerFromResumeToken.
+type NewPollerFromResumeTokenOptions[T any] struct {
+	// Response contains a preconstructed response type.
+	// The final payload will be unmarshaled into it and returned.
+	Response *T
+}
+
 // NewPollerFromResumeToken creates a Poller from a resume token string.
-// pollerID - a unique identifier for an LRO.  it's usually the client.Method string.
-func NewPollerFromResumeToken[T any](pollerID string, token string, pl pipeline.Pipeline, rt *T) (*Poller[T], error) {
-	kind, err := pollers.KindFromToken(pollerID, token)
+func NewPollerFromResumeToken[T any](token string, pl pipeline.Pipeline, options *NewPollerFromResumeTokenOptions[T]) (*Poller[T], error) {
+	if options == nil {
+		options = &NewPollerFromResumeTokenOptions[T]{}
+	}
+	tName, err := pollers.PollerTypeName[T]()
+	if err != nil {
+		return nil, err
+	}
+	kind, err := pollers.KindFromToken(tName, token)
 	if err != nil {
 		return nil, err
 	}
@@ -85,7 +130,7 @@ func NewPollerFromResumeToken[T any](pollerID string, token string, pl pipeline.
 	}
 	return &Poller[T]{
 		pt: pollers.NewPoller(lro, nil, pl),
-		rt: rt,
+		rt: options.Response,
 	}, nil
 }
 
diff --git a/sdk/azcore/cloud/cloud.go b/sdk/azcore/cloud/cloud.go
new file mode 100644
index 0000000000..cdbec21b27
--- /dev/null
+++ b/sdk/azcore/cloud/cloud.go
@@ -0,0 +1,44 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package cloud
+
+var (
+	// AzureChina contains configuration for Azure China.
+	AzureChina = Configuration{
+		LoginEndpoint: "https://login.chinacloudapi.cn/", Services: map[ServiceName]ServiceConfiguration{},
+	}
+	// AzureGovernment contains configuration for Azure Government.
+	AzureGovernment = Configuration{
+		LoginEndpoint: "https://login.microsoftonline.us/", Services: map[ServiceName]ServiceConfiguration{},
+	}
+	// AzurePublicCloud contains configuration for Azure Public Cloud.
+	AzurePublicCloud = Configuration{
+		LoginEndpoint: "https://login.microsoftonline.com/", Services: map[ServiceName]ServiceConfiguration{},
+	}
+)
+
+// ServiceName identifies a cloud service.
+type ServiceName string
+
+// ResourceManager is a global constant identifying Azure Resource Manager.
+const ResourceManager ServiceName = "resourceManager"
+
+// ServiceConfiguration configures a specific cloud service such as Azure Resource Manager.
+type ServiceConfiguration struct {
+	// Audience is the audience the client will request for its access tokens.
+	Audience string
+	// Endpoint is the service's base URL.
+	Endpoint string
+}
+
+// Configuration configures a cloud.
+type Configuration struct {
+	// LoginEndpoint is the base URL of the cloud's Azure Active Directory.
+	LoginEndpoint string
+	// Services contains configuration for the cloud's services.
+	Services map[ServiceName]ServiceConfiguration
+}
diff --git a/sdk/azcore/cloud/doc.go b/sdk/azcore/cloud/doc.go
new file mode 100644
index 0000000000..11f3ef9826
--- /dev/null
+++ b/sdk/azcore/cloud/doc.go
@@ -0,0 +1,54 @@
+//go:build go1.16
+// +build go1.16
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+/*
+Package cloud implements a configuration API for applications deployed to sovereign or private Azure clouds.
+
+Azure SDK client configuration defaults are appropriate for Azure Public Cloud (sometimes referred to as
+"Azure Commercial" or simply "Microsoft Azure"). This package enables applications deployed to other
+Azure Clouds to configure clients appropriately.
+
+This package contains predefined configuration for well-known sovereign clouds such as Azure Government and
+Azure China. Azure SDK clients accept this configuration via the Cloud field of azcore.ClientOptions. For
+example, configuring a credential and ARM client for Azure Government:
+
+	opts := azcore.ClientOptions{Cloud: cloud.AzureGovernment}
+	cred, err := azidentity.NewDefaultAzureCredential(
+		&azidentity.DefaultAzureCredentialOptions{ClientOptions: opts}
+	)
+	handle(err)
+
+	client, err := armsubscription.NewClient(
+		cred, &arm.ClientOptions{ClientOptions: opts}
+	)
+	handle(err)
+
+Applications deployed to a private cloud such as Azure Stack create a Configuration object with
+appropriate values:
+
+	c = cloud.Configuration{
+		LoginEndpoint: "https://...",
+		Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
+			cloud.ResourceManager: {
+				Audience: "...",
+				Endpoint: "https://...",
+			},
+		},
+	}
+	opts := azcore.ClientOptions{Cloud: c}
+
+	cred, err := azidentity.NewDefaultAzureCredential(
+		&azidentity.DefaultAzureCredentialOptions{ClientOptions: opts}
+	)
+	handle(err)
+
+	client, err := armsubscription.NewClient(
+		cred, &arm.ClientOptions{ClientOptions: opts}
+	)
+	handle(err)
+*/
+
+package cloud
diff --git a/sdk/azcore/core.go b/sdk/azcore/core.go
index 2660c0e81c..2f1f5a52b0 100644
--- a/sdk/azcore/core.go
+++ b/sdk/azcore/core.go
@@ -22,16 +22,10 @@ type TokenCredential = shared.TokenCredential
 // holds sentinel values used to send nulls
 var nullables map[reflect.Type]interface{} = map[reflect.Type]interface{}{}
 
-func typeOfT[T any]() reflect.Type {
-	// you can't, at present, obtain the type of
-	// a type parameter, so this is the trick
-	return reflect.TypeOf((*T)(nil)).Elem()
-}
-
 // NullValue is used to send an explicit 'null' within a request.
 // This is typically used in JSON-MERGE-PATCH operations to delete a value.
 func NullValue[T any]() T {
-	t := typeOfT[T]()
+	t := shared.TypeOfT[T]()
 	v, found := nullables[t]
 	if !found {
 		var o reflect.Value
diff --git a/sdk/azcore/internal/pollers/loc/loc.go b/sdk/azcore/internal/pollers/loc/loc.go
index a7efa52f5d..cac87f69b7 100644
--- a/sdk/azcore/internal/pollers/loc/loc.go
+++ b/sdk/azcore/internal/pollers/loc/loc.go
@@ -28,11 +28,12 @@ func Applicable(resp *http.Response) bool {
 type Poller struct {
 	Type     string `json:"type"`
 	PollURL  string `json:"pollURL"`
+	FinalGET string `json:"finalGET"`
 	CurState int    `json:"state"`
 }
 
 // New creates a new Poller from the provided initial response.
-func New(resp *http.Response, pollerID string) (*Poller, error) {
+func New(resp *http.Response, finalState pollers.FinalStateVia, pollerID string) (*Poller, error) {
 	log.Write(log.EventLRO, "Using Location poller.")
 	locURL := resp.Header.Get(shared.HeaderLocation)
 	if locURL == "" {
@@ -41,9 +42,12 @@ func New(resp *http.Response, pollerID string) (*Poller, error) {
 	if !pollers.IsValidURL(locURL) {
 		return nil, fmt.Errorf("invalid polling URL %s", locURL)
 	}
+	// TODO: calculate the final GET URL.  can be empty
+	finalGET := ""
 	return &Poller{
 		Type:     pollers.MakeID(pollerID, Kind),
 		PollURL:  locURL,
+		FinalGET: finalGET,
 		CurState: resp.StatusCode,
 	}, nil
 }
@@ -65,8 +69,8 @@ func (p *Poller) Update(resp *http.Response) error {
 	return nil
 }
 
-func (*Poller) FinalGetURL() string {
-	return ""
+func (p *Poller) FinalGetURL() string {
+	return p.FinalGET
 }
 
 func (p *Poller) Status() string {
diff --git a/sdk/azcore/internal/pollers/op/op.go b/sdk/azcore/internal/pollers/op/op.go
index f32dd45add..7d9c057200 100644
--- a/sdk/azcore/internal/pollers/op/op.go
+++ b/sdk/azcore/internal/pollers/op/op.go
@@ -34,7 +34,7 @@ type Poller struct {
 }
 
 // New creates a new Poller from the provided initial response.
-func New(resp *http.Response, pollerID string) (*Poller, error) {
+func New(resp *http.Response, finalState pollers.FinalStateVia, pollerID string) (*Poller, error) {
 	log.Write(log.EventLRO, "Using Operation-Location poller.")
 	opURL := resp.Header.Get(shared.HeaderOperationLocation)
 	if opURL == "" {
@@ -61,6 +61,7 @@ func New(resp *http.Response, pollerID string) (*Poller, error) {
 	// calculate the tentative final GET URL.
 	// can change if we receive a resourceLocation.
 	// it's ok for it to be empty in some cases.
+	// TODO: finalState
 	finalGET := ""
 	if resp.Request.Method == http.MethodPatch || resp.Request.Method == http.MethodPut {
 		finalGET = resp.Request.URL.String()
diff --git a/sdk/azcore/internal/pollers/poller.go b/sdk/azcore/internal/pollers/poller.go
index 18b8467b4c..e29f5a030f 100644
--- a/sdk/azcore/internal/pollers/poller.go
+++ b/sdk/azcore/internal/pollers/poller.go
@@ -20,6 +20,23 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/internal/log"
 )
 
+// FinalStateVia is the enumerated type for the possible final-state-via values.
+type FinalStateVia string
+
+const (
+	// FinalStateViaAzureAsyncOp indicates the final payload comes from the Azure-AsyncOperation URL.
+	FinalStateViaAzureAsyncOp FinalStateVia = "azure-async-operation"
+
+	// FinalStateViaLocation indicates the final payload comes from the Location URL.
+	FinalStateViaLocation FinalStateVia = "location"
+
+	// FinalStateViaOriginalURI indicates the final payload comes from the original URL.
+	FinalStateViaOriginalURI FinalStateVia = "original-uri"
+
+	// FinalStateViaOpLocation indicates the final payload comes from the Operation-Location URL.
+	FinalStateViaOpLocation FinalStateVia = "operation-location"
+)
+
 // KindFromToken extracts the poller kind from the provided token.
 // If the pollerID doesn't match what's in the token an error is returned.
 func KindFromToken(pollerID, token string) (string, error) {
diff --git a/sdk/azcore/internal/pollers/util.go b/sdk/azcore/internal/pollers/util.go
index 81b7d95603..c13caaee12 100644
--- a/sdk/azcore/internal/pollers/util.go
+++ b/sdk/azcore/internal/pollers/util.go
@@ -7,9 +7,11 @@
 package pollers
 
 import (
+	"errors"
 	"fmt"
 	"net/http"
 	"net/url"
+	"reflect"
 	"strings"
 
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
@@ -54,6 +56,22 @@ func IsValidURL(s string) bool {
 
 const idSeparator = ";"
 
+// PollerTypeName returns the type name to use when constructing the poller ID.
+// An error is returned if the generic type has no name (e.g. struct{}).
+func PollerTypeName[T any]() (string, error) {
+	tt := shared.TypeOfT[T]()
+	var n string
+	if tt.Kind() == reflect.Pointer {
+		n = "*"
+		tt = tt.Elem()
+	}
+	n += tt.Name()
+	if n == "" {
+		return "", errors.New("nameless types are not allowed")
+	}
+	return n, nil
+}
+
 // MakeID returns the poller ID from the provided values.
 func MakeID(pollerID string, kind string) string {
 	return fmt.Sprintf("%s%s%s", pollerID, idSeparator, kind)
diff --git a/sdk/azcore/internal/shared/constants.go b/sdk/azcore/internal/shared/constants.go
index 6845704f4a..09e765a2db 100644
--- a/sdk/azcore/internal/shared/constants.go
+++ b/sdk/azcore/internal/shared/constants.go
@@ -35,5 +35,5 @@ const (
 	Module = "azcore"
 
 	// Version is the semantic version (see http://semver.org) of this module.
-	Version = "v0.23.0"
+	Version = "v0.23.1"
 )
diff --git a/sdk/azcore/internal/shared/shared.go b/sdk/azcore/internal/shared/shared.go
index 6615ed5629..0109cc79d4 100644
--- a/sdk/azcore/internal/shared/shared.go
+++ b/sdk/azcore/internal/shared/shared.go
@@ -13,9 +13,8 @@ import (
 	"io"
 	"io/ioutil"
 	"net/http"
-	"net/url"
+	"reflect"
 	"strconv"
-	"strings"
 	"time"
 )
 
@@ -200,28 +199,9 @@ func (r *NopClosingBytesReader) Seek(offset int64, whence int) (int64, error) {
 	return i, nil
 }
 
-const defaultScope = "/.default"
-const chinaCloudARMScope = "https://management.core.chinacloudapi.cn/" + defaultScope
-const publicCloudARMScope = "https://management.core.windows.net/" + defaultScope
-const usGovCloudARMScope = "https://management.core.usgovcloudapi.net/" + defaultScope
-
-// EndpointToScope converts the provided URL endpoint to its default scope.
-func EndpointToScope(endpoint string) string {
-	parsed, err := url.Parse(endpoint)
-	if err == nil {
-		host := parsed.Hostname()
-		switch {
-		case strings.HasSuffix(host, "management.azure.com"):
-			return publicCloudARMScope
-		case strings.HasSuffix(host, "management.usgovcloudapi.net"):
-			return usGovCloudARMScope
-		case strings.HasSuffix(host, "management.chinacloudapi.cn"):
-			return chinaCloudARMScope
-		}
-	}
-	// fall back to legacy behavior when endpoint doesn't parse or match a known cloud's ARM endpoint
-	if endpoint[len(endpoint)-1] != '/' {
-		endpoint += "/"
-	}
-	return endpoint + defaultScope
+// TypeOfT returns the type of the generic type param.
+func TypeOfT[T any]() reflect.Type {
+	// you can't, at present, obtain the type of
+	// a type parameter, so this is the trick
+	return reflect.TypeOf((*T)(nil)).Elem()
 }
diff --git a/sdk/azcore/log/log.go b/sdk/azcore/log/log.go
index 47979b39a9..dc1271b13a 100644
--- a/sdk/azcore/log/log.go
+++ b/sdk/azcore/log/log.go
@@ -33,11 +33,13 @@ const (
 
 // SetEvents is used to control which events are written to
 // the log.  By default all log events are writen.
+// NOTE: this is not goroutine safe and should be called before using SDK clients.
 func SetEvents(cls ...Event) {
 	log.SetEvents(cls...)
 }
 
 // SetListener will set the Logger to write to the specified Listener.
+// NOTE: this is not goroutine safe and should be called before using SDK clients.
 func SetListener(lst func(Event, string)) {
 	log.SetListener(lst)
 }
diff --git a/sdk/azcore/policy/policy.go b/sdk/azcore/policy/policy.go
index c855647f6b..50be895882 100644
--- a/sdk/azcore/policy/policy.go
+++ b/sdk/azcore/policy/policy.go
@@ -9,6 +9,7 @@ package policy
 import (
 	"time"
 
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pipeline"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
 )
@@ -27,6 +28,9 @@ type Request = pipeline.Request
 // ClientOptions contains optional settings for a client's pipeline.
 // All zero-value fields will be initialized with default values.
 type ClientOptions struct {
+	// Cloud specifies a cloud for the client. The default is Azure Public Cloud.
+	Cloud cloud.Configuration
+
 	// Logging configures the built-in logging policy.
 	Logging LogOptions
 
diff --git a/sdk/azcore/runtime/poller.go b/sdk/azcore/runtime/poller.go
index dc6fc79374..daf866fd07 100644
--- a/sdk/azcore/runtime/poller.go
+++ b/sdk/azcore/runtime/poller.go
@@ -21,23 +21,55 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/internal/log"
 )
 
+// FinalStateVia is the enumerated type for the possible final-state-via values.
+type FinalStateVia = pollers.FinalStateVia
+
+const (
+	// FinalStateViaAzureAsyncOp indicates the final payload comes from the Azure-AsyncOperation URL.
+	FinalStateViaAzureAsyncOp = pollers.FinalStateViaAzureAsyncOp
+
+	// FinalStateViaLocation indicates the final payload comes from the Location URL.
+	FinalStateViaLocation = pollers.FinalStateViaLocation
+
+	// FinalStateViaOriginalURI indicates the final payload comes from the original URL.
+	FinalStateViaOriginalURI = pollers.FinalStateViaOriginalURI
+
+	// FinalStateViaOpLocation indicates the final payload comes from the Operation-Location URL.
+	FinalStateViaOpLocation = pollers.FinalStateViaOpLocation
+)
+
+// NewPollerOptions contains the optional parameters for NewPoller.
+type NewPollerOptions[T any] struct {
+	// FinalStateVia contains the final-state-via value for the LRO.
+	FinalStateVia FinalStateVia
+
+	// Response contains a preconstructed response type.
+	// The final payload will be unmarshaled into it and returned.
+	Response *T
+}
+
 // NewPoller creates a Poller based on the provided initial response.
-// pollerID - a unique identifier for an LRO, it's usually the client.Method string.
-func NewPoller[T any](pollerID string, resp *http.Response, pl pipeline.Pipeline, rt *T) (*Poller[T], error) {
+func NewPoller[T any](resp *http.Response, pl pipeline.Pipeline, options *NewPollerOptions[T]) (*Poller[T], error) {
+	if options == nil {
+		options = &NewPollerOptions[T]{}
+	}
 	defer resp.Body.Close()
 	// this is a back-stop in case the swagger is incorrect (i.e. missing one or more status codes for success).
 	// ideally the codegen should return an error if the initial response failed and not even create a poller.
 	if !pollers.StatusCodeValid(resp) {
 		return nil, errors.New("the operation failed or was cancelled")
 	}
+	tName, err := pollers.PollerTypeName[T]()
+	if err != nil {
+		return nil, err
+	}
 	// determine the polling method
 	var lro pollers.Operation
-	var err error
 	// op poller must be checked first as it can also have a location header
 	if op.Applicable(resp) {
-		lro, err = op.New(resp, pollerID)
+		lro, err = op.New(resp, options.FinalStateVia, tName)
 	} else if loc.Applicable(resp) {
-		lro, err = loc.New(resp, pollerID)
+		lro, err = loc.New(resp, options.FinalStateVia, tName)
 	} else {
 		lro = &pollers.NopPoller{}
 	}
@@ -46,14 +78,27 @@ func NewPoller[T any](pollerID string, resp *http.Response, pl pipeline.Pipeline
 	}
 	return &Poller[T]{
 		pt: pollers.NewPoller(lro, resp, pl),
-		rt: rt,
+		rt: options.Response,
 	}, nil
 }
 
+// NewPollerFromResumeTokenOptions contains the optional parameters for NewPollerFromResumeToken.
+type NewPollerFromResumeTokenOptions[T any] struct {
+	// Response contains a preconstructed response type.
+	// The final payload will be unmarshaled into it and returned.
+	Response *T
+}
+
 // NewPollerFromResumeToken creates a Poller from a resume token string.
-// pollerID - a unique identifier for an LRO, it's usually the client.Method string.
-func NewPollerFromResumeToken[T any](pollerID string, token string, pl pipeline.Pipeline, rt *T) (*Poller[T], error) {
-	kind, err := pollers.KindFromToken(pollerID, token)
+func NewPollerFromResumeToken[T any](token string, pl pipeline.Pipeline, options *NewPollerFromResumeTokenOptions[T]) (*Poller[T], error) {
+	if options == nil {
+		options = &NewPollerFromResumeTokenOptions[T]{}
+	}
+	tName, err := pollers.PollerTypeName[T]()
+	if err != nil {
+		return nil, err
+	}
+	kind, err := pollers.KindFromToken(tName, token)
 	if err != nil {
 		return nil, err
 	}
@@ -74,7 +119,7 @@ func NewPollerFromResumeToken[T any](pollerID string, token string, pl pipeline.
 	}
 	return &Poller[T]{
 		pt: pollers.NewPoller(lro, nil, pl),
-		rt: rt,
+		rt: options.Response,
 	}, nil
 }
 
diff --git a/sdk/internal/CHANGELOG.md b/sdk/internal/CHANGELOG.md
index 097093b75c..7037ab1c6d 100644
--- a/sdk/internal/CHANGELOG.md
+++ b/sdk/internal/CHANGELOG.md
@@ -1,9 +1,8 @@
 # Release History
 
-## 0.9.2 (Unreleased)
+## 0.9.3 (Unreleased)
 
 ### Features Added
-* Set sanitizers at the test level by specifying `RecordingOptions.TestInstance`
 
 ### Breaking Changes
 
@@ -11,6 +10,12 @@
 
 ### Other Changes
 
+## 0.9.2 (2022-04-04)
+
+### Features Added
+* Set sanitizers at the test level by specifying `RecordingOptions.TestInstance`
+* Added the `perf` library for performance testing client SDKs
+
 ## 0.9.1 (2022-02-01)
 
 ### Features Added
diff --git a/sdk/internal/version.go b/sdk/internal/version.go
index 66ac40dd3b..c6e912f390 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.2"
+	Version = "v0.9.3"
 )
diff --git a/sdk/keyvault/internal/CHANGELOG.md b/sdk/keyvault/internal/CHANGELOG.md
index 5ce15f6480..4521d0eee9 100644
--- a/sdk/keyvault/internal/CHANGELOG.md
+++ b/sdk/keyvault/internal/CHANGELOG.md
@@ -1,14 +1,12 @@
 # Release History
 
-## 0.2.2 (Unreleased)
+## 0.3.0 (2022-04-04)
 
 ### Features Added
+* Adds the `ParseKeyvaultID` function to parse an ID into the Key Vault URL, item name, and item version
 
 ### Breaking Changes
-
-### Bugs Fixed
-
-### Other Changes
+* Updates to azcore v0.23.0
 
 ## 0.2.1 (2022-01-31)
 
diff --git a/sdk/keyvault/internal/challenge_policy.go b/sdk/keyvault/internal/challenge_policy.go
index bba3b7be9a..adb26ac0cf 100644
--- a/sdk/keyvault/internal/challenge_policy.go
+++ b/sdk/keyvault/internal/challenge_policy.go
@@ -1,5 +1,5 @@
-//go:build go1.16
-// +build go1.16
+//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.
@@ -125,7 +125,7 @@ func (k *KeyVaultChallengePolicy) Do(req *policy.Request) (*http.Response, error
 // https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000
 func parseTenant(url string) *string {
 	if url == "" {
-		return to.StringPtr("")
+		return to.Ptr("")
 	}
 	parts := strings.Split(url, "/")
 	tenant := parts[3]
diff --git a/sdk/keyvault/internal/constants.go b/sdk/keyvault/internal/constants.go
index 58186e5d52..4ab031fa57 100644
--- a/sdk/keyvault/internal/constants.go
+++ b/sdk/keyvault/internal/constants.go
@@ -1,5 +1,5 @@
-//go:build go1.16
-// +build go1.16
+//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.
@@ -7,5 +7,5 @@
 package internal
 
 const (
-	version = "v0.2.2" //nolint
+	version = "v0.3.0" //nolint
 )
diff --git a/sdk/keyvault/internal/doc.go b/sdk/keyvault/internal/doc.go
index 4cde2d2bc1..d8f93492f5 100644
--- a/sdk/keyvault/internal/doc.go
+++ b/sdk/keyvault/internal/doc.go
@@ -1,5 +1,5 @@
-//go:build go1.16
-// +build go1.16
+//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.
diff --git a/sdk/keyvault/internal/expiring_resource.go b/sdk/keyvault/internal/expiring_resource.go
index 93a2ff6ccf..2567b73e4f 100644
--- a/sdk/keyvault/internal/expiring_resource.go
+++ b/sdk/keyvault/internal/expiring_resource.go
@@ -1,5 +1,5 @@
-//go:build go1.16
-// +build go1.16
+//go:build go1.18
+// +build go1.18
 
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
diff --git a/sdk/keyvault/internal/go.mod b/sdk/keyvault/internal/go.mod
index c413a643ea..77828f5db6 100644
--- a/sdk/keyvault/internal/go.mod
+++ b/sdk/keyvault/internal/go.mod
@@ -1,9 +1,17 @@
 module github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal
 
-go 1.16
+go 1.18
 
 require (
-	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0
-	github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1
+	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0
+	github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2
 	github.com/stretchr/testify v1.7.0
 )
+
+require (
+	github.com/davecgh/go-spew v1.1.0 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect
+	golang.org/x/text v0.3.6 // indirect
+	gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
+)
diff --git a/sdk/keyvault/internal/go.sum b/sdk/keyvault/internal/go.sum
index 15eb8261ea..ce7f432a8a 100644
--- a/sdk/keyvault/internal/go.sum
+++ b/sdk/keyvault/internal/go.sum
@@ -1,7 +1,7 @@
-github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0=
-github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc=
-github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
+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/internal v0.9.2 h1:Px2KVERcYEg2Lv25AqC2hVr0xUWaq94wuEObLIkYzmA=
+github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2/go.mod h1:CdSJQNNzZhCkwDaV27XV1w48ZBPtxe7mlrZAsPNxD5g=
 github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
@@ -20,9 +20,6 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/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-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 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.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
diff --git a/sdk/keyvault/internal/parse.go b/sdk/keyvault/internal/parse.go
new file mode 100644
index 0000000000..a46b25b7ae
--- /dev/null
+++ b/sdk/keyvault/internal/parse.go
@@ -0,0 +1,37 @@
+//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.
+package internal
+
+import (
+	"fmt"
+	"net/url"
+	"strings"
+
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+)
+
+// ParseID parses "https://myvaultname.vault.azure.net/keys/key1053998307/b86c2e6ad9054f4abf69cc185b99aa60"
+// into "https://myvaultname.managedhsm.azure.net/", "key1053998307", and "b86c2e6ad9054f4abf69cc185b99aa60"
+func ParseID(id *string) (*string, *string, *string) {
+	if id == nil {
+		return nil, nil, nil
+	}
+	parsed, err := url.Parse(*id)
+	if err != nil {
+		return nil, nil, nil
+	}
+
+	url := fmt.Sprintf("%s://%s/", parsed.Scheme, parsed.Host)
+	split := strings.Split(strings.TrimPrefix(parsed.Path, "/"), "/")
+	if len(split) < 3 {
+		if len(split) == 2 {
+			return &url, to.Ptr(split[1]), nil
+		}
+		return &url, nil, nil
+	}
+
+	return &url, to.Ptr(split[1]), to.Ptr(split[2])
+}
diff --git a/sdk/messaging/azservicebus/CHANGELOG.md b/sdk/messaging/azservicebus/CHANGELOG.md
index 0784779364..a34b2ec9d7 100644
--- a/sdk/messaging/azservicebus/CHANGELOG.md
+++ b/sdk/messaging/azservicebus/CHANGELOG.md
@@ -13,6 +13,7 @@
 - Fixed the RPCLink so it does better handling of connection/link failures. (#17389)
 - Fixed issue where a message lock expiring would cause unnecessary retries. These retries could cause message settlement calls (ex: Receiver.CompleteMessage) 
   to appear to hang. (#17382)
+- Fixed issue where a cancellation on ReceiveMessages() would work, but wouldn't return the proper cancellation error. (#17422)
 
 ## 0.3.6 (2022-03-08)
 
diff --git a/sdk/messaging/azservicebus/go.mod b/sdk/messaging/azservicebus/go.mod
index eac3e0940b..b6f1853f88 100644
--- a/sdk/messaging/azservicebus/go.mod
+++ b/sdk/messaging/azservicebus/go.mod
@@ -6,7 +6,7 @@ require (
 	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0
 	github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0
 	github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3
-	github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.0.0-20220314210312-9302dcfe9a45
+	github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.1.0
 	github.com/Azure/go-amqp v0.17.4
 	github.com/devigned/tab v0.1.1
 	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
diff --git a/sdk/messaging/azservicebus/go.sum b/sdk/messaging/azservicebus/go.sum
index 01b3d235ee..aaf4817c7d 100644
--- a/sdk/messaging/azservicebus/go.sum
+++ b/sdk/messaging/azservicebus/go.sum
@@ -7,8 +7,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D
 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.2/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk=
 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
-github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.0.0-20220314210312-9302dcfe9a45 h1:2iK++BgVHH5TR4I3zeVmikeiAxE/C/gisBNxMlv1UBw=
-github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.0.0-20220314210312-9302dcfe9a45/go.mod h1:7hMUlcqiMXDUJtU1EWQlhhkC4BfIr6pEsiyuRYq4xLQ=
+github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.1.0 h1:mvQhIGmKI3vmdNDUMG0ZHaZ1p+JcHE3m0q1RMOyKxRo=
+github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.1.0/go.mod h1:7hMUlcqiMXDUJtU1EWQlhhkC4BfIr6pEsiyuRYq4xLQ=
 github.com/Azure/go-amqp v0.17.0/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg=
 github.com/Azure/go-amqp v0.17.4 h1:6t9wEiwA4uXMRoUj3Cd3K2gmH8cW8ylizmBnSeF0bzM=
 github.com/Azure/go-amqp v0.17.4/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg=
diff --git a/sdk/messaging/azservicebus/receiver.go b/sdk/messaging/azservicebus/receiver.go
index 199c3bbe2d..9403cd6dbf 100644
--- a/sdk/messaging/azservicebus/receiver.go
+++ b/sdk/messaging/azservicebus/receiver.go
@@ -371,7 +371,7 @@ func (r *Receiver) receiveMessagesImpl(ctx context.Context, maxMessages int, opt
 		return nil, err
 	}
 
-	flushAndReturn := func(err error) ([]*ReceivedMessage, error) {
+	cleanup := func(err error) {
 		if err != nil {
 			if internal.IsCancelError(err) {
 				// if the user cancelled any of the "cleanup" operations then the link
@@ -384,20 +384,19 @@ func (r *Receiver) receiveMessagesImpl(ctx context.Context, maxMessages int, opt
 				_ = r.amqpLinks.CloseIfNeeded(context.Background(), err)
 			}
 		}
+	}
 
-		// in receiveAndDelete messages are assumed to deleted by the service "spontaneously", which means
-		// they can't be received again once we've gotten them here. So, unlike peekLock mode above, we
-		// make sure we flush any messages that we might be holding onto, even on error.
+	flushAndReturn := func(lastErr error) ([]*ReceivedMessage, error) {
 		flushPrefetchedMessages(ctx, linksWithID.Receiver, &all)
 
 		if len(all) > 0 {
 			// users don't typically check the other values in the return if the 'err' is non-nil
-			// so if we have any results we'll just return them and get rid of the error.
+			// so if we have any messages we'll just return them and nil out the error.
 			// If it's persistent they'll see it on their next ReceiveMessages() call.
 			return all, nil
 		} else {
-			if internal.GetRecoveryKind(err) == internal.RecoveryKindFatal {
-				return nil, err
+			if internal.GetRecoveryKind(lastErr) == internal.RecoveryKindFatal {
+				return nil, lastErr
 			}
 
 			// there's no material difference here, so let them fail on the next call to ReceiveMessages() instead.
@@ -406,28 +405,39 @@ func (r *Receiver) receiveMessagesImpl(ctx context.Context, maxMessages int, opt
 	}
 
 	if err := fetchMessages(ctx, linksWithID.Receiver, maxMessages, r.defaultTimeAfterFirstMsg, &all); err != nil {
-		// if the user's cancelled the fetch, we should clean up the link by draining it.
+		// if the user's cancelled the fetch we'll fall through and let the drain happen.
 		if !internal.IsCancelError(err) {
-			// link is dead so we'll just skip draining altogether.
+			// If the user didn't cancel then we had an actual failure that's going to require a
+			// link/connection reset. Close links and return whatever we can.
+			cleanup(err)
 			return flushAndReturn(err)
 		}
+
+		// user cancelled, fall through so we drain the link since it's still active.
 	}
 
 	if len(all) < maxMessages { // drain if there are excess credits
-		// NOTE: there is a very intermittent issue where the drain frame doesn't seem to come back. Still investigating
-		// but it's best to not leave their program in a completely hung state during this time.
-		ctx, cancel := context.WithTimeout(context.Background(), r.defaultDrainTimeout)
-		defer cancel()
+		drainCtx, drainCtxcancel := context.WithTimeout(context.Background(), r.defaultDrainTimeout)
+		defer drainCtxcancel()
 
-		// start the drain asynchronously. Note that we ignore the user's context at this point
+		// Start the drain asynchronously. Note that we ignore the user's context at this point
 		// since draining makes sure we don't get messages when nobody is receiving.
-		if err := linksWithID.Receiver.DrainCredit(ctx); err != nil {
-			// note that cancelling a DrainCredit means we're in an indeterminate state
+		if err := linksWithID.Receiver.DrainCredit(drainCtx); err != nil {
+			// Cancelling a DrainCredit means we're in an indeterminate state
 			// so we treat that as a "must recover" error.
+			cleanup(err)
+
+			if internal.IsCancelError(err) {
+				// this cancellation is entirely on us - we cleaned up as best we can
+				// but the user isn't expected to know about this detail so we don't
+				// return the cancellation error.
+				err = nil
+			}
+
 			return flushAndReturn(err)
 		}
 
-		return flushAndReturn(nil)
+		return flushAndReturn(ctx.Err())
 	}
 
 	// we only get here if we got exactly the # of messages they asked for
@@ -464,12 +474,9 @@ func fetchMessages(ctx context.Context, receiver internal.AMQPReceiver, maxMessa
 	}
 }
 
-// flushPrefetchedMessages makes a best-effort attempt at draining any messages on the link. If the link is dead,
-// or times out when draining we will close it quickly. The next operation on the link will
-// recover it.
+// flushPrefetchedMessages makes a best-effort attempt at flushing the internal channel for the link. This is
+// a purely in-memory operation so should work even if the link itself has failed.
 func flushPrefetchedMessages(ctx context.Context, receiver internal.AMQPReceiver, messages *[]*ReceivedMessage) {
-	// Draining data from the receiver's prefetched queue. This won't wait for new messages to
-	// arrive, so it'll only receive messages that arrived prior to the drain.
 	for {
 		am, err := receiver.Prefetched(ctx)
 
diff --git a/sdk/messaging/internal/CHANGELOG.md b/sdk/messaging/internal/CHANGELOG.md
index 443dcc2ed9..6e0233ef1b 100644
--- a/sdk/messaging/internal/CHANGELOG.md
+++ b/sdk/messaging/internal/CHANGELOG.md
@@ -1,5 +1,15 @@
 # Release History
 
+## 0.1.1 (Unreleased)
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
+
 ## 0.1.0 (2022-03-29)
 
 - Internal package, only for support of azservicebus.
diff --git a/sdk/messaging/internal/version.go b/sdk/messaging/internal/version.go
index b3725a292b..af7349770a 100644
--- a/sdk/messaging/internal/version.go
+++ b/sdk/messaging/internal/version.go
@@ -4,5 +4,5 @@ package internal
 
 const (
 	// Version is the semantic version of the library
-	Version = "v0.1.0"
+	Version = "v0.1.1"
 )
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/CHANGELOG.md b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/CHANGELOG.md
index 26285ed5a4..51d024d9e6 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/CHANGELOG.md
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/CHANGELOG.md
@@ -1,5 +1,29 @@
 # Release History
 
+## 0.2.0 (2022-03-30)
+### Breaking Changes
+
+- Const `ConfigurationStateIncomplete` has been removed
+- Const `ConfigurationStateComplete` has been removed
+- Function `PossibleConfigurationStateValues` has been removed
+- Function `ConfigurationState.ToPtr` has been removed
+- Field `ConfigurationState` of struct `SimPropertiesFormat` has been removed
+
+### Features Added
+
+- New const `SimStateEnabled`
+- New const `SimStateInvalid`
+- New const `SimStateDisabled`
+- New function `PossibleSimStateValues() []SimState`
+- New function `SimState.ToPtr() *SimState`
+- New field `SimState` in struct `SimPropertiesFormat`
+- New field `SystemData` in struct `Resource`
+- New field `IPv4Address` in struct `InterfaceProperties`
+- New field `IPv4Gateway` in struct `InterfaceProperties`
+- New field `IPv4Subnet` in struct `InterfaceProperties`
+- New field `SystemData` in struct `TrackedResource`
+
+
 ## 0.1.0 (2022-02-28)
 
 - Init release.
\ No newline at end of file
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/autorest.md b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/autorest.md
index 58f6ba707d..392588abe3 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/autorest.md
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/autorest.md
@@ -5,9 +5,9 @@
 ``` yaml
 azure-arm: true
 require:
-- https://github.com/Azure/azure-rest-api-specs/blob/49af362e33d89967d7776fdd3a26d5462c9fbb59/specification/mobilenetwork/resource-manager/readme.md
-- https://github.com/Azure/azure-rest-api-specs/blob/49af362e33d89967d7776fdd3a26d5462c9fbb59/specification/mobilenetwork/resource-manager/readme.go.md
+- https://github.com/Azure/azure-rest-api-specs/blob/50d804bd9e656d0bbd873f1e2ab79b3cee33825c/specification/mobilenetwork/resource-manager/readme.md
+- https://github.com/Azure/azure-rest-api-specs/blob/50d804bd9e656d0bbd873f1e2ab79b3cee33825c/specification/mobilenetwork/resource-manager/readme.go.md
 license-header: MICROSOFT_MIT_NO_VERSION
-module-version: 0.1.0
+module-version: 0.2.0
 
 ```
\ No newline at end of file
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.mod b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.mod
index 462a3fbab8..483ba3991e 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.mod
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.mod
@@ -4,5 +4,5 @@ go 1.16
 
 require (
 	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0
-	github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1
+	github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.2
 )
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.sum b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.sum
index 27c9bd79d5..cdae84f012 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.sum
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/go.sum
@@ -1,7 +1,7 @@
 github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ=
 github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1 h1:RxemzI2cHD0A8WyMqHu/UnDjfpGES/cmjtPbQoktWqs=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1/go.mod h1:+nVKciyKD2J9TyVcEQ82Bo9b+3F92PiQfHrIE/zqLqM=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.2 h1:mM/yraAumqMMIYev6zX0oxHqX6hreUs5wXf76W47r38=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.2/go.mod h1:+nVKciyKD2J9TyVcEQ82Bo9b+3F92PiQfHrIE/zqLqM=
 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
 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=
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_attacheddatanetworks_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_attacheddatanetworks_client.go
index c46d1c1bda..994d060cad 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_attacheddatanetworks_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_attacheddatanetworks_client.go
@@ -96,6 +96,10 @@ func (client *AttachedDataNetworksClient) createOrUpdate(ctx context.Context, re
 // createOrUpdateCreateRequest creates the CreateOrUpdate request.
 func (client *AttachedDataNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, attachedDataNetworkName string, parameters AttachedDataNetwork, options *AttachedDataNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
 	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}"
+	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")
 	}
@@ -112,16 +116,12 @@ func (client *AttachedDataNetworksClient) createOrUpdateCreateRequest(ctx contex
 		return nil, errors.New("parameter attachedDataNetworkName cannot be empty")
 	}
 	urlPath = strings.ReplaceAll(urlPath, "{attachedDataNetworkName}", url.PathEscape(attachedDataNetworkName))
-	if client.subscriptionID == "" {
-		return nil, errors.New("parameter client.subscriptionID cannot be empty")
-	}
-	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
 	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath))
 	if err != nil {
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -173,6 +173,10 @@ func (client *AttachedDataNetworksClient) deleteOperation(ctx context.Context, r
 // deleteCreateRequest creates the Delete request.
 func (client *AttachedDataNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, attachedDataNetworkName string, options *AttachedDataNetworksClientBeginDeleteOptions) (*policy.Request, error) {
 	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}"
+	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")
 	}
@@ -189,16 +193,12 @@ func (client *AttachedDataNetworksClient) deleteCreateRequest(ctx context.Contex
 		return nil, errors.New("parameter attachedDataNetworkName cannot be empty")
 	}
 	urlPath = strings.ReplaceAll(urlPath, "{attachedDataNetworkName}", url.PathEscape(attachedDataNetworkName))
-	if client.subscriptionID == "" {
-		return nil, errors.New("parameter client.subscriptionID cannot be empty")
-	}
-	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
 	req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath))
 	if err != nil {
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -230,6 +230,10 @@ func (client *AttachedDataNetworksClient) Get(ctx context.Context, resourceGroup
 // getCreateRequest creates the Get request.
 func (client *AttachedDataNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, attachedDataNetworkName string, options *AttachedDataNetworksClientGetOptions) (*policy.Request, error) {
 	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}"
+	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")
 	}
@@ -246,16 +250,12 @@ func (client *AttachedDataNetworksClient) getCreateRequest(ctx context.Context,
 		return nil, errors.New("parameter attachedDataNetworkName cannot be empty")
 	}
 	urlPath = strings.ReplaceAll(urlPath, "{attachedDataNetworkName}", url.PathEscape(attachedDataNetworkName))
-	if client.subscriptionID == "" {
-		return nil, errors.New("parameter client.subscriptionID cannot be empty")
-	}
-	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
 	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-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -292,6 +292,10 @@ func (client *AttachedDataNetworksClient) ListByPacketCoreDataPlane(resourceGrou
 // listByPacketCoreDataPlaneCreateRequest creates the ListByPacketCoreDataPlane request.
 func (client *AttachedDataNetworksClient) listByPacketCoreDataPlaneCreateRequest(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, options *AttachedDataNetworksClientListByPacketCoreDataPlaneOptions) (*policy.Request, error) {
 	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks"
+	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")
 	}
@@ -304,16 +308,12 @@ func (client *AttachedDataNetworksClient) listByPacketCoreDataPlaneCreateRequest
 		return nil, errors.New("parameter packetCoreDataPlaneName cannot be empty")
 	}
 	urlPath = strings.ReplaceAll(urlPath, "{packetCoreDataPlaneName}", url.PathEscape(packetCoreDataPlaneName))
-	if client.subscriptionID == "" {
-		return nil, errors.New("parameter client.subscriptionID cannot be empty")
-	}
-	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
 	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-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -355,6 +355,10 @@ func (client *AttachedDataNetworksClient) UpdateTags(ctx context.Context, resour
 // updateTagsCreateRequest creates the UpdateTags request.
 func (client *AttachedDataNetworksClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, packetCoreControlPlaneName string, packetCoreDataPlaneName string, attachedDataNetworkName string, parameters TagsObject, options *AttachedDataNetworksClientUpdateTagsOptions) (*policy.Request, error) {
 	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}"
+	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")
 	}
@@ -371,16 +375,12 @@ func (client *AttachedDataNetworksClient) updateTagsCreateRequest(ctx context.Co
 		return nil, errors.New("parameter attachedDataNetworkName cannot be empty")
 	}
 	urlPath = strings.ReplaceAll(urlPath, "{attachedDataNetworkName}", url.PathEscape(attachedDataNetworkName))
-	if client.subscriptionID == "" {
-		return nil, errors.New("parameter client.subscriptionID cannot be empty")
-	}
-	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
 	req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath))
 	if err != nil {
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_constants.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_constants.go
index 735d2f9a53..e5b101de7c 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_constants.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_constants.go
@@ -10,35 +10,16 @@ package armmobilenetwork
 
 const (
 	moduleName    = "armmobilenetwork"
-	moduleVersion = "v0.1.0"
+	moduleVersion = "v0.2.0"
 )
 
-// ConfigurationState - The configuration state of the resource - complete or incomplete.
-type ConfigurationState string
-
-const (
-	ConfigurationStateComplete   ConfigurationState = "Complete"
-	ConfigurationStateIncomplete ConfigurationState = "Incomplete"
-)
-
-// PossibleConfigurationStateValues returns the possible values for the ConfigurationState const type.
-func PossibleConfigurationStateValues() []ConfigurationState {
-	return []ConfigurationState{
-		ConfigurationStateComplete,
-		ConfigurationStateIncomplete,
-	}
-}
-
-// ToPtr returns a *ConfigurationState pointing to the current value.
-func (c ConfigurationState) ToPtr() *ConfigurationState {
-	return &c
-}
-
 // CoreNetworkType - Core network type.
 type CoreNetworkType string
 
 const (
-	CoreNetworkTypeEPC    CoreNetworkType = "EPC"
+	// CoreNetworkTypeEPC - EPC / 4G core
+	CoreNetworkTypeEPC CoreNetworkType = "EPC"
+	// CoreNetworkTypeFiveGC - 5G core
 	CoreNetworkTypeFiveGC CoreNetworkType = "5GC"
 )
 
@@ -84,8 +65,10 @@ func (c CreatedByType) ToPtr() *CreatedByType {
 type NaptEnabled string
 
 const (
+	// NaptEnabledDisabled - NAPT is disabled
 	NaptEnabledDisabled NaptEnabled = "Disabled"
-	NaptEnabledEnabled  NaptEnabled = "Enabled"
+	// NaptEnabledEnabled - NAPT is enabled
+	NaptEnabledEnabled NaptEnabled = "Enabled"
 )
 
 // PossibleNaptEnabledValues returns the possible values for the NaptEnabled const type.
@@ -126,7 +109,9 @@ func (c PduSessionType) ToPtr() *PduSessionType {
 type PreemptionCapability string
 
 const (
+	// PreemptionCapabilityMayPreempt - May preempt
 	PreemptionCapabilityMayPreempt PreemptionCapability = "MayPreempt"
+	// PreemptionCapabilityNotPreempt - Cannot preempt
 	PreemptionCapabilityNotPreempt PreemptionCapability = "NotPreempt"
 )
 
@@ -147,8 +132,10 @@ func (c PreemptionCapability) ToPtr() *PreemptionCapability {
 type PreemptionVulnerability string
 
 const (
+	// PreemptionVulnerabilityNotPreemptable - Cannot be preempted
 	PreemptionVulnerabilityNotPreemptable PreemptionVulnerability = "NotPreemptable"
-	PreemptionVulnerabilityPreemptable    PreemptionVulnerability = "Preemptable"
+	// PreemptionVulnerabilityPreemptable - May be preempted
+	PreemptionVulnerabilityPreemptable PreemptionVulnerability = "Preemptable"
 )
 
 // PossiblePreemptionVulnerabilityValues returns the possible values for the PreemptionVulnerability const type.
@@ -199,9 +186,12 @@ func (c ProvisioningState) ToPtr() *ProvisioningState {
 type SdfDirection string
 
 const (
+	// SdfDirectionBidirectional - Traffic flowing both to and from the UE.
 	SdfDirectionBidirectional SdfDirection = "Bidirectional"
-	SdfDirectionDownlink      SdfDirection = "Downlink"
-	SdfDirectionUplink        SdfDirection = "Uplink"
+	// SdfDirectionDownlink - Traffic flowing from the data network to the UE.
+	SdfDirectionDownlink SdfDirection = "Downlink"
+	// SdfDirectionUplink - Traffic flowing from the UE to the data network.
+	SdfDirectionUplink SdfDirection = "Uplink"
 )
 
 // PossibleSdfDirectionValues returns the possible values for the SdfDirection const type.
@@ -218,11 +208,39 @@ func (c SdfDirection) ToPtr() *SdfDirection {
 	return &c
 }
 
+// SimState - The state of the sim resource.
+type SimState string
+
+const (
+	// SimStateDisabled - The sim is disabled because not all configuration required for enabling is present.
+	SimStateDisabled SimState = "Disabled"
+	// SimStateEnabled - The sim is enabled.
+	SimStateEnabled SimState = "Enabled"
+	// SimStateInvalid - The sim cannot be enabled because some of the associated configuration is invalid.
+	SimStateInvalid SimState = "Invalid"
+)
+
+// PossibleSimStateValues returns the possible values for the SimState const type.
+func PossibleSimStateValues() []SimState {
+	return []SimState{
+		SimStateDisabled,
+		SimStateEnabled,
+		SimStateInvalid,
+	}
+}
+
+// ToPtr returns a *SimState pointing to the current value.
+func (c SimState) ToPtr() *SimState {
+	return &c
+}
+
 // TrafficControlPermission - Traffic control permission.
 type TrafficControlPermission string
 
 const (
+	// TrafficControlPermissionBlocked - Traffic matching this rule is not allowed to flow.
 	TrafficControlPermissionBlocked TrafficControlPermission = "Blocked"
+	// TrafficControlPermissionEnabled - Traffic matching this rule is allowed to flow.
 	TrafficControlPermissionEnabled TrafficControlPermission = "Enabled"
 )
 
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_datanetworks_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_datanetworks_client.go
index 54686881eb..a0deae654a 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_datanetworks_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_datanetworks_client.go
@@ -116,7 +116,7 @@ func (client *DataNetworksClient) createOrUpdateCreateRequest(ctx context.Contex
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -188,7 +188,7 @@ func (client *DataNetworksClient) deleteCreateRequest(ctx context.Context, resou
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -239,7 +239,7 @@ func (client *DataNetworksClient) getCreateRequest(ctx context.Context, resource
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -292,7 +292,7 @@ func (client *DataNetworksClient) listByMobileNetworkCreateRequest(ctx context.C
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -353,7 +353,7 @@ func (client *DataNetworksClient) updateTagsCreateRequest(ctx context.Context, r
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_mobilenetworks_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_mobilenetworks_client.go
index 76fe6f6b1c..d3e1247a06 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_mobilenetworks_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_mobilenetworks_client.go
@@ -111,7 +111,7 @@ func (client *MobileNetworksClient) createOrUpdateCreateRequest(ctx context.Cont
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -178,7 +178,7 @@ func (client *MobileNetworksClient) deleteCreateRequest(ctx context.Context, res
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -224,7 +224,7 @@ func (client *MobileNetworksClient) getCreateRequest(ctx context.Context, resour
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -272,7 +272,7 @@ func (client *MobileNetworksClient) listByResourceGroupCreateRequest(ctx context
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -315,7 +315,7 @@ func (client *MobileNetworksClient) listBySubscriptionCreateRequest(ctx context.
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -391,7 +391,7 @@ func (client *MobileNetworksClient) listSimIDsCreateRequest(ctx context.Context,
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -439,7 +439,7 @@ func (client *MobileNetworksClient) updateTagsCreateRequest(ctx context.Context,
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models.go
index 4594e5965d..9004de072a 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_models.go
@@ -41,7 +41,7 @@ type AttachedDataNetwork struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -172,7 +172,7 @@ type DataNetwork struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -314,6 +314,15 @@ type InterfaceProperties struct {
 	// REQUIRED; The logical name for this interface. This should match one of the interfaces configured on your Azure Stack Edge
 	// machine.
 	Name *string `json:"name,omitempty"`
+
+	// The IPv4 address.
+	IPv4Address *string `json:"ipv4Address,omitempty"`
+
+	// The default IPv4 gateway (router).
+	IPv4Gateway *string `json:"ipv4Gateway,omitempty"`
+
+	// The IPv4 subnet.
+	IPv4Subnet *string `json:"ipv4Subnet,omitempty"`
 }
 
 // ListResult - Response for mobile networks API service call.
@@ -350,7 +359,7 @@ type MobileNetwork struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -496,7 +505,7 @@ type PacketCoreControlPlane struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -607,7 +616,7 @@ type PacketCoreDataPlane struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -844,6 +853,9 @@ type Resource struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+	SystemData *SystemData `json:"systemData,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"`
 }
@@ -871,7 +883,7 @@ type Service struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -1025,7 +1037,7 @@ type Sim struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -1123,7 +1135,7 @@ type SimPolicy struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -1231,18 +1243,17 @@ type SimPropertiesFormat struct {
 	// data network, slice}.
 	StaticIPConfiguration []*SimStaticIPProperties `json:"staticIpConfiguration,omitempty"`
 
-	// READ-ONLY; The configuration state of the sim resource - complete or incomplete.
-	ConfigurationState *ConfigurationState `json:"configurationState,omitempty" azure:"ro"`
-
 	// READ-ONLY; The provisioning state of the sim resource.
 	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"`
+
+	// READ-ONLY; The state of the sim resource.
+	SimState *SimState `json:"simState,omitempty" azure:"ro"`
 }
 
 // MarshalJSON implements the json.Marshaller interface for type SimPropertiesFormat.
 func (s SimPropertiesFormat) MarshalJSON() ([]byte, error) {
 	objectMap := make(map[string]interface{})
 	populate(objectMap, "authenticationKey", s.AuthenticationKey)
-	populate(objectMap, "configurationState", s.ConfigurationState)
 	populate(objectMap, "deviceType", s.DeviceType)
 	populate(objectMap, "integratedCircuitCardIdentifier", s.IntegratedCircuitCardIdentifier)
 	populate(objectMap, "internationalMobileSubscriberIdentity", s.InternationalMobileSubscriberIdentity)
@@ -1250,6 +1261,7 @@ func (s SimPropertiesFormat) MarshalJSON() ([]byte, error) {
 	populate(objectMap, "operatorKeyCode", s.OperatorKeyCode)
 	populate(objectMap, "provisioningState", s.ProvisioningState)
 	populate(objectMap, "simPolicy", s.SimPolicy)
+	populate(objectMap, "simState", s.SimState)
 	populate(objectMap, "staticIpConfiguration", s.StaticIPConfiguration)
 	return json.Marshal(objectMap)
 }
@@ -1322,7 +1334,7 @@ type Site struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -1418,7 +1430,7 @@ type Slice struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
-	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
 	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`
 
 	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
@@ -1632,6 +1644,9 @@ type TrackedResource struct {
 	// READ-ONLY; The name of the resource
 	Name *string `json:"name,omitempty" azure:"ro"`
 
+	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
+	SystemData *SystemData `json:"systemData,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"`
 }
@@ -1642,6 +1657,7 @@ func (t TrackedResource) MarshalJSON() ([]byte, error) {
 	populate(objectMap, "id", t.ID)
 	populate(objectMap, "location", t.Location)
 	populate(objectMap, "name", t.Name)
+	populate(objectMap, "systemData", t.SystemData)
 	populate(objectMap, "tags", t.Tags)
 	populate(objectMap, "type", t.Type)
 	return json.Marshal(objectMap)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_operations_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_operations_client.go
index 40f21c4966..a856e41586 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_operations_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_operations_client.go
@@ -66,7 +66,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options *
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcorecontrolplanes_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcorecontrolplanes_client.go
index 0dad4d06b2..5596a12fc8 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcorecontrolplanes_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcorecontrolplanes_client.go
@@ -111,7 +111,7 @@ func (client *PacketCoreControlPlanesClient) createOrUpdateCreateRequest(ctx con
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -178,7 +178,7 @@ func (client *PacketCoreControlPlanesClient) deleteCreateRequest(ctx context.Con
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -225,7 +225,7 @@ func (client *PacketCoreControlPlanesClient) getCreateRequest(ctx context.Contex
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -273,7 +273,7 @@ func (client *PacketCoreControlPlanesClient) listByResourceGroupCreateRequest(ct
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -316,7 +316,7 @@ func (client *PacketCoreControlPlanesClient) listBySubscriptionCreateRequest(ctx
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -373,7 +373,7 @@ func (client *PacketCoreControlPlanesClient) updateTagsCreateRequest(ctx context
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcoredataplanes_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcoredataplanes_client.go
index fdd422d06c..08102fea6d 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcoredataplanes_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_packetcoredataplanes_client.go
@@ -116,7 +116,7 @@ func (client *PacketCoreDataPlanesClient) createOrUpdateCreateRequest(ctx contex
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -188,7 +188,7 @@ func (client *PacketCoreDataPlanesClient) deleteCreateRequest(ctx context.Contex
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -240,7 +240,7 @@ func (client *PacketCoreDataPlanesClient) getCreateRequest(ctx context.Context,
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -293,7 +293,7 @@ func (client *PacketCoreDataPlanesClient) listByPacketCoreControlPlaneCreateRequ
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -355,7 +355,7 @@ func (client *PacketCoreDataPlanesClient) updateTagsCreateRequest(ctx context.Co
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_services_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_services_client.go
index d35b0905c0..61e6c84d40 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_services_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_services_client.go
@@ -116,7 +116,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -187,7 +187,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -238,7 +238,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -291,7 +291,7 @@ func (client *ServicesClient) listByMobileNetworkCreateRequest(ctx context.Conte
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -352,7 +352,7 @@ func (client *ServicesClient) updateTagsCreateRequest(ctx context.Context, resou
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_simpolicies_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_simpolicies_client.go
index 0eb0516938..8cbf2f4511 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_simpolicies_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_simpolicies_client.go
@@ -116,7 +116,7 @@ func (client *SimPoliciesClient) createOrUpdateCreateRequest(ctx context.Context
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -187,7 +187,7 @@ func (client *SimPoliciesClient) deleteCreateRequest(ctx context.Context, resour
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -238,7 +238,7 @@ func (client *SimPoliciesClient) getCreateRequest(ctx context.Context, resourceG
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -291,7 +291,7 @@ func (client *SimPoliciesClient) listByMobileNetworkCreateRequest(ctx context.Co
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -352,7 +352,7 @@ func (client *SimPoliciesClient) updateTagsCreateRequest(ctx context.Context, re
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sims_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sims_client.go
index 693313fd9c..2abdd88d5f 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sims_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sims_client.go
@@ -111,7 +111,7 @@ func (client *SimsClient) createOrUpdateCreateRequest(ctx context.Context, resou
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -177,7 +177,7 @@ func (client *SimsClient) deleteCreateRequest(ctx context.Context, resourceGroup
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -223,7 +223,7 @@ func (client *SimsClient) getCreateRequest(ctx context.Context, resourceGroupNam
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -271,7 +271,7 @@ func (client *SimsClient) listByResourceGroupCreateRequest(ctx context.Context,
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -313,7 +313,7 @@ func (client *SimsClient) listBySubscriptionCreateRequest(ctx context.Context, o
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -369,7 +369,7 @@ func (client *SimsClient) updateTagsCreateRequest(ctx context.Context, resourceG
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sites_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sites_client.go
index 5649d3d882..210ea0c1e6 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sites_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_sites_client.go
@@ -116,7 +116,7 @@ func (client *SitesClient) createOrUpdateCreateRequest(ctx context.Context, reso
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -187,7 +187,7 @@ func (client *SitesClient) deleteCreateRequest(ctx context.Context, resourceGrou
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -238,7 +238,7 @@ func (client *SitesClient) getCreateRequest(ctx context.Context, resourceGroupNa
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -291,7 +291,7 @@ func (client *SitesClient) listByMobileNetworkCreateRequest(ctx context.Context,
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -352,7 +352,7 @@ func (client *SitesClient) updateTagsCreateRequest(ctx context.Context, resource
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_slices_client.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_slices_client.go
index 16973156dc..26fdcfa7f1 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_slices_client.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/zz_generated_slices_client.go
@@ -116,7 +116,7 @@ func (client *SlicesClient) createOrUpdateCreateRequest(ctx context.Context, res
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)
@@ -187,7 +187,7 @@ func (client *SlicesClient) deleteCreateRequest(ctx context.Context, resourceGro
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -238,7 +238,7 @@ func (client *SlicesClient) getCreateRequest(ctx context.Context, resourceGroupN
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -291,7 +291,7 @@ func (client *SlicesClient) listByMobileNetworkCreateRequest(ctx context.Context
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, nil
@@ -352,7 +352,7 @@ func (client *SlicesClient) updateTagsCreateRequest(ctx context.Context, resourc
 		return nil, err
 	}
 	reqQP := req.Raw().URL.Query()
-	reqQP.Set("api-version", "2022-01-01-preview")
+	reqQP.Set("api-version", "2022-03-01-preview")
 	req.Raw().URL.RawQuery = reqQP.Encode()
 	req.Raw().Header.Set("Accept", "application/json")
 	return req, runtime.MarshalAsJSON(req, parameters)


Test patch:
diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1
index 27885c244f..6abeb291cb 100644
--- a/eng/common/TestResources/New-TestResources.ps1
+++ b/eng/common/TestResources/New-TestResources.ps1
@@ -377,7 +377,9 @@ try {
         $BaseName = 't' + (New-Guid).ToString('n').Substring(0, 16)
         Log "Generated base name '$BaseName' for CI build"
     } elseif (!$BaseName) {
-        $BaseName = "$UserName$ServiceDirectory"
+        # Handle service directories in nested directories, e.g. `data/aztables`
+        $serviceDirectorySafeName = $ServiceDirectory -replace '[/\\]', ''
+        $BaseName = "$UserName$serviceDirectorySafeName"
         Log "BaseName was not set. Using default base name '$BaseName'"
     }
 
diff --git a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
index d2deb82c7e..38b7e44429 100644
--- a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
+++ b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
@@ -572,7 +572,7 @@ Describe "Platform Matrix Generation With Object Fields" -Tag "objectfields" {
     }
 }
 
-Describe "Platform Matrix Display Names" -Tag "displaynames" {
+Describe "Platform Matrix Job and Display Names" -Tag "displaynames" {
     BeforeEach {
         $matrixConfigForGenerate = @"
 {
@@ -601,7 +601,6 @@ Describe "Platform Matrix Display Names" -Tag "displaynames" {
     It "Should enforce valid display name format" {
         $generateconfig.displayNamesLookup["net461"] = '123.Some.456.Invalid_format-name$(foo)'
         $generateconfig.displayNamesLookup["netcoreapp2.1"] = (New-Object string[] 150) -join "a"
-        $dimensions = GetMatrixDimensions $generateConfig.matrixParameters
         $matrix = GenerateFullMatrix $generateconfig.matrixParameters $generateconfig.displayNamesLookup
 
         $matrix[0].name | Should -Be "ubuntu1804_123some456invalid_formatnamefoo_TestObjectValueName"
@@ -611,6 +610,43 @@ Describe "Platform Matrix Display Names" -Tag "displaynames" {
         $matrix[1].name | Should -BeLike "ubuntu1804_aaaaaaaaaaaaaaaaa*"
     }
 
+    It "Should create a valid display name when there are leading numbers" {
+        $generateconfig.displayNamesLookup["ubuntu-18.04"] = '123_ubuntu1804'
+        $matrix = GenerateFullMatrix $generateconfig.matrixParameters $generateconfig.displayNamesLookup
+
+        $matrix[0].name | Should -Be "job_123_ubuntu1804_net461_TestObjectValueName"
+    }
+
+    It "Should create a valid job name when there are leading numbers" {
+        $matrixConfigForGenerate = @"
+{
+    "matrix": {
+        "numField1": [1, 2, 3],
+        "letterField": ["a", "b", "c"]
+    }
+}
+"@
+        $generateConfig = GetMatrixConfigFromJson $matrixConfigForGenerate
+        $matrix = GenerateFullMatrix $generateconfig.matrixParameters $generateconfig.displayNamesLookup
+        $matrix[0].name | Should -Be "job_1_a"
+    }
+
+    It "Should create a valid job name when parameter values are all numbers" {
+        $matrixConfigForGenerate = @"
+{
+    "matrix": {
+        "numField1": ["1", "2", "3"],
+        "numField2": [4, 5, 6]
+    }
+}
+"@
+        $generateConfig = GetMatrixConfigFromJson $matrixConfigForGenerate
+        $matrix = GenerateSparseMatrix $generateconfig.matrixParameters $generateconfig.displayNamesLookup
+        $matrix[0].name | Should -Be "job_1_4"
+        $matrix[1].name | Should -Be "job_2_5"
+        $matrix[2].name | Should -Be "job_3_6"
+    }
+
     It "Should generate a display name with null and object values" {
         $matrix = GenerateMatrix $generateConfig "sparse"
         $matrix[0].name | Should -Be "ubuntu1804_net461_TestObjectValueName"
diff --git a/sdk/azcore/arm/runtime/pipeline_test.go b/sdk/azcore/arm/runtime/pipeline_test.go
index 384adf3869..f4a9d11207 100644
--- a/sdk/azcore/arm/runtime/pipeline_test.go
+++ b/sdk/azcore/arm/runtime/pipeline_test.go
@@ -14,6 +14,8 @@ import (
 	"time"
 
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
 	azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
@@ -30,7 +32,11 @@ func TestNewPipelineWithOptions(t *testing.T) {
 	if err != nil {
 		t.Fatalf("Unexpected error: %v", err)
 	}
-	resp, err := NewPipeline("armtest", "v1.2.3", mockTokenCred{}, azruntime.PipelineOptions{}, &opt).Do(req)
+	pl, err := NewPipeline("armtest", "v1.2.3", mockCredential{}, azruntime.PipelineOptions{}, &opt)
+	if err != nil {
+		t.Fatal(err)
+	}
+	resp, err := pl.Do(req)
 	if err != nil {
 		t.Fatalf("Unexpected error: %v", err)
 	}
@@ -57,7 +63,11 @@ func TestNewPipelineWithCustomTelemetry(t *testing.T) {
 	if err != nil {
 		t.Fatalf("Unexpected error: %v", err)
 	}
-	resp, err := NewPipeline("armtest", "v1.2.3", mockTokenCred{}, azruntime.PipelineOptions{}, &opt).Do(req)
+	pl, err := NewPipeline("armtest", "v1.2.3", mockCredential{}, azruntime.PipelineOptions{}, &opt)
+	if err != nil {
+		t.Fatal(err)
+	}
+	resp, err := pl.Do(req)
 	if err != nil {
 		t.Fatalf("Unexpected error: %v", err)
 	}
@@ -89,7 +99,11 @@ func TestDisableAutoRPRegistration(t *testing.T) {
 	log.SetListener(func(cls log.Event, msg string) {
 		logEntries++
 	})
-	resp, err := NewPipeline("armtest", "v1.2.3", mockTokenCred{}, azruntime.PipelineOptions{}, opts).Do(req)
+	pl, err := NewPipeline("armtest", "v1.2.3", mockCredential{}, azruntime.PipelineOptions{}, opts)
+	if err != nil {
+		t.Fatal(err)
+	}
+	resp, err := pl.Do(req)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -133,7 +147,11 @@ func TestPipelineWithCustomPolicies(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	resp, err := NewPipeline("armtest", "v1.2.3", mockTokenCred{}, azruntime.PipelineOptions{}, opts).Do(req)
+	pl, err := NewPipeline("armtest", "v1.2.3", mockCredential{}, azruntime.PipelineOptions{}, opts)
+	if err != nil {
+		t.Fatal(err)
+	}
+	resp, err := pl.Do(req)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -147,3 +165,64 @@ func TestPipelineWithCustomPolicies(t *testing.T) {
 		t.Fatalf("unexpected per retry policy count %d", perRetryPolicy.count)
 	}
 }
+
+func TestPipelineAudience(t *testing.T) {
+	for _, c := range []cloud.Configuration{cloud.AzureChina, cloud.AzureGovernment, cloud.AzurePublicCloud} {
+		srv, close := mock.NewServer()
+		defer close()
+		srv.AppendResponse(mock.WithStatusCode(200))
+		opts := &arm.ClientOptions{}
+		opts.Cloud = c
+		opts.Transport = srv
+		audience := opts.Cloud.Services[cloud.ResourceManager].Audience
+		if !strings.HasPrefix(audience, "https://") {
+			t.Fatal("unexpected audience " + audience)
+		}
+		getTokenCalled := false
+		cred := mockCredential{getTokenImpl: func(ctx context.Context, options shared.TokenRequestOptions) (*shared.AccessToken, error) {
+			getTokenCalled = true
+			if n := len(options.Scopes); n != 1 {
+				t.Fatalf("expected 1 scope, got %d", n)
+			}
+			if options.Scopes[0] != audience+"/.default" {
+				t.Fatalf(`unexpected scope "%s"`, options.Scopes[0])
+			}
+			return &shared.AccessToken{Token: "...", ExpiresOn: time.Now().Add(time.Hour)}, nil
+		}}
+		req, err := azruntime.NewRequest(context.Background(), http.MethodGet, srv.URL())
+		if err != nil {
+			t.Fatal(err)
+		}
+		pl, err := NewPipeline("test", "v0.1.0", cred, azruntime.PipelineOptions{}, opts)
+		if err != nil {
+			t.Fatal(err)
+		}
+		_, err = pl.Do(req)
+		if err != nil {
+			t.Fatal(err)
+		}
+		if !getTokenCalled {
+			t.Fatal("mock credential's GetToken method wasn't called")
+		}
+	}
+}
+
+func TestPipelineWithIncompleteCloudConfig(t *testing.T) {
+	partialConfigs := []cloud.Configuration{
+		{Services: map[cloud.ServiceName]cloud.ServiceConfiguration{"...": {Endpoint: "..."}}},
+		{Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
+			cloud.ResourceManager: {Audience: "..."},
+		}},
+		{Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
+			cloud.ResourceManager: {Endpoint: "http://localhost"},
+		}},
+	}
+	for _, c := range partialConfigs {
+		opts := &arm.ClientOptions{}
+		opts.Cloud = c
+		_, err := NewPipeline("test", "v0.1.0", mockCredential{}, azruntime.PipelineOptions{}, opts)
+		if err == nil {
+			t.Fatal("expected an error")
+		}
+	}
+}
diff --git a/sdk/azcore/arm/runtime/policy_bearer_token_test.go b/sdk/azcore/arm/runtime/policy_bearer_token_test.go
index 7664aeb269..e381393da8 100644
--- a/sdk/azcore/arm/runtime/policy_bearer_token_test.go
+++ b/sdk/azcore/arm/runtime/policy_bearer_token_test.go
@@ -51,7 +51,7 @@ func newTestPipeline(opts *azpolicy.ClientOptions) pipeline.Pipeline {
 	return runtime.NewPipeline("testmodule", "v0.1.0", runtime.PipelineOptions{}, opts)
 }
 
-func defaultTestPipeline(srv azpolicy.Transporter, scope string) pipeline.Pipeline {
+func defaultTestPipeline(srv azpolicy.Transporter, scope string) (pipeline.Pipeline, error) {
 	retryOpts := azpolicy.RetryOptions{
 		MaxRetryDelay: 500 * time.Millisecond,
 		RetryDelay:    time.Millisecond,
@@ -74,7 +74,10 @@ func TestBearerPolicy_SuccessGetToken(t *testing.T) {
 	defer close()
 	srv.AppendResponse(mock.WithBody([]byte(accessTokenRespSuccess)))
 	srv.AppendResponse(mock.WithStatusCode(http.StatusOK))
-	pipeline := defaultTestPipeline(srv, scope)
+	pipeline, err := defaultTestPipeline(srv, scope)
+	if err != nil {
+		t.Fatal(err)
+	}
 	req, err := runtime.NewRequest(context.Background(), http.MethodGet, srv.URL())
 	if err != nil {
 		t.Fatal(err)
@@ -123,7 +126,10 @@ func TestBearerTokenPolicy_TokenExpired(t *testing.T) {
 	defer close()
 	srv.AppendResponse(mock.WithBody([]byte(accessTokenRespShortLived)))
 	srv.AppendResponse(mock.WithStatusCode(http.StatusOK))
-	pipeline := defaultTestPipeline(srv, scope)
+	pipeline, err := defaultTestPipeline(srv, scope)
+	if err != nil {
+		t.Fatal(err)
+	}
 	req, err := runtime.NewRequest(context.Background(), http.MethodGet, srv.URL())
 	if err != nil {
 		t.Fatal(err)
diff --git a/sdk/azcore/arm/runtime/policy_register_rp_test.go b/sdk/azcore/arm/runtime/policy_register_rp_test.go
index 63d63c1c41..0fcdfd2629 100644
--- a/sdk/azcore/arm/runtime/policy_register_rp_test.go
+++ b/sdk/azcore/arm/runtime/policy_register_rp_test.go
@@ -16,6 +16,7 @@ import (
 	"time"
 
 	armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pipeline"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
@@ -55,35 +56,27 @@ const rpRegisteredResp = `{
 
 const requestEndpoint = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fakeResourceGroupo/providers/Microsoft.Storage/storageAccounts/fakeAccountName"
 
-func newTestRPRegistrationPipeline(srv *mock.Server) pipeline.Pipeline {
-	opts := azpolicy.ClientOptions{Transport: srv}
-	rp := NewRPRegistrationPolicy(srv.URL(), mockTokenCred{}, testRPRegistrationOptions(srv))
-	return runtime.NewPipeline("test", "v0.1.0", runtime.PipelineOptions{PerCall: []azpolicy.Policy{rp}}, &opts)
+func newTestRPRegistrationPipeline(t *testing.T, srv *mock.Server) pipeline.Pipeline {
+	opts := testRPRegistrationOptions(srv)
+	rp, err := NewRPRegistrationPolicy(mockCredential{}, testRPRegistrationOptions(srv))
+	if err != nil {
+		t.Fatal(err)
+	}
+	return runtime.NewPipeline("test", "v0.1.0", runtime.PipelineOptions{PerCall: []azpolicy.Policy{rp}}, &opts.ClientOptions)
 }
 
-func testRPRegistrationOptions(t azpolicy.Transporter) *armpolicy.RegistrationOptions {
+func testRPRegistrationOptions(srv *mock.Server) *armpolicy.RegistrationOptions {
 	def := armpolicy.RegistrationOptions{}
-	def.Transport = t
+	def.Cloud = cloud.Configuration{
+		Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
+			cloud.ResourceManager: {Endpoint: srv.URL(), Audience: srv.URL()},
+		}}
+	def.Transport = srv
 	def.PollingDelay = 100 * time.Millisecond
 	def.PollingDuration = 1 * time.Second
 	return &def
 }
 
-type mockTokenCred struct{}
-
-func (mockTokenCred) NewAuthenticationPolicy() azpolicy.Policy {
-	return pipeline.PolicyFunc(func(req *azpolicy.Request) (*http.Response, error) {
-		return req.Next()
-	})
-}
-
-func (mockTokenCred) GetToken(context.Context, shared.TokenRequestOptions) (*shared.AccessToken, error) {
-	return &shared.AccessToken{
-		Token:     "abc123",
-		ExpiresOn: time.Now().Add(1 * time.Hour),
-	}, nil
-}
-
 func TestRPRegistrationPolicySuccess(t *testing.T) {
 	srv, close := mock.NewServer()
 	defer close()
@@ -95,7 +88,7 @@ func TestRPRegistrationPolicySuccess(t *testing.T) {
 	srv.AppendResponse(mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(rpRegisteredResp)))
 	// response for original request (different status code than any of the other responses)
 	srv.AppendResponse(mock.WithStatusCode(http.StatusAccepted))
-	pl := newTestRPRegistrationPipeline(srv)
+	pl := newTestRPRegistrationPipeline(t, srv)
 	req, err := runtime.NewRequest(context.Background(), http.MethodGet, runtime.JoinPaths(srv.URL(), requestEndpoint))
 	if err != nil {
 		t.Fatal(err)
@@ -135,7 +128,7 @@ func TestRPRegistrationPolicyNA(t *testing.T) {
 	defer close()
 	// response indicates no RP registration is required, policy does nothing
 	srv.AppendResponse(mock.WithStatusCode(http.StatusOK))
-	pl := newTestRPRegistrationPipeline(srv)
+	pl := newTestRPRegistrationPipeline(t, srv)
 	req, err := runtime.NewRequest(context.Background(), http.MethodGet, srv.URL())
 	if err != nil {
 		t.Fatal(err)
@@ -174,7 +167,7 @@ func TestRPRegistrationPolicy409Other(t *testing.T) {
 	defer close()
 	// test getting a 409 but not due to registration required
 	srv.AppendResponse(mock.WithStatusCode(http.StatusConflict), mock.WithBody([]byte(failedResp)))
-	pl := newTestRPRegistrationPipeline(srv)
+	pl := newTestRPRegistrationPipeline(t, srv)
 	req, err := runtime.NewRequest(context.Background(), http.MethodGet, srv.URL())
 	if err != nil {
 		t.Fatal(err)
@@ -205,7 +198,7 @@ func TestRPRegistrationPolicyTimesOut(t *testing.T) {
 	// polling responses to Register() and Get(), in progress but slow
 	// tests registration takes too long, times out
 	srv.RepeatResponse(10, mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(rpRegisteringResp)), mock.WithSlowResponse(400*time.Millisecond))
-	pl := newTestRPRegistrationPipeline(srv)
+	pl := newTestRPRegistrationPipeline(t, srv)
 	req, err := runtime.NewRequest(context.Background(), http.MethodGet, runtime.JoinPaths(srv.URL(), requestEndpoint))
 	if err != nil {
 		t.Fatal(err)
@@ -249,7 +242,7 @@ func TestRPRegistrationPolicyExceedsAttempts(t *testing.T) {
 		// polling response, successful registration
 		srv.AppendResponse(mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(rpRegisteredResp)))
 	}
-	pl := newTestRPRegistrationPipeline(srv)
+	pl := newTestRPRegistrationPipeline(t, srv)
 	req, err := runtime.NewRequest(context.Background(), http.MethodGet, runtime.JoinPaths(srv.URL(), requestEndpoint))
 	if err != nil {
 		t.Fatal(err)
@@ -297,7 +290,7 @@ func TestRPRegistrationPolicyCanCancel(t *testing.T) {
 	srv.RepeatResponse(10, mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(rpRegisteringResp)), mock.WithSlowResponse(300*time.Millisecond))
 	opts := armpolicy.RegistrationOptions{}
 	opts.Transport = srv
-	pl := newTestRPRegistrationPipeline(srv)
+	pl := newTestRPRegistrationPipeline(t, srv)
 	// log only RP registration
 	log.SetEvents(LogRPRegistration)
 	defer func() {
@@ -350,7 +343,11 @@ func TestRPRegistrationPolicyDisabled(t *testing.T) {
 	srv.AppendResponse(mock.WithStatusCode(http.StatusConflict), mock.WithBody([]byte(rpUnregisteredResp)))
 	ops := testRPRegistrationOptions(srv)
 	ops.MaxAttempts = -1
-	pl := runtime.NewPipeline("test", "v0.1.0", runtime.PipelineOptions{PerCall: []pipeline.Policy{NewRPRegistrationPolicy(srv.URL(), mockTokenCred{}, ops)}}, nil)
+	rp, err := NewRPRegistrationPolicy(mockCredential{}, ops)
+	if err != nil {
+		t.Fatal(err)
+	}
+	pl := runtime.NewPipeline("test", "v0.1.0", runtime.PipelineOptions{PerCall: []pipeline.Policy{rp}}, nil)
 	req, err := runtime.NewRequest(context.Background(), http.MethodGet, runtime.JoinPaths(srv.URL(), requestEndpoint))
 	if err != nil {
 		t.Fatal(err)
@@ -377,3 +374,71 @@ func TestRPRegistrationPolicyDisabled(t *testing.T) {
 		t.Fatalf("expected 0 log entries, got %d", logEntries)
 	}
 }
+
+func TestRPRegistrationPolicyAudience(t *testing.T) {
+	srv, close := mock.NewServer()
+	defer close()
+	// initial response that RP is unregistered
+	srv.AppendResponse(mock.WithStatusCode(http.StatusConflict), mock.WithBody([]byte(rpUnregisteredResp)))
+	// polling responses to Register() and Get(), in progress
+	srv.AppendResponse(mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(rpRegisteringResp)))
+	// polling response, successful registration
+	srv.AppendResponse(mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(rpRegisteredResp)))
+	// response for original request (different status code than any of the other responses)
+	srv.AppendResponse(mock.WithStatusCode(http.StatusAccepted))
+
+	audience := "audience"
+	conf := cloud.Configuration{
+		LoginEndpoint: srv.URL(),
+		Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
+			cloud.ResourceManager: {Audience: audience, Endpoint: srv.URL()},
+		},
+	}
+	getTokenCalled := false
+	cred := mockCredential{getTokenImpl: func(ctx context.Context, options shared.TokenRequestOptions) (*shared.AccessToken, error) {
+		getTokenCalled = true
+		if n := len(options.Scopes); n != 1 {
+			t.Fatalf("expected 1 scope, got %d", n)
+		}
+		if options.Scopes[0] != audience+"/.default" {
+			t.Fatalf(`unexpected scope "%s"`, options.Scopes[0])
+		}
+		return &shared.AccessToken{Token: "...", ExpiresOn: time.Now().Add(time.Hour)}, nil
+	}}
+	opts := azpolicy.ClientOptions{Cloud: conf, Transport: srv}
+	rp, err := NewRPRegistrationPolicy(cred, &armpolicy.RegistrationOptions{ClientOptions: opts})
+	if err != nil {
+		t.Fatal(err)
+	}
+	pl := runtime.NewPipeline("test", "v0.1.0", runtime.PipelineOptions{PerCall: []azpolicy.Policy{rp}}, &azpolicy.ClientOptions{Transport: srv})
+	req, err := runtime.NewRequest(context.Background(), http.MethodGet, srv.URL()+requestEndpoint)
+	if err != nil {
+		t.Fatal(err)
+	}
+	_, err = pl.Do(req)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if !getTokenCalled {
+		t.Fatal("mock credential's GetToken method wasn't called")
+	}
+}
+
+func TestRPRegistrationPolicyWithIncompleteCloudConfig(t *testing.T) {
+	partialConfigs := []cloud.Configuration{
+		{Services: map[cloud.ServiceName]cloud.ServiceConfiguration{"...": {Endpoint: "..."}}},
+		{Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
+			cloud.ResourceManager: {Audience: "..."},
+		}},
+		{Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
+			cloud.ResourceManager: {Endpoint: "http://localhost"},
+		}},
+	}
+	for _, c := range partialConfigs {
+		opts := azpolicy.ClientOptions{Cloud: c}
+		_, err := NewRPRegistrationPolicy(mockCredential{}, &armpolicy.RegistrationOptions{ClientOptions: opts})
+		if err == nil {
+			t.Fatal("expected an error")
+		}
+	}
+}
diff --git a/sdk/azcore/arm/runtime/poller_test.go b/sdk/azcore/arm/runtime/poller_test.go
index c5b1a70aa1..5a16a41170 100644
--- a/sdk/azcore/arm/runtime/poller_test.go
+++ b/sdk/azcore/arm/runtime/poller_test.go
@@ -75,7 +75,7 @@ func TestNewPollerAsync(t *testing.T) {
 	resp.Header.Set(shared.HeaderAzureAsync, srv.URL())
 	resp.StatusCode = http.StatusCreated
 	pl := getPipeline(srv)
-	poller, err := NewPoller[mockType]("pollerID", "", resp, pl, nil)
+	poller, err := NewPoller[mockType](resp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -89,7 +89,7 @@ func TestNewPollerAsync(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	poller, err = NewPollerFromResumeToken[mockType]("pollerID", tk, pl, nil)
+	poller, err = NewPollerFromResumeToken[mockType](tk, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -110,7 +110,7 @@ func TestNewPollerBody(t *testing.T) {
 	resp, closed := initialResponse(http.MethodPatch, srv.URL(), strings.NewReader(provStateStarted))
 	resp.StatusCode = http.StatusCreated
 	pl := getPipeline(srv)
-	poller, err := NewPoller[mockType]("pollerID", "", resp, pl, nil)
+	poller, err := NewPoller[mockType](resp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -124,7 +124,7 @@ func TestNewPollerBody(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	poller, err = NewPollerFromResumeToken[mockType]("pollerID", tk, pl, nil)
+	poller, err = NewPollerFromResumeToken[mockType](tk, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -146,7 +146,7 @@ func TestNewPollerLoc(t *testing.T) {
 	resp.Header.Set(shared.HeaderLocation, srv.URL())
 	resp.StatusCode = http.StatusAccepted
 	pl := getPipeline(srv)
-	poller, err := NewPoller[mockType]("pollerID", "", resp, pl, nil)
+	poller, err := NewPoller[mockType](resp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -160,7 +160,7 @@ func TestNewPollerLoc(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	poller, err = NewPollerFromResumeToken[mockType]("pollerID", tk, pl, nil)
+	poller, err = NewPollerFromResumeToken[mockType](tk, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -193,7 +193,7 @@ func TestNewPollerInitialRetryAfter(t *testing.T) {
 	resp.Header.Set("Retry-After", "1")
 	resp.StatusCode = http.StatusCreated
 	pl := getPipeline(srv)
-	poller, err := NewPoller[mockType]("pollerID", "", resp, pl, nil)
+	poller, err := NewPoller[mockType](resp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -221,7 +221,7 @@ func TestNewPollerCanceled(t *testing.T) {
 	resp.Header.Set(shared.HeaderAzureAsync, srv.URL())
 	resp.StatusCode = http.StatusCreated
 	pl := getPipeline(srv)
-	poller, err := NewPoller[mockType]("pollerID", "", resp, pl, nil)
+	poller, err := NewPoller[mockType](resp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -256,7 +256,7 @@ func TestNewPollerFailedWithError(t *testing.T) {
 	resp.Header.Set(shared.HeaderAzureAsync, srv.URL())
 	resp.StatusCode = http.StatusCreated
 	pl := getPipeline(srv)
-	poller, err := NewPoller[mockType]("pollerID", "", resp, pl, nil)
+	poller, err := NewPoller[mockType](resp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -283,7 +283,7 @@ func TestNewPollerSuccessNoContent(t *testing.T) {
 	resp, closed := initialResponse(http.MethodPatch, srv.URL(), strings.NewReader(provStateStarted))
 	resp.StatusCode = http.StatusCreated
 	pl := getPipeline(srv)
-	poller, err := NewPoller[mockType]("pollerID", "", resp, pl, nil)
+	poller, err := NewPoller[mockType](resp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -297,7 +297,7 @@ func TestNewPollerSuccessNoContent(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	poller, err = NewPollerFromResumeToken[mockType]("pollerID", tk, pl, nil)
+	poller, err = NewPollerFromResumeToken[mockType](tk, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -316,7 +316,7 @@ func TestNewPollerFail202NoHeaders(t *testing.T) {
 	resp, closed := initialResponse(http.MethodDelete, srv.URL(), http.NoBody)
 	resp.StatusCode = http.StatusAccepted
 	pl := getPipeline(srv)
-	poller, err := NewPoller[mockType]("pollerID", "", resp, pl, nil)
+	poller, err := NewPoller[mockType](resp, pl, nil)
 	if err == nil {
 		t.Fatal("unexpected nil error")
 	}
@@ -327,3 +327,50 @@ func TestNewPollerFail202NoHeaders(t *testing.T) {
 		t.Fatal("expected nil poller")
 	}
 }
+
+type preconstructedMockType struct {
+	Field          *string `json:"field,omitempty"`
+	Preconstructed int
+}
+
+func TestNewPollerWithResponseType(t *testing.T) {
+	srv, close := mock.NewServer()
+	defer close()
+	srv.AppendResponse(mock.WithBody([]byte(provStateUpdating)), mock.WithHeader("Retry-After", "1"))
+	srv.AppendResponse(mock.WithBody([]byte(provStateSucceeded)))
+	resp, closed := initialResponse(http.MethodPatch, srv.URL(), strings.NewReader(provStateStarted))
+	resp.StatusCode = http.StatusCreated
+	pl := getPipeline(srv)
+	poller, err := NewPoller[preconstructedMockType](resp, pl, nil)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if !closed() {
+		t.Fatal("initial response body wasn't closed")
+	}
+	if pt := pollers.PollerType(poller.pt); pt != reflect.TypeOf(&body.Poller{}) {
+		t.Fatalf("unexpected poller type %s", pt.String())
+	}
+	tk, err := poller.ResumeToken()
+	if err != nil {
+		t.Fatal(err)
+	}
+	poller, err = NewPollerFromResumeToken(tk, pl, &NewPollerFromResumeTokenOptions[preconstructedMockType]{
+		Response: &preconstructedMockType{
+			Preconstructed: 12345,
+		},
+	})
+	if err != nil {
+		t.Fatal(err)
+	}
+	result, err := poller.PollUntilDone(context.Background(), time.Second)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if v := *result.Field; v != "value" {
+		t.Fatalf("unexpected value %s", v)
+	}
+	if result.Preconstructed != 12345 {
+		t.Fatalf("unexpected value %d", result.Preconstructed)
+	}
+}
diff --git a/sdk/azcore/internal/pollers/loc/loc_test.go b/sdk/azcore/internal/pollers/loc/loc_test.go
index 50a324a4b5..5815d33c33 100644
--- a/sdk/azcore/internal/pollers/loc/loc_test.go
+++ b/sdk/azcore/internal/pollers/loc/loc_test.go
@@ -42,7 +42,7 @@ func TestApplicable(t *testing.T) {
 func TestNew(t *testing.T) {
 	resp := initialResponse()
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -62,7 +62,7 @@ func TestNew(t *testing.T) {
 
 func TestNewFail(t *testing.T) {
 	resp := initialResponse()
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err == nil {
 		t.Fatal("unexpected nil error")
 	}
@@ -70,7 +70,7 @@ func TestNewFail(t *testing.T) {
 		t.Fatal("expected nil poller")
 	}
 	resp.Header.Set(shared.HeaderLocation, "/must/be/absolute")
-	poller, err = New(resp, "pollerID")
+	poller, err = New(resp, "", "pollerID")
 	if err == nil {
 		t.Fatal("unexpected nil error")
 	}
@@ -82,7 +82,7 @@ func TestNewFail(t *testing.T) {
 func TestUpdateSucceeded(t *testing.T) {
 	resp := initialResponse()
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -110,7 +110,7 @@ func TestUpdateSucceeded(t *testing.T) {
 func TestUpdateFailed(t *testing.T) {
 	resp := initialResponse()
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
diff --git a/sdk/azcore/internal/pollers/op/op_test.go b/sdk/azcore/internal/pollers/op/op_test.go
index 198441cf19..8d93788710 100644
--- a/sdk/azcore/internal/pollers/op/op_test.go
+++ b/sdk/azcore/internal/pollers/op/op_test.go
@@ -60,7 +60,7 @@ func TestNew(t *testing.T) {
 	resp := initialResponse(http.MethodPut, http.NoBody)
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -82,7 +82,7 @@ func TestNewWithInitialStatus(t *testing.T) {
 	resp := initialResponse(http.MethodPut, strings.NewReader(`{ "status": "Updating" }`))
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -98,7 +98,7 @@ func TestNewWithPost(t *testing.T) {
 	resp := initialResponse(http.MethodPost, http.NoBody)
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -114,7 +114,7 @@ func TestNewWithDelete(t *testing.T) {
 	resp := initialResponse(http.MethodDelete, http.NoBody)
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -128,7 +128,7 @@ func TestNewWithDelete(t *testing.T) {
 
 func TestNewFail(t *testing.T) {
 	resp := initialResponse(http.MethodPut, http.NoBody)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err == nil {
 		t.Fatal("unexpected nil error")
 	}
@@ -137,7 +137,7 @@ func TestNewFail(t *testing.T) {
 	}
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, "/must/be/absolute")
-	poller, err = New(resp, "pollerID")
+	poller, err = New(resp, "", "pollerID")
 	if err == nil {
 		t.Fatal("unexpected nil error")
 	}
@@ -145,7 +145,7 @@ func TestNewFail(t *testing.T) {
 		t.Fatal("expected nil poller")
 	}
 	resp.Header.Set(shared.HeaderOperationLocation, "/must/be/absolute")
-	poller, err = New(resp, "pollerID")
+	poller, err = New(resp, "", "pollerID")
 	if err == nil {
 		t.Fatal("unexpected nil error")
 	}
@@ -158,7 +158,7 @@ func TestUpdateSucceeded(t *testing.T) {
 	resp := initialResponse(http.MethodPut, http.NoBody)
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -192,7 +192,7 @@ func TestUpdateResourceLocation(t *testing.T) {
 	resp := initialResponse(http.MethodPut, http.NoBody)
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -215,7 +215,7 @@ func TestUpdateFailed(t *testing.T) {
 	resp := initialResponse(http.MethodPut, http.NoBody)
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -235,7 +235,7 @@ func TestUpdateMissingStatus(t *testing.T) {
 	resp := initialResponse(http.MethodPut, http.NoBody)
 	resp.Header.Set(shared.HeaderOperationLocation, fakePollingURL)
 	resp.Header.Set(shared.HeaderLocation, fakeLocationURL)
-	poller, err := New(resp, "pollerID")
+	poller, err := New(resp, "", "pollerID")
 	if err != nil {
 		t.Fatal(err)
 	}
diff --git a/sdk/azcore/internal/pollers/util_test.go b/sdk/azcore/internal/pollers/util_test.go
index 11bad46862..a9cb5df265 100644
--- a/sdk/azcore/internal/pollers/util_test.go
+++ b/sdk/azcore/internal/pollers/util_test.go
@@ -51,6 +51,37 @@ func TestStatusCodeValid(t *testing.T) {
 	}
 }
 
+func TestPollerTypeName(t *testing.T) {
+	n, err := PollerTypeName[int]()
+	if err != nil {
+		t.Fatal(err)
+	}
+	if n != "int" {
+		t.Fatalf("unexpected type name %s", n)
+	}
+	n, err = PollerTypeName[struct{}]()
+	if err == nil {
+		t.Fatal("unexpected nil error")
+	}
+	if n != "" {
+		t.Fatal("expected empty type name")
+	}
+	n, err = PollerTypeName[interface{}]()
+	if err == nil {
+		t.Fatal("unexpected nil error")
+	}
+	if n != "" {
+		t.Fatal("expected empty type name")
+	}
+	n, err = PollerTypeName[*float64]()
+	if err != nil {
+		t.Fatal(err)
+	}
+	if n != "*float64" {
+		t.Fatalf("unexpected type name %s", n)
+	}
+}
+
 func TestMakeID(t *testing.T) {
 	const (
 		pollerID = "pollerID"
diff --git a/sdk/azcore/internal/shared/shared_test.go b/sdk/azcore/internal/shared/shared_test.go
index 8b1ebebaf7..242d32cd1d 100644
--- a/sdk/azcore/internal/shared/shared_test.go
+++ b/sdk/azcore/internal/shared/shared_test.go
@@ -12,6 +12,7 @@ import (
 	"io"
 	"io/ioutil"
 	"net/http"
+	"reflect"
 	"strings"
 	"testing"
 	"time"
@@ -97,34 +98,6 @@ func TestHasStatusCode(t *testing.T) {
 	}
 }
 
-func TestEndpointToScope(t *testing.T) {
-	knownClouds := map[string][]string{
-		chinaCloudARMScope:  {"https://foo.management.chinacloudapi.cn", "https://management.chinacloudapi.cn"},
-		publicCloudARMScope: {"https://centraluseuap.management.azure.com", "https://management.azure.com"},
-		usGovCloudARMScope:  {"https://foo.management.usgovcloudapi.net", "https://management.usgovcloudapi.net"},
-	}
-	for expected, endpoints := range knownClouds {
-		for _, endpoint := range endpoints {
-			if actual := EndpointToScope(endpoint); actual != expected {
-				t.Fatalf(`unexpected scope "%s" for endpoint "%s"`, actual, endpoint)
-			}
-			if actual := EndpointToScope(endpoint + "/"); actual != expected {
-				t.Fatalf(`unexpected scope "%s" for endpoint "%s"/`, actual, endpoint)
-			}
-		}
-	}
-
-	// legacy behavior for unknown clouds: add "//.default" suffix to endpoint
-	for _, endpoint := range []string{"localhost", "http://foo.bar"} {
-		if actual := EndpointToScope(endpoint); actual != endpoint+"//.default" {
-			t.Fatalf(`unexpected scope "%s" for endpoint "%s"`, actual, endpoint)
-		}
-		if actual := EndpointToScope(endpoint + "/"); actual != endpoint+"//.default" {
-			t.Fatalf(`unexpected scope "%s" for endpoint "%s"/`, actual, endpoint)
-		}
-	}
-}
-
 func TestPayload(t *testing.T) {
 	const val = "payload"
 	resp := &http.Response{
@@ -204,3 +177,12 @@ func TestNopClosingBytesReader(t *testing.T) {
 		t.Fatal("unexpected nil error")
 	}
 }
+
+func TestTypeOfT(t *testing.T) {
+	if tt := TypeOfT[bool](); tt != reflect.TypeOf(true) {
+		t.Fatalf("unexpected type %s", tt)
+	}
+	if tt := TypeOfT[int32](); tt == reflect.TypeOf(3.14) {
+		t.Fatal("didn't expect types to match")
+	}
+}
diff --git a/sdk/azcore/runtime/poller_test.go b/sdk/azcore/runtime/poller_test.go
index 0c571c24c6..5e65829650 100644
--- a/sdk/azcore/runtime/poller_test.go
+++ b/sdk/azcore/runtime/poller_test.go
@@ -22,13 +22,15 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/internal/mock"
 )
 
+type none struct{}
+
 type widget struct {
 	Size int `json:"size"`
 }
 
 func TestNewPollerFail(t *testing.T) {
 	body, closed := mock.NewTrackedCloser(http.NoBody)
-	p, err := NewPoller[widget]("fake.poller", &http.Response{
+	p, err := NewPoller[widget](&http.Response{
 		Body:       body,
 		StatusCode: http.StatusBadRequest,
 	}, newTestPipeline(nil), nil)
@@ -57,7 +59,7 @@ func TestNewPollerFromResumeTokenFail(t *testing.T) {
 	}
 	for _, test := range tests {
 		t.Run(test.name, func(t *testing.T) {
-			p, err := NewPollerFromResumeToken[widget]("fake.poller", test.token, newTestPipeline(nil), nil)
+			p, err := NewPollerFromResumeToken[widget](test.token, newTestPipeline(nil), nil)
 			if err == nil {
 				t.Fatal("unexpected nil error")
 			}
@@ -85,7 +87,7 @@ func TestLocPollerSimple(t *testing.T) {
 	body, closed := mock.NewTrackedCloser(http.NoBody)
 	firstResp.Body = body
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[struct{}]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[none](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -120,7 +122,7 @@ func TestLocPollerWithWidget(t *testing.T) {
 	body, closed := mock.NewTrackedCloser(http.NoBody)
 	firstResp.Body = body
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[widget]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[widget](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -153,7 +155,7 @@ func TestLocPollerCancelled(t *testing.T) {
 	body, closed := mock.NewTrackedCloser(http.NoBody)
 	firstResp.Body = body
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[widget]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[widget](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -189,7 +191,7 @@ func TestLocPollerWithError(t *testing.T) {
 	body, closed := mock.NewTrackedCloser(http.NoBody)
 	firstResp.Body = body
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv, Retry: policy.RetryOptions{MaxRetries: -1}})
-	lro, err := NewPoller[widget]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[widget](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -225,7 +227,7 @@ func TestLocPollerWithResumeToken(t *testing.T) {
 	body, closed := mock.NewTrackedCloser(http.NoBody)
 	firstResp.Body = body
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[struct{}]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[none](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -250,7 +252,7 @@ func TestLocPollerWithResumeToken(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	lro, err = NewPollerFromResumeToken[struct{}]("fake.poller", tk, pl, nil)
+	lro, err = NewPollerFromResumeToken[none](tk, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -276,7 +278,7 @@ func TestLocPollerWithTimeout(t *testing.T) {
 	body, closed := mock.NewTrackedCloser(http.NoBody)
 	firstResp.Body = body
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[struct{}]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[none](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -316,7 +318,7 @@ func TestOpPollerSimple(t *testing.T) {
 		},
 	}
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[struct{}]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[none](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -356,7 +358,7 @@ func TestOpPollerWithWidgetPUT(t *testing.T) {
 		},
 	}
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[widget]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[widget](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -400,7 +402,7 @@ func TestOpPollerWithWidgetPOSTLocation(t *testing.T) {
 		},
 	}
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[widget]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[widget](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -442,7 +444,7 @@ func TestOpPollerWithWidgetPOST(t *testing.T) {
 		},
 	}
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[widget]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[widget](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -487,7 +489,7 @@ func TestOpPollerWithWidgetResourceLocation(t *testing.T) {
 		},
 	}
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[widget]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[widget](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -528,7 +530,7 @@ func TestOpPollerWithResumeToken(t *testing.T) {
 		},
 	}
 	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
-	lro, err := NewPoller[struct{}]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[none](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -553,7 +555,7 @@ func TestOpPollerWithResumeToken(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	lro, err = NewPollerFromResumeToken[struct{}]("fake.poller", tk, pl, nil)
+	lro, err = NewPollerFromResumeToken[none](tk, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -570,7 +572,7 @@ func TestNopPoller(t *testing.T) {
 	body, closed := mock.NewTrackedCloser(http.NoBody)
 	firstResp.Body = body
 	pl := newTestPipeline(nil)
-	lro, err := NewPoller[struct{}]("fake.poller", firstResp, pl, nil)
+	lro, err := NewPoller[none](firstResp, pl, nil)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -602,3 +604,58 @@ func TestNopPoller(t *testing.T) {
 		t.Fatal("expected empty token")
 	}
 }
+
+type preconstructedWidget struct {
+	Size           int `json:"size"`
+	Preconstructed int
+}
+
+func TestOpPollerWithResponseType(t *testing.T) {
+	srv, close := mock.NewServer()
+	srv.AppendResponse(mock.WithStatusCode(http.StatusAccepted), mock.WithBody([]byte(`{"status": "InProgress"}`)), mock.WithHeader("Retry-After", "1"))
+	srv.AppendResponse(mock.WithStatusCode(http.StatusAccepted), mock.WithBody([]byte(`{"status": "InProgress"}`)))
+	srv.AppendResponse(mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(`{"status": "Succeeded"}`)))
+	// PUT and PATCH state that a final GET will happen
+	srv.AppendResponse(mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(`{"size": 2}`)))
+	defer close()
+
+	reqURL, err := url.Parse(srv.URL())
+	if err != nil {
+		t.Fatal(err)
+	}
+	body, closed := mock.NewTrackedCloser(http.NoBody)
+	firstResp := &http.Response{
+		Body:       body,
+		StatusCode: http.StatusAccepted,
+		Header: http.Header{
+			"Operation-Location": []string{srv.URL()},
+			"Retry-After":        []string{"1"},
+		},
+		Request: &http.Request{
+			Method: http.MethodPut,
+			URL:    reqURL,
+		},
+	}
+	pl := newTestPipeline(&policy.ClientOptions{Transport: srv})
+	lro, err := NewPoller(firstResp, pl, &NewPollerOptions[preconstructedWidget]{
+		Response: &preconstructedWidget{
+			Preconstructed: 12345,
+		},
+	})
+	if err != nil {
+		t.Fatal(err)
+	}
+	if !closed() {
+		t.Fatal("initial response body wasn't closed")
+	}
+	w, err := lro.PollUntilDone(context.Background(), time.Second)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if w.Size != 2 {
+		t.Fatalf("unexpected widget size %d", w.Size)
+	}
+	if w.Preconstructed != 12345 {
+		t.Fatalf("unexpected widget size %d", w.Preconstructed)
+	}
+}
diff --git a/sdk/azcore/testdata/perf/go.mod b/sdk/azcore/testdata/perf/go.mod
index e1223fc812..0d5d2855d0 100644
--- a/sdk/azcore/testdata/perf/go.mod
+++ b/sdk/azcore/testdata/perf/go.mod
@@ -2,13 +2,9 @@ module github.com/Azure/azure-sdk-for-go/sdk/azcore/testdata/perf
 
 go 1.17
 
-replace github.com/Azure/azure-sdk-for-go/sdk/azcore => ../../.
-
-replace github.com/Azure/azure-sdk-for-go/sdk/internal => ../../../internal
-
 require (
-	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0
-	github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1
+	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.22.0
+	github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2
 )
 
 require (
diff --git a/sdk/azcore/testdata/perf/go.sum b/sdk/azcore/testdata/perf/go.sum
index 6bacd43b54..a4a507579c 100644
--- a/sdk/azcore/testdata/perf/go.sum
+++ b/sdk/azcore/testdata/perf/go.sum
@@ -1,3 +1,8 @@
+github.com/Azure/azure-sdk-for-go/sdk/azcore v0.22.0 h1:zBJcBJwte0x6PcPK7XaWDMvK2o2ZM2f1sMaqNNavQ5g=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v0.22.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
+github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
+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/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
diff --git a/sdk/keyvault/internal/challenge_policy_test.go b/sdk/keyvault/internal/challenge_policy_test.go
index ebc466b0be..c65e05d739 100644
--- a/sdk/keyvault/internal/challenge_policy_test.go
+++ b/sdk/keyvault/internal/challenge_policy_test.go
@@ -1,5 +1,5 @@
-//go:build go1.16
-// +build go1.16
+//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.
diff --git a/sdk/keyvault/internal/expiring_resource_test.go b/sdk/keyvault/internal/expiring_resource_test.go
index 57cc432adf..57daa67c0c 100644
--- a/sdk/keyvault/internal/expiring_resource_test.go
+++ b/sdk/keyvault/internal/expiring_resource_test.go
@@ -1,5 +1,5 @@
-//go:build go1.16
-// +build go1.16
+//go:build go1.18
+// +build go1.18
 
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
diff --git a/sdk/keyvault/internal/parse_test.go b/sdk/keyvault/internal/parse_test.go
new file mode 100644
index 0000000000..2d29605929
--- /dev/null
+++ b/sdk/keyvault/internal/parse_test.go
@@ -0,0 +1,43 @@
+//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.
+package internal
+
+import (
+	"testing"
+
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
+	"github.com/stretchr/testify/require"
+)
+
+func TestParseID(t *testing.T) {
+	examples := map[string]struct{ url, name, version *string }{
+		"https://myvaultname.vault.azure.net/keys/key1053998307/b86c2e6ad9054f4abf69cc185b99aa60": {to.Ptr("https://myvaultname.vault.azure.net/"), to.Ptr("key1053998307"), to.Ptr("b86c2e6ad9054f4abf69cc185b99aa60")},
+		"https://myvaultname.vault.azure.net/keys/key1053998307":                                  {to.Ptr("https://myvaultname.vault.azure.net/"), to.Ptr("key1053998307"), nil},
+		"https://myvaultname.vault.azure.net/":                                                    {to.Ptr("https://myvaultname.vault.azure.net/"), nil, nil},
+	}
+
+	for url, result := range examples {
+		url, name, version := ParseID(&url)
+		if result.url == nil {
+			require.Nil(t, url)
+		} else {
+			require.NotNil(t, url)
+			require.Equal(t, *url, *result.url)
+		}
+		if result.name == nil {
+			require.Nil(t, name)
+		} else {
+			require.NotNilf(t, name, "expected %s", *result.name)
+			require.Equal(t, *name, *result.name)
+		}
+		if result.version == nil {
+			require.Nil(t, version)
+		} else {
+			require.NotNil(t, version)
+			require.Equal(t, *version, *result.version)
+		}
+	}
+}
diff --git a/sdk/messaging/azservicebus/internal/amqp_test_utils.go b/sdk/messaging/azservicebus/internal/amqp_test_utils.go
index 72a521850b..a510efdfe2 100644
--- a/sdk/messaging/azservicebus/internal/amqp_test_utils.go
+++ b/sdk/messaging/azservicebus/internal/amqp_test_utils.go
@@ -62,6 +62,7 @@ type FakeAMQPReceiver struct {
 
 	PrefetchedCalled int
 	ReceiveCalled    int
+	ReceiveFn        func(ctx context.Context) (*amqp.Message, error)
 
 	ReceiveResults []struct {
 		M *amqp.Message
@@ -104,6 +105,10 @@ func (r *FakeAMQPReceiver) DrainCredit(ctx context.Context) error {
 func (r *FakeAMQPReceiver) Receive(ctx context.Context) (*amqp.Message, error) {
 	r.ReceiveCalled++
 
+	if r.ReceiveFn != nil {
+		return r.ReceiveFn(ctx)
+	}
+
 	if len(r.ReceiveResults) == 0 {
 		<-ctx.Done()
 		return nil, ctx.Err()
diff --git a/sdk/messaging/azservicebus/receiver_test.go b/sdk/messaging/azservicebus/receiver_test.go
index aa0ec83648..d525e42703 100644
--- a/sdk/messaging/azservicebus/receiver_test.go
+++ b/sdk/messaging/azservicebus/receiver_test.go
@@ -19,6 +19,21 @@ import (
 	"github.com/stretchr/testify/require"
 )
 
+func TestReceiverCancel(t *testing.T) {
+	serviceBusClient, cleanup, queueName := setupLiveTest(t, nil)
+	defer cleanup()
+
+	receiver, err := serviceBusClient.NewReceiverForQueue(queueName, nil)
+	require.NoError(t, err)
+
+	ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+	defer cancel()
+
+	messages, err := receiver.ReceiveMessages(ctx, 5, nil)
+	require.ErrorIs(t, err, context.DeadlineExceeded)
+	require.Empty(t, messages)
+}
+
 func TestReceiverSendFiveReceiveFive(t *testing.T) {
 	serviceBusClient, cleanup, queueName := setupLiveTest(t, nil)
 	defer cleanup()
@@ -304,7 +319,7 @@ func TestReceiverDeferWithReceiveAndDelete(t *testing.T) {
 	defer cancel()
 
 	messages, err = receiveAndDeleteReceiver.ReceiveMessages(ctx, len(sequenceNumbers), nil)
-	require.NoError(t, err)
+	require.ErrorIs(t, err, context.DeadlineExceeded)
 	require.Empty(t, messages)
 }
 
diff --git a/sdk/messaging/azservicebus/receiver_unit_test.go b/sdk/messaging/azservicebus/receiver_unit_test.go
index 8c4442d439..aacc136ab6 100644
--- a/sdk/messaging/azservicebus/receiver_unit_test.go
+++ b/sdk/messaging/azservicebus/receiver_unit_test.go
@@ -8,6 +8,7 @@ import (
 	"errors"
 	"fmt"
 	"testing"
+	"time"
 
 	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/internal"
 	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/internal/utils"
@@ -126,7 +127,7 @@ func TestReceiver_ReceiveMessages_NoMessagesReceivedAndError(t *testing.T) {
 	}
 }
 
-func TestReceiver_ReceiveMessages_DrainTimeout(t *testing.T) {
+func TestReceiver_ReceiveMessages_DrainTimeout_SomeMessagesReceived(t *testing.T) {
 	// all the receive modes work the same when there are no messages
 	for _, mode := range receiveModesForTests {
 		t.Run(mode.Name, func(t *testing.T) {
@@ -177,6 +178,55 @@ func TestReceiver_ReceiveMessages_DrainTimeout(t *testing.T) {
 	}
 }
 
+func TestReceiver_ReceiveMessages_DrainTimeout_NoMessagesReceived(t *testing.T) {
+	// When no messages are received we enter into a separate flow where we are deciding
+	// if we want to return the error or not.
+	for _, mode := range receiveModesForTests {
+		t.Run(mode.Name, func(t *testing.T) {
+			fakeAMQPReceiver := &internal.FakeAMQPReceiver{
+				ReceiveResults: []struct {
+					M *amqp.Message
+					E error
+				}{
+					{E: context.DeadlineExceeded},
+				},
+				DrainCreditImpl: func(ctx context.Context) error {
+					// simulate the "drain never comes back" situation.
+					// We have a timer now that stops it from hanging forever.
+					<-ctx.Done()
+					return ctx.Err()
+				},
+			}
+
+			fakeAMQPLinks := &internal.FakeAMQPLinks{
+				Receiver: fakeAMQPReceiver,
+			}
+
+			receiver, err := newReceiver(newReceiverArgs{
+				ns:     &internal.FakeNS{AMQPLinks: fakeAMQPLinks},
+				entity: entity{Queue: "queue"},
+			}, &ReceiverOptions{ReceiveMode: mode.Val})
+			require.NoError(t, err)
+
+			messages, err := receiver.ReceiveMessages(context.Background(), 2, nil)
+			// the timeout occurred in drain. This isn't fatal to the user, even if we received
+			// _no_ messages.
+			require.NoError(t, err)
+			require.Empty(t, messages)
+
+			require.Equal(t, 1, fakeAMQPReceiver.DrainCalled, "drain was called")
+
+			// since ReceiveAndDelete messages would be lost we always flush any messages that might
+			// be sitting in the link before we throw the instance away.
+			require.Equal(t, 1, fakeAMQPReceiver.PrefetchedCalled, "prefetched before throwing away the broken link")
+
+			// a drain timeout means we need to close our links as we no longer know the true state of it.
+			require.Equal(t, 1, fakeAMQPLinks.Closed, "links are closed using Close(), not CloseIfNeeded()")
+			require.Equal(t, 0, fakeAMQPLinks.CloseIfNeededCalled, "links are not closed using CloseIfNeeded()")
+		})
+	}
+}
+
 func TestReceiver_ReceiveMessages_AllMessagesReceived(t *testing.T) {
 	for _, mode := range receiveModesForTests {
 		t.Run(mode.Name, func(t *testing.T) {
@@ -251,18 +301,41 @@ func TestReceiver_ReceiveMessages_SomeMessagesAndError(t *testing.T) {
 }
 
 func TestReceiverCancellationUnitTests(t *testing.T) {
-	r := &Receiver{
-		amqpLinks: &internal.FakeAMQPLinks{
-			Receiver: &internal.FakeAMQPReceiver{},
-		},
-	}
+	t.Run("ImmediatelyCancelled", func(t *testing.T) {
+		r := &Receiver{
+			amqpLinks: &internal.FakeAMQPLinks{
+				Receiver: &internal.FakeAMQPReceiver{},
+			},
+		}
 
-	ctx, cancel := context.WithCancel(context.Background())
-	cancel()
+		ctx, cancel := context.WithCancel(context.Background())
+		cancel()
+
+		msgs, err := r.ReceiveMessages(ctx, 95, nil)
+		require.Empty(t, msgs)
+		require.True(t, internal.IsCancelError(err))
+	})
+
+	t.Run("CancelledWhileReceiving", func(t *testing.T) {
+		ctx, cancel := context.WithCancel(context.Background())
+
+		r := &Receiver{
+			defaultTimeAfterFirstMsg: time.Second,
+			defaultDrainTimeout:      time.Second,
+			amqpLinks: &internal.FakeAMQPLinks{
+				Receiver: &internal.FakeAMQPReceiver{
+					ReceiveFn: func(ctx context.Context) (*amqp.Message, error) {
+						cancel()
+						return nil, ctx.Err()
+					},
+				},
+			},
+		}
 
-	msgs, err := r.ReceiveMessages(ctx, 95, nil)
-	require.Empty(t, msgs)
-	require.True(t, internal.IsCancelError(err))
+		msgs, err := r.ReceiveMessages(ctx, 95, nil)
+		require.Empty(t, msgs)
+		require.ErrorIs(t, err, context.Canceled)
+	})
 }
 
 func TestReceiverOptions(t *testing.T) {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_attacheddatanetworks_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_attacheddatanetworks_client_test.go
index b3872f4dda..3d34c07647 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_attacheddatanetworks_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_attacheddatanetworks_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkDelete.json
 func ExampleAttachedDataNetworksClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -42,7 +42,7 @@ func ExampleAttachedDataNetworksClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkGet.json
 func ExampleAttachedDataNetworksClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -62,7 +62,7 @@ func ExampleAttachedDataNetworksClient_Get() {
 	log.Printf("Response result: %#v\n", res.AttachedDataNetworksClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkCreate.json
 func ExampleAttachedDataNetworksClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -115,7 +115,7 @@ func ExampleAttachedDataNetworksClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.AttachedDataNetworksClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkUpdateTags.json
 func ExampleAttachedDataNetworksClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -141,7 +141,7 @@ func ExampleAttachedDataNetworksClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.AttachedDataNetworksClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkListByPacketCoreDataPlane.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/AttachedDataNetworkListByPacketCoreDataPlane.json
 func ExampleAttachedDataNetworksClient_ListByPacketCoreDataPlane() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_datanetworks_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_datanetworks_client_test.go
index b14fdd231a..65bb07a325 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_datanetworks_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_datanetworks_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkDelete.json
 func ExampleDataNetworksClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -41,7 +41,7 @@ func ExampleDataNetworksClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkGet.json
 func ExampleDataNetworksClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -60,7 +60,7 @@ func ExampleDataNetworksClient_Get() {
 	log.Printf("Response result: %#v\n", res.DataNetworksClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkCreate.json
 func ExampleDataNetworksClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -89,7 +89,7 @@ func ExampleDataNetworksClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.DataNetworksClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkUpdateTags.json
 func ExampleDataNetworksClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -114,7 +114,7 @@ func ExampleDataNetworksClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.DataNetworksClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkListByMobileNetwork.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/DataNetworkListByMobileNetwork.json
 func ExampleDataNetworksClient_ListByMobileNetwork() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_mobilenetworks_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_mobilenetworks_client_test.go
index 4415169828..12549a4e5e 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_mobilenetworks_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_mobilenetworks_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkDelete.json
 func ExampleMobileNetworksClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -40,7 +40,7 @@ func ExampleMobileNetworksClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkGet.json
 func ExampleMobileNetworksClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -58,7 +58,7 @@ func ExampleMobileNetworksClient_Get() {
 	log.Printf("Response result: %#v\n", res.MobileNetworksClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkCreate.json
 func ExampleMobileNetworksClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -89,7 +89,7 @@ func ExampleMobileNetworksClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.MobileNetworksClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkUpdateTags.json
 func ExampleMobileNetworksClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -113,7 +113,7 @@ func ExampleMobileNetworksClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.MobileNetworksClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkListBySubscription.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkListBySubscription.json
 func ExampleMobileNetworksClient_ListBySubscription() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -136,7 +136,7 @@ func ExampleMobileNetworksClient_ListBySubscription() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkListByResourceGroup.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/MobileNetworkListByResourceGroup.json
 func ExampleMobileNetworksClient_ListByResourceGroup() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_operations_client_test.go
index d7e396a907..cfc7d5e740 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_operations_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_operations_client_test.go
@@ -16,7 +16,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/OperationList.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/OperationList.json
 func ExampleOperationsClient_List() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcorecontrolplanes_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcorecontrolplanes_client_test.go
index 6cd18816cf..77953d98bc 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcorecontrolplanes_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcorecontrolplanes_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneDelete.json
 func ExamplePacketCoreControlPlanesClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -40,7 +40,7 @@ func ExamplePacketCoreControlPlanesClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneGet.json
 func ExamplePacketCoreControlPlanesClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -58,7 +58,7 @@ func ExamplePacketCoreControlPlanesClient_Get() {
 	log.Printf("Response result: %#v\n", res.PacketCoreControlPlanesClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneCreate.json
 func ExamplePacketCoreControlPlanesClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -96,7 +96,7 @@ func ExamplePacketCoreControlPlanesClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.PacketCoreControlPlanesClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneUpdateTags.json
 func ExamplePacketCoreControlPlanesClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -120,7 +120,7 @@ func ExamplePacketCoreControlPlanesClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.PacketCoreControlPlanesClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneListBySubscription.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneListBySubscription.json
 func ExamplePacketCoreControlPlanesClient_ListBySubscription() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -143,7 +143,7 @@ func ExamplePacketCoreControlPlanesClient_ListBySubscription() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneListByResourceGroup.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreControlPlaneListByResourceGroup.json
 func ExamplePacketCoreControlPlanesClient_ListByResourceGroup() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcoredataplanes_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcoredataplanes_client_test.go
index cccf2bac69..d8e120df75 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcoredataplanes_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_packetcoredataplanes_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneDelete.json
 func ExamplePacketCoreDataPlanesClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -41,7 +41,7 @@ func ExamplePacketCoreDataPlanesClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneGet.json
 func ExamplePacketCoreDataPlanesClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -60,7 +60,7 @@ func ExamplePacketCoreDataPlanesClient_Get() {
 	log.Printf("Response result: %#v\n", res.PacketCoreDataPlanesClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneCreate.json
 func ExamplePacketCoreDataPlanesClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -91,7 +91,7 @@ func ExamplePacketCoreDataPlanesClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.PacketCoreDataPlanesClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneUpdateTags.json
 func ExamplePacketCoreDataPlanesClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -116,7 +116,7 @@ func ExamplePacketCoreDataPlanesClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.PacketCoreDataPlanesClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneListByPacketCoreControlPlane.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/PacketCoreDataPlaneListByPacketCoreControlPlane.json
 func ExamplePacketCoreDataPlanesClient_ListByPacketCoreControlPlane() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_services_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_services_client_test.go
index 8922b058b5..442f75d89b 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_services_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_services_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceDelete.json
 func ExampleServicesClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -41,7 +41,7 @@ func ExampleServicesClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceGet.json
 func ExampleServicesClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -60,7 +60,7 @@ func ExampleServicesClient_Get() {
 	log.Printf("Response result: %#v\n", res.ServicesClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceCreate.json
 func ExampleServicesClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -125,7 +125,7 @@ func ExampleServicesClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.ServicesClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceUpdateTags.json
 func ExampleServicesClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -150,7 +150,7 @@ func ExampleServicesClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.ServicesClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceListByMobileNetwork.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/ServiceListByMobileNetwork.json
 func ExampleServicesClient_ListByMobileNetwork() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_simpolicies_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_simpolicies_client_test.go
index 7981e8e25b..1203b186a5 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_simpolicies_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_simpolicies_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyDelete.json
 func ExampleSimPoliciesClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -41,7 +41,7 @@ func ExampleSimPoliciesClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyGet.json
 func ExampleSimPoliciesClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -60,7 +60,7 @@ func ExampleSimPoliciesClient_Get() {
 	log.Printf("Response result: %#v\n", res.SimPoliciesClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyCreate.json
 func ExampleSimPoliciesClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -125,7 +125,7 @@ func ExampleSimPoliciesClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.SimPoliciesClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyUpdateTags.json
 func ExampleSimPoliciesClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -150,7 +150,7 @@ func ExampleSimPoliciesClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.SimPoliciesClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyListByMobileNetwork.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimPolicyListByMobileNetwork.json
 func ExampleSimPoliciesClient_ListByMobileNetwork() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sims_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sims_client_test.go
index 4f282637e9..47796caca8 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sims_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sims_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimDelete.json
 func ExampleSimsClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -40,7 +40,7 @@ func ExampleSimsClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimGet.json
 func ExampleSimsClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -58,7 +58,7 @@ func ExampleSimsClient_Get() {
 	log.Printf("Response result: %#v\n", res.SimsClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimCreate.json
 func ExampleSimsClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -108,7 +108,7 @@ func ExampleSimsClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.SimsClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimUpdateTags.json
 func ExampleSimsClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -132,7 +132,7 @@ func ExampleSimsClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.SimsClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimListBySubscription.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimListBySubscription.json
 func ExampleSimsClient_ListBySubscription() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -155,7 +155,7 @@ func ExampleSimsClient_ListBySubscription() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimListByResourceGroup.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SimListByResourceGroup.json
 func ExampleSimsClient_ListByResourceGroup() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sites_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sites_client_test.go
index 0034e39568..d23eb8ca2c 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sites_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_sites_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteDelete.json
 func ExampleSitesClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -41,7 +41,7 @@ func ExampleSitesClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteGet.json
 func ExampleSitesClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -60,7 +60,7 @@ func ExampleSitesClient_Get() {
 	log.Printf("Response result: %#v\n", res.SitesClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteCreate.json
 func ExampleSitesClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -92,7 +92,7 @@ func ExampleSitesClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.SitesClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteUpdateTags.json
 func ExampleSitesClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -117,7 +117,7 @@ func ExampleSitesClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.SitesClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteListByMobileNetwork.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SiteListByMobileNetwork.json
 func ExampleSitesClient_ListByMobileNetwork() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
diff --git a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_slices_client_test.go b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_slices_client_test.go
index 0d6065ef3f..566f0a4b8f 100644
--- a/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_slices_client_test.go
+++ b/sdk/resourcemanager/mobilenetwork/armmobilenetwork/ze_generated_example_slices_client_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mobilenetwork/armmobilenetwork"
 )
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceDelete.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceDelete.json
 func ExampleSlicesClient_BeginDelete() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -41,7 +41,7 @@ func ExampleSlicesClient_BeginDelete() {
 	}
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceGet.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceGet.json
 func ExampleSlicesClient_Get() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -60,7 +60,7 @@ func ExampleSlicesClient_Get() {
 	log.Printf("Response result: %#v\n", res.SlicesClientGetResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceCreate.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceCreate.json
 func ExampleSlicesClient_BeginCreateOrUpdate() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -93,7 +93,7 @@ func ExampleSlicesClient_BeginCreateOrUpdate() {
 	log.Printf("Response result: %#v\n", res.SlicesClientCreateOrUpdateResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceUpdateTags.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceUpdateTags.json
 func ExampleSlicesClient_UpdateTags() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
@@ -118,7 +118,7 @@ func ExampleSlicesClient_UpdateTags() {
 	log.Printf("Response result: %#v\n", res.SlicesClientUpdateTagsResult)
 }
 
-// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceListByMobileNetwork.json
+// x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-03-01-preview/examples/SliceListByMobileNetwork.json
 func ExampleSlicesClient_ListByMobileNetwork() {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {