From 291a62a149cb0ee83ecf29a9bee8b1b9eb62608d Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Tue, 16 Jun 2026 21:27:27 -0400 Subject: [PATCH 1/6] Import client.tsp from main.tsp for deploymentStacks (scope feature) --- .../Microsoft.Resources/deploymentStacks/main.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/resources/resource-manager/Microsoft.Resources/deploymentStacks/main.tsp b/specification/resources/resource-manager/Microsoft.Resources/deploymentStacks/main.tsp index d72c9f53ac0d..686677188720 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/deploymentStacks/main.tsp +++ b/specification/resources/resource-manager/Microsoft.Resources/deploymentStacks/main.tsp @@ -14,6 +14,7 @@ import "@azure-tools/typespec-azure-resource-manager"; import "./models.tsp"; import "./models-whatIf.tsp"; import "./back-compat.tsp"; +import "./client.tsp"; using Azure.ResourceManager; using TypeSpec.Versioning; From 2ecc41c293ce07e5275f1fe97fd578ce9b70e0d3 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Tue, 16 Jun 2026 21:32:02 -0400 Subject: [PATCH 2/6] Import client.tsp from main.tsp for policy (scope feature) --- .../resource-manager/Microsoft.Authorization/policy/main.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/resources/resource-manager/Microsoft.Authorization/policy/main.tsp b/specification/resources/resource-manager/Microsoft.Authorization/policy/main.tsp index fdf62b4fff30..d85112ba59c9 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/policy/main.tsp +++ b/specification/resources/resource-manager/Microsoft.Authorization/policy/main.tsp @@ -24,6 +24,7 @@ import "./PolicySetDefinitionVersion.tsp"; import "./routes.tsp"; import "./Variable.tsp"; import "./VariableValue.tsp"; +import "./client.tsp"; using Azure.Core; using Azure.ResourceManager; From f286a423d82fe2ab9533f3af1b01d49b37c3c41b Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 17 Jun 2026 07:52:52 -0400 Subject: [PATCH 3/6] Import client.tsp from main.tsp for search (scope feature) --- .../Search/client-customizations.tsp | 35 +++++++++++ .../Microsoft.Search/Search/client.tsp | 62 ++++++++++++------- .../Microsoft.Search/Search/main.tsp | 1 + 3 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 specification/search/resource-manager/Microsoft.Search/Search/client-customizations.tsp diff --git a/specification/search/resource-manager/Microsoft.Search/Search/client-customizations.tsp b/specification/search/resource-manager/Microsoft.Search/Search/client-customizations.tsp new file mode 100644 index 000000000000..1b7b57ad36bf --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/Search/client-customizations.tsp @@ -0,0 +1,35 @@ +import "@typespec/http"; +import "@azure-tools/typespec-azure-core"; + +using TypeSpec.Http; +using Azure.Core; + +/** + * Namespace for client-only customization types. Types declared here are used to + * shape the generated SDKs (via client customization decorators) but must never be + * emitted into the OpenAPI/swagger output, so they live in a dedicated namespace + * that the autorest emitter does not enumerate. + */ +namespace SearchClientCustomizations; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model `search-management-request-options` { + /** + * A client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request. + */ + @header("x-ms-client-request-id") + clientRequestId?: string; +} + +/** Network security perimeter configuration */ +model AccessRulePropertiesSubscriptionsItem { + /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ + id?: armResourceIdentifier; +} + +/** Subscriptions for inbound rules */ +model SearchServiceNetworkSecurityPerimeterInboundRuleSubscription { + /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ + id?: armResourceIdentifier; +} diff --git a/specification/search/resource-manager/Microsoft.Search/Search/client.tsp b/specification/search/resource-manager/Microsoft.Search/Search/client.tsp index cb66743673a4..142477313d9f 100644 --- a/specification/search/resource-manager/Microsoft.Search/Search/client.tsp +++ b/specification/search/resource-manager/Microsoft.Search/Search/client.tsp @@ -8,6 +8,7 @@ import "@typespec/openapi"; import "./routes.tsp"; import "@azure-tools/typespec-client-generator-core"; import "./main.tsp"; +import "./client-customizations.tsp"; using TypeSpec.Rest; using TypeSpec.Http; @@ -15,19 +16,10 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ClientGenerator.Core; using TypeSpec.OpenAPI; +using SearchClientCustomizations; namespace Microsoft.Search; -#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -model `search-management-request-options` { - /** - * A client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request. - */ - @header("x-ms-client-request-id") - clientRequestId?: string; -} - /** * Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). */ @@ -704,6 +696,33 @@ op SharedPrivateLinkResourcesDeleteCustomization( "javascript" ); +// Customization operations are only used to override client SDK shapes via +// @@override below. They must not be emitted into the OpenAPI/swagger output. +@@scope(servicesCheckNameAvailabilityCustomization, "!autorest"); +@@scope(servicesCheckNameAvailabilityCustomizationForJs, "!autorest"); +@@scope(usagesListBySubscriptionCustomization, "!autorest"); +@@scope(usageBySubscriptionSkuCustomization, "!autorest"); +@@scope(searchServicesListBySubscriptionCustomization, "!autorest"); +@@scope(searchServicesListByResourceGroupCustomization, "!autorest"); +@@scope(searchGetCustomization, "!autorest"); +@@scope(searchCreateOrUpdateCustomization, "!autorest"); +@@scope(searchUpdateCustomization, "!autorest"); +@@scope(searchDeleteCustomization, "!autorest"); +@@scope(queryKeysCreateCustomization, "!autorest"); +@@scope(queryKeysDeleteCustomization, "!autorest"); +@@scope(adminKeysGetCustomization, "!autorest"); +@@scope(queryKeysListBySearchServiceCustomization, "!autorest"); +@@scope(privateEndpointConnectionsListByServiceCustomization, "!autorest"); +@@scope(privateEndpointConnectionsGetCustomization, "!autorest"); +@@scope(privateEndpointConnectionsUpdateCustomization, "!autorest"); +@@scope(privateEndpointConnectionsDeleteCustomization, "!autorest"); +@@scope(privateLinkResourcesListSupportedCustomization, "!autorest"); +@@scope(privateLinkResourcesRegenerateCustomization, "!autorest"); +@@scope(SharedPrivateLinkResourcesListByServiceCustomization, "!autorest"); +@@scope(SharedPrivateLinkResourcesGetCustomization, "!autorest"); +@@scope(SharedPrivateLinkResourcesCreateOrUpdateCustomization, "!autorest"); +@@scope(SharedPrivateLinkResourcesDeleteCustomization, "!autorest"); + @@Azure.ClientGenerator.Core.override( ServicesOperationGroup.checkNameAvailability, servicesCheckNameAvailabilityCustomization, @@ -954,11 +973,6 @@ op SharedPrivateLinkResourcesDeleteCustomization( "go,csharp,javascript" ); @@clientLocation(usageBySubscriptionSku, "ManagementClient", "go"); -/** Network security perimeter configuration */ -model AccessRulePropertiesSubscriptionsItem { - /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ - id?: Azure.Core.armResourceIdentifier; -} @@alternateType( Azure.ResourceManager.CommonTypes.AccessRuleProperties.subscriptions, AccessRulePropertiesSubscriptionsItem[], @@ -967,9 +981,17 @@ model AccessRulePropertiesSubscriptionsItem { @@clientName(SearchServiceProperties.eTag, "etag", "java"); -@@clientName(SearchResourceEncryptionKey.keyVaultKeyName, "keyName"); -@@clientName(SearchResourceEncryptionKey.keyVaultKeyVersion, "keyVersion"); -@@clientName(SearchResourceEncryptionKey.keyVaultUri, "vaultUri"); +@@clientName( + SearchResourceEncryptionKey.keyVaultKeyName, + "keyName", + "!autorest" +); +@@clientName( + SearchResourceEncryptionKey.keyVaultKeyVersion, + "keyVersion", + "!autorest" +); +@@clientName(SearchResourceEncryptionKey.keyVaultUri, "vaultUri", "!autorest"); // C# settings #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "flatten sku for backward compat with C# SDK" @@ -1208,10 +1230,6 @@ model AccessRulePropertiesSubscriptionsItem { "csharp" ); /** Subscriptions for inbound rules */ -model SearchServiceNetworkSecurityPerimeterInboundRuleSubscription { - /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ - id?: Azure.Core.armResourceIdentifier; -} @@alternateType( Azure.ResourceManager.CommonTypes.AccessRuleProperties.subscriptions, SearchServiceNetworkSecurityPerimeterInboundRuleSubscription[], diff --git a/specification/search/resource-manager/Microsoft.Search/Search/main.tsp b/specification/search/resource-manager/Microsoft.Search/Search/main.tsp index eef9312df771..a9c428f36181 100644 --- a/specification/search/resource-manager/Microsoft.Search/Search/main.tsp +++ b/specification/search/resource-manager/Microsoft.Search/Search/main.tsp @@ -18,6 +18,7 @@ import "./PrivateEndpointConnection.tsp"; import "./SharedPrivateLinkResource.tsp"; import "./NetworkSecurityPerimeterConfiguration.tsp"; import "./routes.tsp"; +import "./client.tsp"; using TypeSpec.Rest; using TypeSpec.Http; From 8df7a2b7108bc187d4b342d306ba4207b20b68ec Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 17 Jun 2026 09:01:25 -0400 Subject: [PATCH 4/6] cleanup --- .../Search/client-customizations.tsp | 35 ---------- .../Microsoft.Search/Search/client.tsp | 66 +++++++++---------- 2 files changed, 30 insertions(+), 71 deletions(-) delete mode 100644 specification/search/resource-manager/Microsoft.Search/Search/client-customizations.tsp diff --git a/specification/search/resource-manager/Microsoft.Search/Search/client-customizations.tsp b/specification/search/resource-manager/Microsoft.Search/Search/client-customizations.tsp deleted file mode 100644 index 1b7b57ad36bf..000000000000 --- a/specification/search/resource-manager/Microsoft.Search/Search/client-customizations.tsp +++ /dev/null @@ -1,35 +0,0 @@ -import "@typespec/http"; -import "@azure-tools/typespec-azure-core"; - -using TypeSpec.Http; -using Azure.Core; - -/** - * Namespace for client-only customization types. Types declared here are used to - * shape the generated SDKs (via client customization decorators) but must never be - * emitted into the OpenAPI/swagger output, so they live in a dedicated namespace - * that the autorest emitter does not enumerate. - */ -namespace SearchClientCustomizations; - -#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -model `search-management-request-options` { - /** - * A client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request. - */ - @header("x-ms-client-request-id") - clientRequestId?: string; -} - -/** Network security perimeter configuration */ -model AccessRulePropertiesSubscriptionsItem { - /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ - id?: armResourceIdentifier; -} - -/** Subscriptions for inbound rules */ -model SearchServiceNetworkSecurityPerimeterInboundRuleSubscription { - /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ - id?: armResourceIdentifier; -} diff --git a/specification/search/resource-manager/Microsoft.Search/Search/client.tsp b/specification/search/resource-manager/Microsoft.Search/Search/client.tsp index 142477313d9f..a8eae8f70f9c 100644 --- a/specification/search/resource-manager/Microsoft.Search/Search/client.tsp +++ b/specification/search/resource-manager/Microsoft.Search/Search/client.tsp @@ -8,7 +8,6 @@ import "@typespec/openapi"; import "./routes.tsp"; import "@azure-tools/typespec-client-generator-core"; import "./main.tsp"; -import "./client-customizations.tsp"; using TypeSpec.Rest; using TypeSpec.Http; @@ -16,9 +15,31 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ClientGenerator.Core; using TypeSpec.OpenAPI; -using SearchClientCustomizations; +using Microsoft.Search; -namespace Microsoft.Search; +namespace Customizations; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model `search-management-request-options` { + /** + * A client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request. + */ + @header("x-ms-client-request-id") + clientRequestId?: string; +} + +/** Network security perimeter configuration */ +model AccessRulePropertiesSubscriptionsItem { + /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ + id?: armResourceIdentifier; +} + +/** Subscriptions for inbound rules */ +model SearchServiceNetworkSecurityPerimeterInboundRuleSubscription { + /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ + id?: armResourceIdentifier; +} /** * Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). @@ -406,7 +427,7 @@ op privateEndpointConnectionsGetCustomization( #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" params?: `search-management-request-options`, -): ArmResponse | CloudError; +): ArmResponse | CloudError; /** * Updates a private endpoint connection to the search service in the given resource group. @@ -440,7 +461,7 @@ op privateEndpointConnectionsUpdateCustomization( #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" params?: `search-management-request-options`, -): ArmResourceUpdatedResponse | CloudError; +): ArmResourceUpdatedResponse | CloudError; /** * Disconnects the private endpoint connection and deletes it from the search service. @@ -469,7 +490,7 @@ op privateEndpointConnectionsDeleteCustomization( #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" params?: `search-management-request-options`, -): ArmResponse | NotFoundResponse | CloudError; +): ArmResponse | NotFoundResponse | CloudError; /** * Gets a list of all supported private link resource types for the given service. @@ -696,33 +717,6 @@ op SharedPrivateLinkResourcesDeleteCustomization( "javascript" ); -// Customization operations are only used to override client SDK shapes via -// @@override below. They must not be emitted into the OpenAPI/swagger output. -@@scope(servicesCheckNameAvailabilityCustomization, "!autorest"); -@@scope(servicesCheckNameAvailabilityCustomizationForJs, "!autorest"); -@@scope(usagesListBySubscriptionCustomization, "!autorest"); -@@scope(usageBySubscriptionSkuCustomization, "!autorest"); -@@scope(searchServicesListBySubscriptionCustomization, "!autorest"); -@@scope(searchServicesListByResourceGroupCustomization, "!autorest"); -@@scope(searchGetCustomization, "!autorest"); -@@scope(searchCreateOrUpdateCustomization, "!autorest"); -@@scope(searchUpdateCustomization, "!autorest"); -@@scope(searchDeleteCustomization, "!autorest"); -@@scope(queryKeysCreateCustomization, "!autorest"); -@@scope(queryKeysDeleteCustomization, "!autorest"); -@@scope(adminKeysGetCustomization, "!autorest"); -@@scope(queryKeysListBySearchServiceCustomization, "!autorest"); -@@scope(privateEndpointConnectionsListByServiceCustomization, "!autorest"); -@@scope(privateEndpointConnectionsGetCustomization, "!autorest"); -@@scope(privateEndpointConnectionsUpdateCustomization, "!autorest"); -@@scope(privateEndpointConnectionsDeleteCustomization, "!autorest"); -@@scope(privateLinkResourcesListSupportedCustomization, "!autorest"); -@@scope(privateLinkResourcesRegenerateCustomization, "!autorest"); -@@scope(SharedPrivateLinkResourcesListByServiceCustomization, "!autorest"); -@@scope(SharedPrivateLinkResourcesGetCustomization, "!autorest"); -@@scope(SharedPrivateLinkResourcesCreateOrUpdateCustomization, "!autorest"); -@@scope(SharedPrivateLinkResourcesDeleteCustomization, "!autorest"); - @@Azure.ClientGenerator.Core.override( ServicesOperationGroup.checkNameAvailability, servicesCheckNameAvailabilityCustomization, @@ -1090,12 +1084,12 @@ op SharedPrivateLinkResourcesDeleteCustomization( "csharp" ); @@clientName( - PrivateEndpointConnectionProperties, + Microsoft.Search.PrivateEndpointConnectionProperties, "SearchServicePrivateEndpointConnectionProperties", "csharp" ); @@clientName( - PrivateEndpointConnectionProperties.privateLinkServiceConnectionState, + Microsoft.Search.PrivateEndpointConnectionProperties.privateLinkServiceConnectionState, "ConnectionState", "csharp" ); @@ -1173,7 +1167,7 @@ op SharedPrivateLinkResourcesDeleteCustomization( "csharp" ); @@clientName( - PrivateEndpointConnection, + Microsoft.Search.PrivateEndpointConnection, "SearchPrivateEndpointConnection", "csharp" ); From 8dd6a3a675572aab58708f6946ba4c57b242df55 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 17 Jun 2026 09:07:54 -0400 Subject: [PATCH 5/6] revert reorder --- .../Microsoft.Search/Search/client.tsp | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/specification/search/resource-manager/Microsoft.Search/Search/client.tsp b/specification/search/resource-manager/Microsoft.Search/Search/client.tsp index a8eae8f70f9c..34aab9246518 100644 --- a/specification/search/resource-manager/Microsoft.Search/Search/client.tsp +++ b/specification/search/resource-manager/Microsoft.Search/Search/client.tsp @@ -29,18 +29,6 @@ model `search-management-request-options` { clientRequestId?: string; } -/** Network security perimeter configuration */ -model AccessRulePropertiesSubscriptionsItem { - /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ - id?: armResourceIdentifier; -} - -/** Subscriptions for inbound rules */ -model SearchServiceNetworkSecurityPerimeterInboundRuleSubscription { - /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ - id?: armResourceIdentifier; -} - /** * Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). */ @@ -967,6 +955,11 @@ op SharedPrivateLinkResourcesDeleteCustomization( "go,csharp,javascript" ); @@clientLocation(usageBySubscriptionSku, "ManagementClient", "go"); +/** Network security perimeter configuration */ +model AccessRulePropertiesSubscriptionsItem { + /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ + id?: Azure.Core.armResourceIdentifier; +} @@alternateType( Azure.ResourceManager.CommonTypes.AccessRuleProperties.subscriptions, AccessRulePropertiesSubscriptionsItem[], @@ -1224,6 +1217,10 @@ op SharedPrivateLinkResourcesDeleteCustomization( "csharp" ); /** Subscriptions for inbound rules */ +model SearchServiceNetworkSecurityPerimeterInboundRuleSubscription { + /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ + id?: Azure.Core.armResourceIdentifier; +} @@alternateType( Azure.ResourceManager.CommonTypes.AccessRuleProperties.subscriptions, SearchServiceNetworkSecurityPerimeterInboundRuleSubscription[], From b1e80e696447679e1f80d0593ad0daa4bb88bfc5 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 17 Jun 2026 09:12:34 -0400 Subject: [PATCH 6/6] format --- .../resource-manager/Microsoft.Search/Search/client.tsp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/specification/search/resource-manager/Microsoft.Search/Search/client.tsp b/specification/search/resource-manager/Microsoft.Search/Search/client.tsp index 34aab9246518..a6172cbe7977 100644 --- a/specification/search/resource-manager/Microsoft.Search/Search/client.tsp +++ b/specification/search/resource-manager/Microsoft.Search/Search/client.tsp @@ -449,7 +449,9 @@ op privateEndpointConnectionsUpdateCustomization( #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" params?: `search-management-request-options`, -): ArmResourceUpdatedResponse | CloudError; +): + | ArmResourceUpdatedResponse + | CloudError; /** * Disconnects the private endpoint connection and deletes it from the search service. @@ -478,7 +480,10 @@ op privateEndpointConnectionsDeleteCustomization( #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" params?: `search-management-request-options`, -): ArmResponse | NotFoundResponse | CloudError; +): + | ArmResponse + | NotFoundResponse + | CloudError; /** * Gets a list of all supported private link resource types for the given service.