Skip to content

Commit 45148ef

Browse files
Migrate Storage from generation-Storage-preview to Az.Storage-preview (#25494)
* Move Storage to Az.Storage-preview * Update ChangeLog.md --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent 180fbc0 commit 45148ef

File tree

333 files changed

+39621
-998
lines changed

Some content is hidden

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

333 files changed

+39621
-998
lines changed

src/Storage/Storage.Autorest/Az.Storage.format.ps1xml

Lines changed: 458 additions & 0 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Autorest/Az.Storage.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.Storage.private.dll'
1313
FormatsToProcess = './Az.Storage.format.ps1xml'
14-
FunctionsToExport = 'Get-AzStorageAccountMigration', 'Start-AzStorageAccountMigration'
14+
FunctionsToExport = 'Get-AzStorageAccountMigration', 'Get-AzStorageTaskAssignment', 'Get-AzStorageTaskAssignmentInstancesReport', 'New-AzStorageTaskAssignment', 'Remove-AzStorageTaskAssignment', 'Start-AzStorageAccountMigration', 'Update-AzStorageTaskAssignment'
1515
PrivateData = @{
1616
PSData = @{
1717
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Storage'

src/Storage/Storage.Autorest/README.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ For information on how to develop for `Az.Storage`, see [how-to.md](how-to.md).
2828
2929
``` yaml
3030
# Please specify the commit id that includes your features to make sure generated codes stable.
31-
commit: 3e6b4ddca225530c27273d0f816466a905c0151b
31+
commit: db377f47cf7bf53bf077aa42967112a9783980d5
3232
require:
3333
# readme.azure.noprofile.md is the common configuration file
3434
- $(this-folder)/../../readme.azure.noprofile.md
3535
input-file:
36-
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/storage.json
36+
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/storage.json
37+
- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/storageTaskAssignments.json
3738

3839
# For new RP, the version is 0.1.0
3940
module-version: 5.9.1
@@ -44,6 +45,12 @@ nested-object-to-string: true
4445
identity-correction-for-post: true
4546

4647
directive:
48+
- where:
49+
variant: ^(Create|Update)(?!.*?Expanded|JsonFilePath|JsonString)
50+
remove: true
51+
- where:
52+
variant: ^CreateViaIdentity.*$
53+
remove: true
4754
- where:
4855
subject: ^StorageAccountCustomerInitiatedMigration$
4956
set:
@@ -64,4 +71,61 @@ directive:
6471
- where:
6572
subject: ^StorageAccount$|^StorageAccountKey$|^StorageAccountProperty$|^StorageAccountSas$|^StorageAccountServiceSas$|BlobInventoryPolicy$|^DeletedAccount$|^EncryptionScope$|^LocalUser$|^LocalUserKey$|^ManagementPolicy$|^ObjectReplicationPolicy$|^Sku$|^Usage$|^LocalUserPassword$|^AccountUserDelegationKey$|^AbortStorageAccountHierarchicalNamespaceMigration$|^HierarchicalStorageAccountNamespaceMigration$|^StorageAccountBlobRange$|^StorageAccountUserDelegationKey$|^StorageAccountNameAvailability$
6673
remove: true
74+
- where:
75+
parameter-name: ParameterEndBy
76+
set:
77+
parameter-name: EndBy
78+
- where:
79+
parameter-name: ParameterInterval
80+
set:
81+
parameter-name: Interval
82+
- where:
83+
parameter-name: ParameterIntervalUnit
84+
set:
85+
parameter-name: IntervalUnit
86+
- where:
87+
parameter-name: ParameterStartFrom
88+
set:
89+
parameter-name: StartFrom
90+
- where:
91+
parameter-name: ParameterStartOn
92+
set:
93+
parameter-name: StartOn
94+
- where:
95+
property-name: ParameterEndBy
96+
set:
97+
property-name: EndBy
98+
- where:
99+
property-name: ParameterInterval
100+
set:
101+
property-name: Interval
102+
- where:
103+
property-name: ParameterIntervalUnit
104+
set:
105+
property-name: IntervalUnit
106+
- where:
107+
property-name: ParameterStartFrom
108+
set:
109+
property-name: StartFrom
110+
- where:
111+
property-name: ParameterStartOn
112+
set:
113+
property-name: StartOn
114+
- from: storageTaskAssignments.json
115+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/reports"].get
116+
transform: >
117+
$["operationId"] = "StorageTaskAssignmentInstancesReport_List"
118+
# Renaming the operationId to StorageTaskAssignmentInstancesReport_Get, but the operation actually lists all the reports under a specific storage task assignment.
119+
- from: storageTaskAssignments.json
120+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}/reports"].get
121+
transform: >
122+
$["operationId"] = "StorageTaskAssignmentInstancesReport_Get"
123+
- from: storageTaskAssignments.json
124+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}/reports"].get
125+
transform: >
126+
$["operationId"] = "StorageTaskAssignmentInstancesReport_Get"
127+
- where:
128+
model-name: StorageTaskReportInstance
129+
set:
130+
suppress-format: true
67131
```

src/Storage/Storage.Autorest/UX/Microsoft.Storage/storageAccounts-accountMigrations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "storageAccounts/accountMigrations",
3-
"apiVersion": "2023-01-01",
3+
"apiVersion": "2023-05-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.storage"
66
},
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"resourceType": "storageAccounts/storageTaskAssignments",
3+
"apiVersion": "2023-05-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.storage"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzStorageTaskAssignment",
10+
"description": "Get the storage task assignment properties",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.storage/get-azstoragetaskassignment"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-AccountName <String>",
20+
"-Name <String>",
21+
"-ResourceGroupName <String>",
22+
"[-SubscriptionId <String[]>]"
23+
]
24+
}
25+
]
26+
},
27+
"examples": [
28+
{
29+
"description": "Get the storage task assignment properties",
30+
"parameters": [
31+
{
32+
"name": "-AccountName",
33+
"value": "[Path.accountName]"
34+
},
35+
{
36+
"name": "-Name",
37+
"value": "[Path.storageTaskAssignmentName]"
38+
},
39+
{
40+
"name": "-ResourceGroupName",
41+
"value": "[Path.resourceGroupName]"
42+
},
43+
{
44+
"name": "-SubscriptionId",
45+
"value": "[Path.subscriptionId]"
46+
}
47+
]
48+
}
49+
]
50+
},
51+
{
52+
"name": "Remove-AzStorageTaskAssignment",
53+
"description": "Delete the storage task assignment sub-resource",
54+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}",
55+
"help": {
56+
"learnMore": {
57+
"url": "https://learn.microsoft.com/powershell/module/az.storage/remove-azstoragetaskassignment"
58+
},
59+
"parameterSets": [
60+
{
61+
"parameters": [
62+
"-AccountName <String>",
63+
"-Name <String>",
64+
"-ResourceGroupName <String>",
65+
"[-SubscriptionId <String>]"
66+
]
67+
}
68+
]
69+
},
70+
"examples": [
71+
{
72+
"description": "Delete the storage task assignment sub-resource",
73+
"parameters": [
74+
{
75+
"name": "-AccountName",
76+
"value": "[Path.accountName]"
77+
},
78+
{
79+
"name": "-Name",
80+
"value": "[Path.storageTaskAssignmentName]"
81+
},
82+
{
83+
"name": "-ResourceGroupName",
84+
"value": "[Path.resourceGroupName]"
85+
},
86+
{
87+
"name": "-SubscriptionId",
88+
"value": "[Path.subscriptionId]"
89+
}
90+
]
91+
}
92+
]
93+
}
94+
]
95+
}

src/Storage/Storage.Autorest/build-module.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1313
# is regenerated.
1414
# ----------------------------------------------------------------------------------
15-
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
15+
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
1616
$ErrorActionPreference = 'Stop'
1717

1818
if($PSEdition -ne 'Core') {
@@ -177,4 +177,14 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
177177
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
178178
}
179179

180+
if (-not $DisableAfterBuildTasks){
181+
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
182+
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
183+
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
184+
Write-Host -ForegroundColor Green 'Running after build tasks...'
185+
. $afterBuildTasksPath @afterBuildTasksArgs
186+
}
187+
}
188+
189+
180190
Write-Host -ForegroundColor Green '-------------Done-------------'
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
### Example 1: Get a task assignment
2+
```powershell
3+
Get-AzStorageTaskAssignment -ResourceGroupName myresourcegroup -AccountName myaccount -Name myassignment
4+
```
5+
6+
```output
7+
Description : This is a task assignment
8+
Enabled : True
9+
EndBy : 7/2/2025 6:17:38 AM
10+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount/storageTaskAssignments/myassignment
11+
Interval : 1
12+
IntervalUnit : days
13+
Name : myassignment
14+
ProvisioningState : Succeeded
15+
ReportPrefix : testc1
16+
ResourceGroupName : myresourcegroup
17+
RunStatusEnum :
18+
RunStatusError :
19+
RunStatusFinishTime :
20+
RunStatusObjectFailedCount :
21+
RunStatusObjectsOperatedOnCount :
22+
RunStatusObjectsSucceededCount :
23+
RunStatusObjectsTargetedCount :
24+
RunStatusRunResult :
25+
RunStatusStartTime :
26+
RunStatusStorageAccountId :
27+
RunStatusSummaryReportPath :
28+
RunStatusTaskAssignmentId :
29+
RunStatusTaskId :
30+
RunStatusTaskVersion :
31+
StartFrom : 7/2/2024 6:17:38 AM
32+
StartOn :
33+
TargetExcludePrefix : {}
34+
TargetPrefix : {test}
35+
TaskId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageActions/storageTasks/mystoragetask1
36+
TriggerType : OnSchedule
37+
Type : Microsoft.Storage/storageAccounts/storageTaskAssignments
38+
```
39+
40+
This command gets the task assignment "myassignment" under storage account "myaccount".
41+
42+
### Example 2: List task assignments under a storage account
43+
```powershell
44+
Get-AzStorageTaskAssignment -ResourceGroupName myresourcegroup -AccountName myaccount
45+
```
46+
47+
```output
48+
Name ResourceGroupName
49+
---- -----------------
50+
assignment1 myresourcegroup
51+
assignment2 myresourcegroup
52+
assignment3 myresourcegroup
53+
```
54+
55+
This command lists task assignments under the storage account "myaccount".
56+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
### Example 1: List the reports of a task assignment in an account
2+
```powershell
3+
Get-AzStorageTaskAssignmentInstancesReport -AccountName myaccount -ResourceGroupName myresourcegroup -StorageTaskAssignmentName mytaskassignment
4+
```
5+
6+
```output
7+
FinishTime : 2024-07-02T08:19:51.9238839Z
8+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount/storageTaskAssignments/mytaskassignment/reports/instance1
9+
Name : instance1
10+
ObjectFailedCount : 0
11+
ObjectsOperatedOnCount : 0
12+
ObjectsSucceededCount : 0
13+
ObjectsTargetedCount : 0
14+
RunResult : Succeeded
15+
RunStatusEnum : Finished
16+
RunStatusError : 0x0
17+
StartTime : 2024-07-02T08:10:55.0000000Z
18+
StorageAccountId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount
19+
SummaryReportPath : https://myaccount.blob.core.windows.net/testc2/mytask/assignment1/2024-07-02T08:11:20/SummaryReport.json
20+
TaskAssignmentId : /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount/storageTaskAssignments/mytaskassignment
21+
TaskId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageActions/storageTasks/mytask
22+
TaskVersion : 1
23+
Type : Microsoft.Storage/storageAccounts/storageTaskAssignments/reports
24+
```
25+
26+
This command lists the reports of task assignment "mytaskassignment".
27+
28+
### Example 2: List the reports of all storage task assignments and instances in an account
29+
```powershell
30+
Get-AzStorageTaskAssignmentInstancesReport -AccountName myaccount -ResourceGroupName myresourcegroup
31+
```
32+
33+
```output
34+
FinishTime : 2024-07-03T08:19:23.1774164Z
35+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount/reports/instance1
36+
Name : instance1
37+
ObjectFailedCount : 0
38+
ObjectsOperatedOnCount : 0
39+
ObjectsSucceededCount : 0
40+
ObjectsTargetedCount : 0
41+
RunResult : Succeeded
42+
RunStatusEnum : Finished
43+
RunStatusError : 0x0
44+
StartTime : 2024-07-03T08:10:11.0000000Z
45+
StorageAccountId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount
46+
SummaryReportPath : https://myaccount.blob.core.windows.net/testc2/mytask/mytaskassignment/2024-07-03T08:10:41/SummaryReport.json
47+
TaskAssignmentId : /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount/storageTaskAssignments/mytaskassignment
48+
TaskId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageActions/storageTasks/mytask
49+
TaskVersion : 1
50+
Type : Microsoft.Storage/storageAccounts/reports
51+
52+
FinishTime : 2024-07-02T08:19:51.9238839Z
53+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount/reports/instance2
54+
Name : instance2
55+
ObjectFailedCount : 0
56+
ObjectsOperatedOnCount : 0
57+
ObjectsSucceededCount : 0
58+
ObjectsTargetedCount : 0
59+
RunResult : Succeeded
60+
RunStatusEnum : Finished
61+
RunStatusError : 0x0
62+
StartTime : 2024-07-02T08:10:55.0000000Z
63+
StorageAccountId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount
64+
SummaryReportPath : https://myaccount.blob.core.windows.net/testc2/mytaskassignment2/assignment1/2024-07-02T08:11:20/SummaryReport.json
65+
TaskAssignmentId : /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount/storageTaskAssignments/mytaskassignment2
66+
TaskId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.StorageActions/storageTasks/mytask
67+
TaskVersion : 1
68+
Type : Microsoft.Storage/storageAccounts/reports
69+
```
70+
71+
This command lists the reports of all storage task assignments and instances under storage account "myaccount".
72+

0 commit comments

Comments
 (0)