Skip to content

Commit e400f97

Browse files
authored
Merge pull request #26048 from yifanz7/merge
[Storage] [Do Not Squash] Merge recent changes from main to Az.Storage-preview
2 parents 6a72411 + f423d3d commit e400f97

File tree

2,395 files changed

+310697
-191352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,395 files changed

+310697
-191352
lines changed

.azure-pipelines/daily-build.yml

+21-6
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,15 @@ jobs:
7676
custom: msbuild
7777
arguments: 'build.proj /t:Build /p:Configuration=Release;TurnOnTestCoverage=true;ModifiedModuleBuild=true'
7878

79-
- task: EsrpCodeSigning@4
79+
- task: EsrpCodeSigning@5
8080
displayName: "Sign Dll [Authenticode + Strong Name]"
8181
inputs:
82-
ConnectedServiceName: '$(signServiceConnection)'
82+
ConnectedServiceName: '$(ESRPServiceConnectionName)'
83+
AppRegistrationClientId: '$(ESRPAppClientId)'
84+
AppRegistrationTenantId: '$(ESRPAppTenantId)'
85+
AuthAKVName: '$(ESRPKVName)'
86+
AuthCertName: '$(ESRPAuthCertName)'
87+
AuthSignCertName: '$(ESRPSignCertName)'
8388
FolderPath: 'artifacts'
8489
Pattern: |
8590
Release/**/Microsoft*Azure*PowerShell*.dll
@@ -128,10 +133,15 @@ jobs:
128133
SessionTimeout: '60'
129134
MaxConcurrency: '50'
130135
MaxRetryAttempts: '5'
131-
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4
136+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
132137
displayName: "Sign Scripts [Authenticode]"
133138
inputs:
134-
ConnectedServiceName: '$(signServiceConnection)'
139+
ConnectedServiceName: '$(ESRPServiceConnectionName)'
140+
AppRegistrationClientId: '$(ESRPAppClientId)'
141+
AppRegistrationTenantId: '$(ESRPAppTenantId)'
142+
AuthAKVName: '$(ESRPKVName)'
143+
AuthCertName: '$(ESRPAuthCertName)'
144+
AuthSignCertName: '$(ESRPSignCertName)'
135145
FolderPath: 'artifacts'
136146
Pattern: |
137147
Release/**/*.ps1
@@ -164,10 +174,15 @@ jobs:
164174
"ToolVersion": "1.0"
165175
}
166176
]
167-
- task: EsrpCodeSigning@4
177+
- task: EsrpCodeSigning@5
168178
displayName: 'Sign 3rd Party [Strong Name]'
169179
inputs:
170-
ConnectedServiceName: '$(signServiceConnection)'
180+
ConnectedServiceName: '$(ESRPServiceConnectionName)'
181+
AppRegistrationClientId: '$(ESRPAppClientId)'
182+
AppRegistrationTenantId: '$(ESRPAppTenantId)'
183+
AuthAKVName: '$(ESRPKVName)'
184+
AuthCertName: '$(ESRPAuthCertName)'
185+
AuthSignCertName: '$(ESRPSignCertName)'
171186
FolderPath: artifacts
172187
Pattern: 'Release/**/FuzzySharp.dll'
173188
UseMinimatch: true

.github/policies/resourceManagement.yml

+66-1
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,22 @@ configuration:
726726
- sgellock
727727
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
728728
assignMentionees: False
729+
- if:
730+
- or:
731+
- labelAdded:
732+
label: Service Attention
733+
- labelAdded:
734+
label: Cloud Service (Ext)
735+
- hasLabel:
736+
label: Service Attention
737+
- hasLabel:
738+
label: Cloud Service (Ext)
739+
then:
740+
- mentionUsers:
741+
mentionees:
742+
- hirenshah1
743+
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
744+
assignMentionees: False
729745
- if:
730746
- or:
731747
- labelAdded:
@@ -1026,6 +1042,22 @@ configuration:
10261042
- swmachan
10271043
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
10281044
assignMentionees: False
1045+
- if:
1046+
- or:
1047+
- labelAdded:
1048+
label: Service Attention
1049+
- labelAdded:
1050+
label: Cognitive Services
1051+
- hasLabel:
1052+
label: Service Attention
1053+
- hasLabel:
1054+
label: Cognitive Services
1055+
then:
1056+
- mentionUsers:
1057+
mentionees:
1058+
- gxy001
1059+
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
1060+
assignMentionees: False
10291061
- if:
10301062
- or:
10311063
- labelAdded:
@@ -1599,7 +1631,6 @@ configuration:
15991631
mentionees:
16001632
- edwinc
16011633
- mvvsubbu
1602-
- v-vyedavelly
16031634
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
16041635
assignMentionees: False
16051636
- if:
@@ -2370,6 +2401,23 @@ configuration:
23702401
- Lighthouse-Azure
23712402
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
23722403
assignMentionees: False
2404+
- if:
2405+
- or:
2406+
- labelAdded:
2407+
label: Service Attention
2408+
- labelAdded:
2409+
label: Management Groups
2410+
- hasLabel:
2411+
label: Service Attention
2412+
- hasLabel:
2413+
label: Management Groups
2414+
then:
2415+
- mentionUsers:
2416+
mentionees:
2417+
- rthorn17
2418+
- cemheren
2419+
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
2420+
assignMentionees: False
23732421
- if:
23742422
- or:
23752423
- labelAdded:
@@ -3374,6 +3422,23 @@ configuration:
33743422
- ricardo-espinoza
33753423
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
33763424
assignMentionees: False
3425+
- if:
3426+
- or:
3427+
- labelAdded:
3428+
label: Service Attention
3429+
- labelAdded:
3430+
label: Quota
3431+
- hasLabel:
3432+
label: Service Attention
3433+
- hasLabel:
3434+
label: Quota
3435+
then:
3436+
- mentionUsers:
3437+
mentionees:
3438+
- rahuls-microsoft
3439+
- devatula
3440+
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
3441+
assignMentionees: False
33773442
- if:
33783443
- or:
33793444
- labelAdded:

documentation/development-docs/design-guidelines/managed-identity-best-practices.md

+29
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,32 @@ We are recommended to use string array as the type of UserAssignedIdentity with
5858
- No syntax changes if service supports one more user assigned identity in future;
5959
- Service will provide correct error response if customer reaches the count limitation of `UserAssignedIdentity` ideally, which means no harm.
6060

61+
### How to disable transforming IdentityType and UserAssignedIdentity to avoid breaking changes when migrate from autorest.powershell v3 to v4.
62+
See details at [here](https://github.com/Azure/autorest.powershell/blob/main/docs/migration-from-v3-to-v4.md#how-to-mitigate-the-breaking-changes-of-managed-identity-best-practice-alignment).
63+
64+
### What should I do to mitigate one patch operation which is reported to parameter IdentityType can not be transformed as the best practice design?
65+
66+
autorest.powershell is unable to transform IdentityType as the best practice design for certain reasons. To mitigate this issue,
67+
- Include a customization script to transform the parameter IdentityType to EnableSystemAssignedIdentity by `get` + `patch` update for this type of operation. The following are the detailed steps on how to accomplish this.
68+
- disable transformation for the operation which reported error in README.md by
69+
```
70+
disable-transform-identity-type-for-operation
71+
- Operation_id
72+
```
73+
- hide the corresponding Update cmdlet in directive by
74+
```
75+
- where:
76+
verb: Update
77+
subject: {Subject-Name}
78+
hide: true
79+
```
80+
- run `autorest` and `./build-module.ps1`
81+
- manually change IdentityType to EnableSystemAssignedIdentity<bool> in `Update-Az{ModuleName}{Subject-Name}` like
82+
```
83+
[Parameter()]
84+
[Microsoft.Azure.PowerShell.Cmdlets.{ModuleName}.Category('Body')]
85+
[System.Nullable[System.Boolean]]
86+
# Decides if enable a system assigned identity for the resource.
87+
${EnableSystemAssignedIdentity},
88+
```
89+
- calculate the value of IdentityType as swagger defined in process block, see [instance](https://github.com/Azure/azure-powershell/blob/827001c79c4416e0b74f5857c2ad72b7932b1f9a/src/Astro/Astro.Autorest/custom/Update-AzAstroOrganization.ps1#L269) for Update-Az{ModuleName}{Subject-Name}.

documentation/migration-guides/Az.7.0.0-migration-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ The `-DisplayName` parameter was removed.
272272

273273
#### Before
274274
```powershell
275-
PS C:\> New-AzManagedServicesDefinition -DisplayName "MyTestDefinition" -ManagedByTenantId 72f9acbf-86f1-41af-91ab-2d7ef011db47 -RoleDefinitionId acdd72a7-3385-48ef-bd42-f606fba81ae7 -PrincipalId 714160ec-87d5-42bb-8b17-287c0dd7417d
275+
PS C:\> New-AzManagedServicesDefinition -DisplayName "MyTestDefinition" -ManagedByTenantId 00001111-aaaa-2222-bbbb-3333cccc4444 -RoleDefinitionId acdd72a7-3385-48ef-bd42-f606fba81ae7 -PrincipalId 714160ec-87d5-42bb-8b17-287c0dd7417d
276276
```
277277
#### After
278278
```powershell

src/Compute/Compute.Test/ScenarioTests/VirtualMachineScaleSetTests.cs

+7
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,13 @@ public void TestVirtualMachineScaleSetDefaultImgWhenStandard()
424424
TestRunner.RunTestScript("Test-VirtualMachineScaleSetDefaultImgWhenStandard");
425425
}
426426

427+
[Fact]
428+
[Trait(Category.AcceptanceType, Category.CheckIn)]
429+
public void TestVirtualMachineScaleSetSkuProfile()
430+
{
431+
TestRunner.RunTestScript("Test-VirtualMachineScaleSetSkuProfile");
432+
}
433+
427434
[Fact]
428435
[Trait(Category.AcceptanceType, Category.CheckIn)]
429436
public void TestResiliencyPolicyVMSS()

src/Compute/Compute.Test/ScenarioTests/VirtualMachineScaleSetTests.ps1

+152
Original file line numberDiff line numberDiff line change
@@ -5314,6 +5314,158 @@ function Test-VirtualMachineScaleSetDefaultImgWhenStandard
53145314
}
53155315
}
53165316

5317+
<#
5318+
.SYNOPSIS
5319+
Test Virtual Machine Scale Set with SkuProfile
5320+
#>
5321+
function Test-VirtualMachineScaleSetSkuProfile
5322+
{
5323+
# Setup
5324+
$rgname = Get-ComputeTestResourceName
5325+
$loc = Get-ComputeVMLocation;
5326+
5327+
# Basic case
5328+
try
5329+
{
5330+
# Common
5331+
New-AzResourceGroup -Name $rgname -Location $loc -Force;
5332+
5333+
$vmssName = 'vs' + $rgname;
5334+
5335+
$domainNameLabel1 = "d1" + $rgname;
5336+
$enable = $true;
5337+
$adminUsername = Get-ComputeTestResourceName;
5338+
$password = Get-PasswordForVM;
5339+
$adminPassword = $password | ConvertTo-SecureString -AsPlainText -Force;
5340+
$cred = New-Object System.Management.Automation.PSCredential ($adminUsername, $adminPassword);
5341+
5342+
$vmss = New-AzVmss -ResourceGroupName $rgname -Credential $cred -VMScaleSetName $vmssName -DomainNameLabel $domainNameLabel1 `
5343+
-VMSize "Mix" -SkuProfileVmSize @("Standard_D4s_v3", "Standard_D4s_v4");
5344+
5345+
Assert-AreEqual $vmss.OrchestrationMode "Flexible";
5346+
Assert-AreEqual $vmss.Sku.Name "Mix";
5347+
Assert-AreEqual $vmss.SkuProfile.AllocationStrategy "LowestPrice";
5348+
Assert-AreEqual $vmss.SkuProfile.VMSizes[0].Name "Standard_D4s_v3";
5349+
Assert-AreEqual $vmss.SkuProfile.VMSizes[1].Name "Standard_D4s_v4";
5350+
}
5351+
finally
5352+
{
5353+
# Cleanup
5354+
Clean-ResourceGroup $rgname
5355+
}
5356+
5357+
# Changing allocation strategy
5358+
try
5359+
{
5360+
# Common
5361+
New-AzResourceGroup -Name $rgname -Location $loc -Force;
5362+
5363+
$vmssName = 'vs' + $rgname;
5364+
5365+
$domainNameLabel1 = "d1" + $rgname;
5366+
$enable = $true;
5367+
$adminUsername = Get-ComputeTestResourceName;
5368+
$password = Get-PasswordForVM;
5369+
$adminPassword = $password | ConvertTo-SecureString -AsPlainText -Force;
5370+
$cred = New-Object System.Management.Automation.PSCredential ($adminUsername, $adminPassword);
5371+
5372+
$vmss = New-AzVmss -ResourceGroupName $rgname -Credential $cred -VMScaleSetName $vmssName -DomainNameLabel $domainNameLabel1 `
5373+
-SkuProfileVmSize @("Standard_D4s_v3", "Standard_D4s_v4") -SkuProfileAllocationStrategy "CapacityOptimized";
5374+
5375+
Assert-AreEqual $vmss.OrchestrationMode "Flexible";
5376+
Assert-AreEqual $vmss.Sku.Name "Mix";
5377+
Assert-AreEqual $vmss.SkuProfile.AllocationStrategy "CapacityOptimized";
5378+
Assert-AreEqual $vmss.SkuProfile.VMSizes[0].Name "Standard_D4s_v3";
5379+
Assert-AreEqual $vmss.SkuProfile.VMSizes[1].Name "Standard_D4s_v4";
5380+
}
5381+
finally
5382+
{
5383+
# Cleanup
5384+
Clean-ResourceGroup $rgname
5385+
}
5386+
5387+
# With azvmss config and update
5388+
try
5389+
{
5390+
# Common
5391+
New-AzResourceGroup -Name $rgname -Location $loc -Force;
5392+
5393+
$vmssName = 'vs' + $rgname;
5394+
5395+
$domainNameLabel1 = "d1" + $rgname;
5396+
$enable = $true;
5397+
$adminUsername = Get-ComputeTestResourceName;
5398+
$password = Get-PasswordForVM;
5399+
$adminPassword = $password | ConvertTo-SecureString -AsPlainText -Force;
5400+
$cred = New-Object System.Management.Automation.PSCredential ($adminUsername, $adminPassword);
5401+
5402+
$vmss = New-AzVmssConfig -Location $loc -Zone "1" -SkuCapacity 2 -SkuName 'Mix' -SkuProfileVmSize @("Standard_D4s_v3", "Standard_D4s_v4");
5403+
5404+
Assert-AreEqual $vmss.Sku.Name "Mix";
5405+
Assert-AreEqual $vmss.SkuProfile.AllocationStrategy "LowestPrice";
5406+
Assert-AreEqual $vmss.SkuProfile.VMSizes[0].Name "Standard_D4s_v3";
5407+
Assert-AreEqual $vmss.SkuProfile.VMSizes[1].Name "Standard_D4s_v4";
5408+
5409+
$vmss = New-AzVmssConfig -Location $loc -Zone "1" -SkuCapacity 2 -SkuProfileVmSize @("Standard_D4s_v3", "Standard_D4s_v4") -SkuProfileAllocationStrategy "CapacityOptimized";
5410+
5411+
Assert-AreEqual $vmss.Sku.Name "Mix";
5412+
Assert-AreEqual $vmss.SkuProfile.AllocationStrategy "CapacityOptimized";
5413+
Assert-AreEqual $vmss.SkuProfile.VMSizes[0].Name "Standard_D4s_v3";
5414+
Assert-AreEqual $vmss.SkuProfile.VMSizes[1].Name "Standard_D4s_v4";
5415+
5416+
$stnd = "Standard";
5417+
$ipName = Get-ComputeTestResourceName
5418+
5419+
# SRP
5420+
$stoname = 'sto' + $rgname;
5421+
$stotype = 'Standard_GRS';
5422+
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype;
5423+
$stoaccount = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;
5424+
5425+
# NRP
5426+
$subnet = New-AzVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24";
5427+
$vnet = New-AzVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -Subnet $subnet;
5428+
$vnet = Get-AzVirtualNetwork -Name ('vnet' + $rgname) -ResourceGroupName $rgname;
5429+
$subnetId = $vnet.Subnets[0].Id;
5430+
5431+
# New VMSS Parameters
5432+
$cred = New-Object System.Management.Automation.PSCredential ($adminUsername, $adminPassword);
5433+
5434+
$imgRef = Get-DefaultCRPImage -loc $loc -New $True;
5435+
$ipCfg = New-AzVmssIPConfig -Name 'test' -SubnetId $subnetId -PublicIPAddressConfigurationName $ipName -PublicIPAddressConfigurationIdleTimeoutInMinutes 10 -DnsSetting "testvmssdnscom" -PublicIPAddressVersion "IPv4";
5436+
5437+
$vmss = New-AzVmssConfig -Location $loc -SkuCapacity 2 -UpgradePolicyMode 'Manual' -EncryptionAtHost -SecurityType $stnd -SkuProfileVmSize @("Standard_D4s_v3", "Standard_D4s_v4") -SkuProfileAllocationStrategy "CapacityOptimized"`
5438+
| Add-AzVmssNetworkInterfaceConfiguration -Name 'test' -Primary $true -IPConfiguration $ipCfg `
5439+
| Set-AzVmssOSProfile -ComputerNamePrefix 'test' -AdminUsername $adminUsername -AdminPassword $adminPassword `
5440+
| Set-AzVmssStorageProfile -OsDiskCreateOption 'FromImage' -OsDiskCaching 'None' `
5441+
-ImageReferenceOffer $imgRef.Offer -ImageReferenceSku $imgRef.Skus -ImageReferenceVersion 'latest' `
5442+
-ImageReferencePublisher $imgRef.PublisherName;
5443+
5444+
# creating new-azvmss using New-VmssConfig
5445+
$vmssResult = New-AzVmss -ResourceGroupName $rgname -Name $vmssName -VirtualMachineScaleSet $vmss
5446+
5447+
Assert-AreEqual $vmssResult.Sku.Name "Mix";
5448+
Assert-AreEqual $vmssResult.SkuProfile.AllocationStrategy "CapacityOptimized";
5449+
Assert-AreEqual $vmssResult.SkuProfile.VMSizes[0].Name "Standard_D4s_v3";
5450+
Assert-AreEqual $vmssResult.SkuProfile.VMSizes[1].Name "Standard_D4s_v4";
5451+
5452+
# update vmss
5453+
$vmssUpdate = Update-AzVmss -ResourceGroupName $rgname -Name $vmssName -SkuCapacity 3 -SkuProfileVmSize @($vmSize1, $vmSize2) -SkuProfileAllocationStrategy "CapacityOptimized";
5454+
5455+
$vmssGet = Get-AzVmss -ResourceGroupName $rgname -VMScaleSetName $vmssName;
5456+
5457+
Assert-AreEqual $vmssGet.Sku.Name "Mix";
5458+
Assert-AreEqual $vmssGet.SkuProfile.AllocationStrategy "CapacityOptimized";
5459+
Assert-AreEqual $vmssGet.SkuProfile.VMSizes[0].Name "Standard_D4s_v3";
5460+
Assert-AreEqual $vmssGet.SkuProfile.VMSizes[1].Name "Standard_D4s_v4";
5461+
}
5462+
finally
5463+
{
5464+
# Cleanup
5465+
Clean-ResourceGroup $rgname
5466+
}
5467+
}
5468+
53175469
<#
53185470
.SYNOPSIS
53195471
Create a VMSS using New-Azvmssconfig

0 commit comments

Comments
 (0)