-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Storage] Use ArmCustomPatch template #43207
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
Changes from all commits
d252a83
23da95d
66b5ea9
76a7ada
fdef77d
563fa78
5db615f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -193,7 +193,11 @@ using Microsoft.Storage; | |
| ); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(BlobServiceProperties.properties); | ||
| @@clientName(BlobServiceProperties.properties, "BlobServiceProperties"); | ||
| @@clientName( | ||
| BlobServiceProperties.properties, | ||
| "BlobServiceProperties", | ||
| "!javascript" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 💡 Suggestion — Add a block comment explaining the This PR introduces nine Suggested comment to add above the first occurrence (or near the top of the file):
|
||
| ); | ||
|
|
||
| @@clientName(BlobContainers.create::parameters.resource, "blobContainer"); | ||
| @@clientName(BlobContainers.update::parameters.properties, "blobContainer"); | ||
|
|
@@ -202,7 +206,7 @@ using Microsoft.Storage; | |
|
|
||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(BlobContainer.properties); | ||
| @@clientName(BlobContainer.properties, "ContainerProperties"); | ||
| @@clientName(BlobContainer.properties, "ContainerProperties", "!javascript"); | ||
|
|
||
| @@clientName(ContainerProperties.immutabilityPolicy, "ImmutabilityPolicy"); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
|
|
@@ -214,28 +218,36 @@ using Microsoft.Storage; | |
| ); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(FileServiceProperties.properties); | ||
| @@clientName(FileServiceProperties.properties, "FileServiceProperties"); | ||
| @@clientName( | ||
| FileServiceProperties.properties, | ||
| "FileServiceProperties", | ||
| "!javascript" | ||
| ); | ||
|
|
||
| @@clientName(FileShares.create::parameters.resource, "fileShare"); | ||
| @@clientName(FileShares.update::parameters.properties, "fileShare"); | ||
| @@clientName(FileShares.restore::parameters.body, "deletedShare"); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(FileShare.properties); | ||
| @@clientName(FileShare.properties, "FileShareProperties"); | ||
| @@clientName(FileShare.properties, "FileShareProperties", "!javascript"); | ||
|
|
||
| @@clientName( | ||
| QueueServices.setServiceProperties::parameters.resource, | ||
| "parameters" | ||
| ); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(QueueServiceProperties.properties); | ||
| @@clientName(QueueServiceProperties.properties, "QueueServiceProperties"); | ||
| @@clientName( | ||
| QueueServiceProperties.properties, | ||
| "QueueServiceProperties", | ||
| "!javascript" | ||
| ); | ||
|
|
||
| @@clientName(StorageQueues.create::parameters.resource, "queue"); | ||
| @@clientName(StorageQueues.update::parameters.properties, "queue"); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(StorageQueue.properties); | ||
| @@clientName(StorageQueue.properties, "QueueProperties"); | ||
| @@clientName(StorageQueue.properties, "QueueProperties", "!javascript"); | ||
|
|
||
| @@clientName(StorageAccounts.create::parameters.resource, "parameters"); | ||
| @@clientName(StorageAccounts.update::parameters.properties, "parameters"); | ||
|
|
@@ -259,7 +271,8 @@ using Microsoft.Storage; | |
| @@flattenProperty(StorageAccountMigration.properties); | ||
| @@clientName( | ||
| StorageAccountMigration.properties, | ||
| "StorageAccountMigrationDetails" | ||
| "StorageAccountMigrationDetails", | ||
| "!javascript" | ||
| ); | ||
|
|
||
| @@clientName( | ||
|
|
@@ -294,21 +307,29 @@ using Microsoft.Storage; | |
| @@clientName(EncryptionScopes.patch::parameters.properties, "encryptionScope"); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(EncryptionScope.properties); | ||
| @@clientName(EncryptionScope.properties, "EncryptionScopeProperties"); | ||
| @@clientName( | ||
| EncryptionScope.properties, | ||
| "EncryptionScopeProperties", | ||
| "!javascript" | ||
| ); | ||
|
|
||
| @@clientName( | ||
| TableServices.setServiceProperties::parameters.resource, | ||
| "parameters" | ||
| ); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(TableServiceProperties.properties); | ||
| @@clientName(TableServiceProperties.properties, "TableServiceProperties"); | ||
| @@clientName( | ||
| TableServiceProperties.properties, | ||
| "TableServiceProperties", | ||
| "!javascript" | ||
| ); | ||
|
|
||
| @@clientName(Tables.create::parameters.resource, "parameters"); | ||
| @@clientName(Tables.update::parameters.properties, "parameters"); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(Table.properties); | ||
| @@clientName(Table.properties, "TableProperties"); | ||
| @@clientName(Table.properties, "TableProperties", "!javascript"); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(NetworkSecurityPerimeterConfiguration.properties); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6345,6 +6345,66 @@ alias ETagHeader = { | |
| eTag: string; | ||
| }; | ||
|
|
||
| /** | ||
| * A Connector is a tracked ARM resource modeled as a sub-resource of a Storage Account. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 🟡 Warning [TSP — Misleading docstring on PATCH request body model] The docstring says:```typespec
Classification: Fix:```diff
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 🟡 Warning — Misleading doc-comment on The doc-comment says "The resource model definition for an Azure Resource Manager tracked top level resource…" — that is the boilerplate for a tracked ARM resource, but Suggested fix: Replace the auto-generated tracked-resource blurb with something accurate, e.g.:
|
||
| */ | ||
| #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "To match existing API shape" | ||
| @added(Versions.v2025_08_01) | ||
| model ConnectorUpdate extends TrackedResourceUpdate { | ||
| /** | ||
| * The properties of the Storage Connector. | ||
| */ | ||
| properties?: StorageConnectorPropertiesUpdate; | ||
| } | ||
|
|
||
| /** | ||
| * The storage connector properties | ||
| */ | ||
| @added(Versions.v2025_08_01) | ||
| model StorageConnectorPropertiesUpdate { | ||
| /** | ||
| * State - Active or Inactive. Whether or not the Storage Connector should start as active (default: Active) | ||
| * (While set to false on the Storage Connector, all data plane requests using this Storage Connector fail, and this Storage Connector is not billed if it would be otherwise. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 💡 Suggestion [TSP — Unbalanced parenthesis in property description] The description opens a parenthesis but never closes it: /**
* State - Active or Inactive. Whether or not the Storage Connector should start as active (default: Active)
* (While set to false on the Storage Connector, all data plane requests using this Storage Connector fail, and this Storage Connector is not billed if it would be otherwise.
*/```The same issue exists in the corresponding `StorageConnectorProperties.state` (pre-existing); this PR carried it forward into the new `StorageConnectorPropertiesUpdate`.
**Classification:** `[NEW]` for `StorageConnectorPropertiesUpdate` — this model was added in this PR. The same issue is `[EXISTING]` in `StorageConnectorProperties` (pre-existing).
**Fix (optional):**```diff
- * (While set to false on the Storage Connector, all data plane requests using this Storage Connector fail, and this Storage Connector is not billed if it would be otherwise.
+ * (While set to false on the Storage Connector, all data plane requests using this Storage Connector fail, and this Storage Connector is not billed if it would be otherwise.)
```<!-- posted-by: arm-api-reviewer-agent -->
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 💡 Suggestion — Unbalanced parenthesis in The description for Suggested fix: This is a pre-existing issue in |
||
| */ | ||
| state?: StorageConnectorState = StorageConnectorState.Active; | ||
|
|
||
| /** | ||
| * Arbitrary description of this Storage Connector. Max 250 characters. | ||
| */ | ||
| @maxLength(250) | ||
| description?: string; | ||
|
|
||
| /** | ||
| * Test connection to backing data source before creating the storage connector. | ||
| */ | ||
| @visibility(Lifecycle.Create, Lifecycle.Update) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 💡 Suggestion [TSP — Unreachable @visibility(Lifecycle.Create, Lifecycle.Update)
testConnection?: boolean = false;```This decorator is on a property of `StorageConnectorPropertiesUpdate`, which is **only used as the `PatchModel` of `ArmCustomPatchAsync`**. That means this model never appears in a Create body — `Lifecycle.Create` is unreachable here. This appears to be a copy-paste from the corresponding property in `StorageConnectorProperties` (where Create + Update visibility is appropriate).
**Classification:** `[NEW]` — `StorageConnectorPropertiesUpdate` was added in this PR.
**Fix (optional):** Drop the decorator entirely (the property is visible in all contexts by default, which is fine for a PATCH-only model) or narrow to `@visibility(Lifecycle.Update)` for documentation clarity:
```diff
- @visibility(Lifecycle.Create, Lifecycle.Update)
- testConnection?: boolean = false;
+ testConnection?: boolean = false;```<!-- posted-by: arm-api-reviewer-agent -->
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 💡 Suggestion — Dead
Consider using |
||
| testConnection?: boolean = false; | ||
|
|
||
| /** | ||
| * Information about how to communicate with and authenticate to the backing data store. | ||
| */ | ||
| source?: StorageConnectorSourceUpdate; | ||
| } | ||
|
|
||
| /** The storage connector backing data source information */ | ||
| @added(Versions.v2025_08_01) | ||
| @discriminator("type") | ||
| model StorageConnectorSourceUpdate { | ||
| /** Type of the Storage Connector. Not mutable once the Storage Connector is created." */ | ||
| type: StorageConnectorSourceType; | ||
| } | ||
|
|
||
| /** The managed identity auth properties for dataShare connection. */ | ||
| @added(Versions.v2025_08_01) | ||
| model ManagedIdentityAuthPropertiesUpdate | ||
| extends StorageConnectorAuthPropertiesUpdate { | ||
| /** Discriminator value for ManagedIdentity */ | ||
| type: StorageConnectorAuthType.ManagedIdentity; | ||
|
|
||
| /** ARM ResourceId of the managed identity that should be used to authenticate to the backing data source. */ | ||
| identityResourceId?: string; | ||
| } | ||
|
|
||
| /** | ||
| * The storage connector properties | ||
| */ | ||
|
|
@@ -6419,7 +6479,6 @@ model DataShareSource extends StorageConnectorSource { | |
| /** | ||
| * The type for data share source | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| type: StorageConnectorSourceType.DataShare; | ||
|
|
||
| /** | ||
|
|
@@ -6434,6 +6493,24 @@ model DataShareSource extends StorageConnectorSource { | |
| authProperties: StorageConnectorAuthProperties; | ||
| } | ||
|
|
||
| /** The properties of data share source */ | ||
| @added(Versions.v2025_08_01) | ||
| model DataShareSourceUpdate extends StorageConnectorSourceUpdate { | ||
| /** Discriminator value for DataShare */ | ||
| type: StorageConnectorSourceType.DataShare; | ||
|
|
||
| /** Details for how to authenticate to the backing data store. */ | ||
| authProperties?: StorageConnectorAuthPropertiesUpdate; | ||
| } | ||
|
|
||
| /** The authentication properties of the backing data source */ | ||
| @added(Versions.v2025_08_01) | ||
| @discriminator("type") | ||
| model StorageConnectorAuthPropertiesUpdate { | ||
| /** Type of the authentication properties. Controls the type of the authProperties object */ | ||
| type: StorageConnectorAuthType; | ||
| } | ||
|
|
||
| /** | ||
| * The connection properties of the backing data source | ||
| */ | ||
|
|
@@ -6454,7 +6531,6 @@ model DataShareConnection extends StorageConnectorConnection { | |
| /** | ||
| * The type for data share connection | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| type: StorageConnectorConnectionType.DataShare; | ||
|
|
||
| /** | ||
|
|
@@ -6484,7 +6560,6 @@ model ManagedIdentityAuthProperties extends StorageConnectorAuthProperties { | |
| /** | ||
| * The type of managed identity auth | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| type: StorageConnectorAuthType.ManagedIdentity; | ||
|
|
||
| /** | ||
|
|
@@ -6581,6 +6656,61 @@ model StorageDataShareProperties { | |
| provisioningState?: NativeDataSharingProvisioningState; | ||
| } | ||
|
|
||
| /** | ||
| * A DataShare is a tracked ARM resource modeled as a sub-resource of a Storage Account. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 🟡 Warning [TSP — Misleading docstring on PATCH request body model] Same issue as
Classification: Fix:```diff
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 🟡 Warning — Misleading doc-comment on Same issue as
|
||
| */ | ||
| #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "To match existing API shape" | ||
| @added(Versions.v2025_08_01) | ||
| model DataShareUpdate extends TrackedResourceUpdate { | ||
| /** | ||
| * The properties of the Storage DataShare. | ||
| */ | ||
| properties?: StorageDataSharePropertiesUpdate; | ||
| } | ||
|
|
||
| /** | ||
| * The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 🟡 Warning [TSP — Local model shadows Two issues with this model: 1. Naming collision / shadowing. The local model is named 2. Misleading description. The docstring says Classification: Fix:
-/**
- * The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
- */
+/**
+ * The patchable subset of a tracked ARM resource (— only resource tags). Used as a base for resource Update (PATCH) payloads.
+ */```<!-- posted-by: arm-api-reviewer-agent -->
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 🟡 Warning — Misleading doc-comment and potential naming collision on Two issues:
Suggested fixes:
|
||
| */ | ||
| #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "To match existing API shape" | ||
| @added(Versions.v2025_08_01) | ||
| model TrackedResourceUpdate extends Azure.ResourceManager.CommonTypes.Resource { | ||
| /** | ||
| * Resource tags. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "To match existing API shape." | ||
| tags?: Record<string>; | ||
| } | ||
|
|
||
| /** | ||
| * The storage datashare properties | ||
| */ | ||
| @added(Versions.v2025_08_01) | ||
| model StorageDataSharePropertiesUpdate { | ||
| /** | ||
| * Arbitrary description of this Data Share. Max 250 characters. | ||
| */ | ||
| @maxLength(250) | ||
| description?: string; | ||
|
|
||
| /** | ||
| * List of access policies that specify the permission allowed to a managed identity. | ||
| * For Create - This property is required and cannot be null. If no access policies are provided at creation time, specify an empty array. | ||
| * For Update - This property is optional. If set to null or not passed, the existing access policies are left unchanged. | ||
| * If provided with a non-null value, the existing access policies are replaced with the specified list. | ||
| */ | ||
| @identifiers(#[]) | ||
| accessPolicies?: StorageDataShareAccessPolicy[]; | ||
|
|
||
| /** | ||
| * List of assets that specify the properties of the shared resources. | ||
| * For Create - This property is required and cannot be null. If no assets are provided at creation time, specify an empty array. | ||
| * For Update - This property is optional. If set to null or not passed, the existing assets are left unchanged. | ||
| * If provided with a non-null value, the existing assets are replaced with the specified list. | ||
| */ | ||
| @identifiers(#[]) | ||
| assets?: StorageDataShareAsset[]; | ||
| } | ||
|
|
||
| /** | ||
| * Policy that specify the permission allowed to a managed identity | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ options: | |
| emitter-output-dir: "{output-dir}/{service-dir}/arm-storage" | ||
| service-dir: sdk/storage | ||
| flavor: "azure" | ||
| compatibility-lro: true | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 💡 Suggestion [tspconfig — Consider documenting why compatibility-lro: true```This setting preserves the pre-existing LRO method shape in the JavaScript SDK (`@azure/arm-storage`) that was already in GA before the TypeSpec migration. Without it, the `ArmCustomPatchAsync` template would change the emitted JavaScript LRO wrapper method names, causing a breaking change for existing callers.
**Classification:** `[NEW]` — added in this PR.
**Fix (optional):** Add a comment so future maintainers understand why this flag is set and can evaluate whether to keep it when bumping to a new API version:
```diff
+ # Preserve pre-existing LRO method signatures in @azure/arm-storage (GA SDK back-compat). compatibility-lro: true```<!-- posted-by: arm-api-reviewer-agent -->
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [NEW] 💡 Suggestion — Add a rationale comment for
|
||
| experimental-extensible-enums: true | ||
| package-details: | ||
| name: "@azure/arm-storage" | ||
|
|
@@ -59,6 +60,7 @@ options: | |
| namespace: "Azure.ResourceManager.Storage" | ||
| emitter-output-dir: "{output-dir}/{service-dir}/{namespace}" | ||
| enable-wire-path-attribute: true | ||
| api-version: "2025-08-01" | ||
| linter: | ||
| extends: | ||
| - "@azure-tools/typespec-azure-rulesets/resource-manager" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[NEW] 💡 Suggestion [TSP — Consider adding a block comment explaining the
!javascriptscope pattern]This PR adds
"!javascript"to 9@@clientNamecalls in this file (lines 199, 209, 224, 232, 243, 250, 275, 313, 325, 332) for the same reason: the JavaScript SDK already shipped these property names and renaming them would break existing callers. Adding a single block comment before the first such occurrence would document the convention once, instead of requiring readers to infer the pattern from 9 nearly-identical changes.Classification:
[NEW]— these scope qualifiers were added in this PR.Fix (optional): Add a comment above this line: