Skip to content

Az.Migrate - New-AzMigrateServerReplication - Minor change to switch deprecated Get-AzVMSize -loc to Get-AzComputeResourceSKU -loc #28019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ function New-AzMigrateServerReplication {
$null = $PSBoundParameters.Remove('ResourceName')
$null = $PSBoundParameters.Remove('SubscriptionId')
$null = $PSBoundParameters.Add('Location', $TargetRegion)
$allAvailableSkus = Get-AzVMSize @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
#Get-AzVMSku -Location is deprecated, replicate using Get-AzComputeResourceSKU and a where clause
$allAvailableSkus = Get-AzComputeResourceSKU @PSBoundParameters| Where-Object { $_.ResourceType.Contains("virtualMachines") }
if ($null -ne $allAvailableSkus) {
$matchingComputeSku = $allAvailableSkus | Where-Object { $_.Name -eq $TargetVMSize }
if ($null -ne $matchingComputeSku) {
Expand Down Expand Up @@ -747,4 +748,4 @@ public static int hashForArtifact(String artifact)

}

}
}
3 changes: 2 additions & 1 deletion src/Migrate/Migrate/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release

* Fixed bugs in `New-AzMigrateServerReplication` caused by deprecation of `Get-AzVmSize -location`

## Version 2.8.0
* Implemented the Get-AzMigrateServerMigrationStatus cmdlet to retrieve the replication status of servers in Azure Migrate.
* Fixed bugs in `New-AzMigrateLocalServerReplication` that caused HyperVSite or VMwareSite not found.
Expand Down