Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def cf_managed_compute_deployments(cli_ctx, *_):
return get_cognitiveservices_management_client(cli_ctx).managed_compute_deployments


def cf_adapter_deployments(cli_ctx, *_):
return get_cognitiveservices_management_client(cli_ctx).adapter_deployments
Comment thread
saanikaguptamicrosoft marked this conversation as resolved.


def cf_computes(cli_ctx, *_):
return get_cognitiveservices_management_client(cli_ctx).computes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,76 @@
--deployment-name gpt-oss-120b-gpu
"""

helps[
"cognitiveservices account adapter-deployment"
] = """
type: group
short-summary: Manage LoRA adapter deployments for Azure Cognitive Services accounts.
long-summary: |
An adapter deployment is a lightweight LoRA weight patch that attaches to an existing
managed compute (parent) deployment. It owns no SKU, capacity, base model, or runtime
- all inference resources come from the parent managed compute deployment referenced
by --target-deployment-name.
"""

helps[
"cognitiveservices account adapter-deployment create"
] = """
type: command
short-summary: Create (or replace / re-target) a LoRA adapter deployment attached to a managed compute deployment.
long-summary: |
The adapter must reference a protected Foundry fine-tuning LoRA output as its source model.
The target deployment is the name of an existing managed compute deployment in the same
account. Re-issuing create with the same adapter name and a different --target-deployment-name
re-targets the adapter; --source-model-id is immutable.
examples:
- name: Create an adapter deployment attached to an existing managed compute deployment.
text: >
az cognitiveservices account adapter-deployment create
-g myResourceGroup -n myAccount
--adapter-deployment-name my-lora-adapter
--source-model-id "azureai://accounts/myAccount/projects/myProject/models/my-fine-tuned-lora/versions/1"
--target-deployment-name gpt-oss-120b-gpu
"""

helps[
"cognitiveservices account adapter-deployment show"
] = """
type: command
short-summary: Show an adapter deployment for Azure Cognitive Services account.
examples:
- name: Show an adapter deployment.
text: >
az cognitiveservices account adapter-deployment show
-g myResourceGroup -n myAccount
--adapter-deployment-name my-lora-adapter
"""

helps[
"cognitiveservices account adapter-deployment list"
] = """
type: command
short-summary: List all adapter deployments for Azure Cognitive Services account.
examples:
- name: List all adapter deployments.
text: >
az cognitiveservices account adapter-deployment list
-g myResourceGroup -n myAccount
"""

helps[
"cognitiveservices account adapter-deployment delete"
] = """
type: command
short-summary: Delete an adapter deployment from Azure Cognitive Services account.
examples:
- name: Delete an adapter deployment.
text: >
az cognitiveservices account adapter-deployment delete
-g myResourceGroup -n myAccount
--adapter-deployment-name my-lora-adapter
"""

helps[
"cognitiveservices commitment-tier"
] = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,18 @@ def load_arguments(self, _):
with self.argument_context('cognitiveservices account managed-compute-deployment update') as c:
c.argument('tags', tags_type)

with self.argument_context('cognitiveservices account adapter-deployment') as c:
c.argument('adapter_deployment_name', help='Adapter deployment name.')

with self.argument_context('cognitiveservices account adapter-deployment create') as c:
c.argument('source_model_id', options_list=['--source-model-id'],
help='Immutable Foundry fine-tuning LoRA output model URI '
'(e.g., azureai://accounts/{account}/projects/{project}/models/{model}/versions/{version}).')
c.argument('target_deployment_name', options_list=['--target-deployment-name'],
help='Name of the existing managed compute parent deployment (resolved within '
'the same account) that will serve this adapter. Re-specify to re-target an '
'existing adapter deployment.')

with self.argument_context('cognitiveservices account commitment-plan') as c:
c.argument('commitment_plan_name', help='Cognitive Services account commitment plan name')
c.argument('plan_type', help='Cognitive Services account commitment plan type')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cf_deleted_accounts, cf_deployments, cf_commitment_plans, cf_commitment_tiers, cf_models, cf_usages, \
cf_ai_projects, cf_account_connections, cf_projects, cf_project_connections, \
cf_managed_network_settings, cf_managed_network_provisions, cf_outbound_rule, \
cf_managed_compute_deployments, cf_computes
cf_managed_compute_deployments, cf_adapter_deployments, cf_computes


def load_command_table(self, _):
Expand Down Expand Up @@ -213,6 +213,19 @@ def load_command_table(self, _):
g.custom_command('update', 'managed_compute_deployment_update')
g.custom_command('delete', 'managed_compute_deployment_delete')

adapter_deployments_type = CliCommandType(
operations_tmpl='azure.mgmt.cognitiveservices.operations#AdapterDeploymentsOperations.{}',
client_factory=cf_adapter_deployments
)

with self.command_group(
'cognitiveservices account adapter-deployment', adapter_deployments_type,
client_factory=cf_adapter_deployments, is_preview=True) as g:
g.custom_command('create', 'adapter_deployment_create')
g.custom_show_command('show', 'adapter_deployment_show')
g.custom_command('list', 'adapter_deployment_list')
g.custom_command('delete', 'adapter_deployment_delete')

computes_type = CliCommandType(
operations_tmpl='azure.mgmt.cognitiveservices.operations#ComputesOperations.{}',
client_factory=cf_computes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,43 @@ def managed_compute_deployment_delete(client, resource_group_name, account_name,
return client.begin_delete(resource_group_name, account_name, deployment_name)


def adapter_deployment_create(
client, resource_group_name, account_name, adapter_deployment_name,
source_model_id, target_deployment_name):
"""
Create (or replace / re-target) a LoRA adapter deployment attached to a managed compute deployment.
"""
from azure.mgmt.cognitiveservices.models import AdapterDeployment, AdapterDeploymentProperties
properties = AdapterDeploymentProperties(
source_model_id=source_model_id,
target_deployment_name=target_deployment_name,
)
Comment thread
saanikaguptamicrosoft marked this conversation as resolved.
adapter_deployment = AdapterDeployment(properties=properties)
Comment thread
saanikaguptamicrosoft marked this conversation as resolved.
return client.begin_create_or_update(
resource_group_name, account_name, adapter_deployment_name, adapter_deployment)


def adapter_deployment_show(client, resource_group_name, account_name, adapter_deployment_name):
"""
Show an adapter deployment for Azure Cognitive Services account.
"""
return client.get(resource_group_name, account_name, adapter_deployment_name)


def adapter_deployment_list(client, resource_group_name, account_name):
"""
List adapter deployments for Azure Cognitive Services account.
"""
return client.list(resource_group_name, account_name)


def adapter_deployment_delete(client, resource_group_name, account_name, adapter_deployment_name):
"""
Delete an adapter deployment from Azure Cognitive Services account.
"""
return client.begin_delete(resource_group_name, account_name, adapter_deployment_name)


def commitment_plan_create_or_update(
client,
resource_group_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,21 @@ cognitiveservices account managed-compute-deployment update:
cognitiveservices account managed-compute-deployment delete:
rule_exclusions:
- missing_command_test_coverage
cognitiveservices account adapter-deployment:
rule_exclusions:
- missing_command_test_coverage
cognitiveservices account adapter-deployment create:
rule_exclusions:
- missing_command_test_coverage
cognitiveservices account adapter-deployment show:
rule_exclusions:
- missing_command_test_coverage
cognitiveservices account adapter-deployment list:
rule_exclusions:
- missing_command_test_coverage
cognitiveservices account adapter-deployment delete:
rule_exclusions:
- missing_command_test_coverage
cognitiveservices account compute:
rule_exclusions:
- missing_command_test_coverage
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interactions:
User-Agent:
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.12.3 (Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002?api-version=2026-05-15-preview
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002?api-version=2026-09-15-preview
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002","name":"cs_cli_test_000002","type":"Microsoft.CognitiveServices/accounts","etag":"\"b503a8e1-0000-0500-0000-6900d7d20000\"","location":"SOUTHCENTRALUS","sku":{"name":"S0"},"kind":"Face","properties":{"endpoint":"https://southcentralus.api.cognitive.microsoft.com/","internalId":"702f052c71b840c4a042fe42dee9e610","dateCreated":"2025-10-28T14:48:50.2975467Z","callRateLimit":{"rules":[{"key":"face","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"face/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"*","method":"*"}]}]},"isMigrated":false,"allowProjectManagement":false,"privateEndpointConnections":[],"publicNetworkAccess":"Enabled","capabilities":[{"name":"VirtualNetworks"},{"name":"Scenario","value":"Face.LegacyPreview,Face.Legacy,Face.Detection,Face.Verification,Face.Identification"}],"endpoints":{"Face":"https://southcentralus.api.cognitive.microsoft.com/"},"provisioningState":"Creating"},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-10-28T14:48:49.6405325Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-10-28T14:48:49.6405325Z"}}'
Expand Down Expand Up @@ -176,7 +176,7 @@ interactions:
User-Agent:
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.12.3 (Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002?api-version=2026-05-15-preview
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002?api-version=2026-09-15-preview
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002","name":"cs_cli_test_000002","type":"Microsoft.CognitiveServices/accounts","etag":"\"b503cde1-0000-0500-0000-6900d7d30000\"","location":"SOUTHCENTRALUS","sku":{"name":"S0"},"kind":"Face","properties":{"endpoint":"https://southcentralus.api.cognitive.microsoft.com/","internalId":"702f052c71b840c4a042fe42dee9e610","dateCreated":"2025-10-28T14:48:50.2975467Z","callRateLimit":{"rules":[{"key":"face","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"face/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"*","method":"*"}]}]},"isMigrated":false,"allowProjectManagement":false,"privateEndpointConnections":[],"publicNetworkAccess":"Enabled","capabilities":[{"name":"VirtualNetworks"},{"name":"Scenario","value":"Face.LegacyPreview,Face.Legacy,Face.Detection,Face.Verification,Face.Identification"}],"endpoints":{"Face":"https://southcentralus.api.cognitive.microsoft.com/"},"provisioningState":"Succeeded"},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-10-28T14:48:49.6405325Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-10-28T14:48:49.6405325Z"}}'
Expand Down Expand Up @@ -226,7 +226,7 @@ interactions:
User-Agent:
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.12.3 (Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002?api-version=2026-05-15-preview
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002?api-version=2026-09-15-preview
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002","name":"cs_cli_test_000002","type":"Microsoft.CognitiveServices/accounts","etag":"\"b503cde1-0000-0500-0000-6900d7d30000\"","location":"SOUTHCENTRALUS","sku":{"name":"S0"},"kind":"Face","properties":{"endpoint":"https://southcentralus.api.cognitive.microsoft.com/","internalId":"702f052c71b840c4a042fe42dee9e610","dateCreated":"2025-10-28T14:48:50.2975467Z","callRateLimit":{"rules":[{"key":"face","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"face/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":10,"matchPatterns":[{"path":"*","method":"*"}]}]},"isMigrated":false,"allowProjectManagement":false,"privateEndpointConnections":[],"publicNetworkAccess":"Enabled","capabilities":[{"name":"VirtualNetworks"},{"name":"Scenario","value":"Face.LegacyPreview,Face.Legacy,Face.Detection,Face.Verification,Face.Identification"}],"endpoints":{"Face":"https://southcentralus.api.cognitive.microsoft.com/"},"provisioningState":"Succeeded"},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2025-10-28T14:48:49.6405325Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2025-10-28T14:48:49.6405325Z"}}'
Expand Down Expand Up @@ -278,7 +278,7 @@ interactions:
User-Agent:
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.12.3 (Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39)
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002?api-version=2026-05-15-preview
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.CognitiveServices/accounts/cs_cli_test_000002?api-version=2026-09-15-preview
response:
body:
string: ''
Expand Down

Large diffs are not rendered by default.

Loading
Loading