workspace_product
Creates, updates, deletes, gets or lists a workspace_product resource.
Overview
| Name | workspace_product |
| Type | Resource |
| Id | azure.api_management.workspace_product |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_service
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
application | object | Specifies identity provider settings needed to authorize applications API calls. |
approvalRequired | boolean | whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. |
authenticationType | array | Type of supported authentication for the product. The application configuration is required for application-token authentication type. The subscription-key authentication type is used by default. If the property is omitted, the subscription-key authentication type is used. |
description | string | Product description. May include HTML formatting tags. |
displayName | string | Product name. Required. |
state | string | whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Known values are: "notPublished" and "published". (notPublished, published) |
subscriptionRequired | boolean | Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. |
subscriptionsLimit | integer | Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
terms | string | Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
application | object | Specifies identity provider settings needed to authorize applications API calls. |
approvalRequired | boolean | whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. |
authenticationType | array | Type of supported authentication for the product. The application configuration is required for application-token authentication type. The subscription-key authentication type is used by default. If the property is omitted, the subscription-key authentication type is used. |
description | string | Product description. May include HTML formatting tags. |
displayName | string | Product name. Required. |
state | string | whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Known values are: "notPublished" and "published". (notPublished, published) |
subscriptionRequired | boolean | Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. |
subscriptionsLimit | integer | Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
terms | string | Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
product_id | string | Product identifier. Must be unique in the current API Management service instance. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
service_name | string | The name of the API Management service. Required. |
subscription_id | string | |
workspace_id | string | Workspace identifier. Must be unique in the current API Management service instance. Required. |
$filter | string | | Field | Usage | Supported operators | Supported functions ||-------------|-------------|-------------|-------------|| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || state | filter | eq | || groups | expand | | |. Default value is None. |
$skip | integer | Number of records to skip. Default value is None. |
$top | integer | Number of records to return. Default value is None. |
deleteSubscriptions | boolean | Delete existing subscriptions associated with the product or not. Default value is None. |
expandGroups | boolean | When set to true, the response contains an array of groups that have visibility to the product. The default is false. Default value is None. |
tags | string | Products which are part of a specific tag. Default value is None. |
SELECT examples
- get
- list_by_service
Gets the details of the product specified by its identifier.
SELECT
id,
name,
application,
approvalRequired,
authenticationType,
description,
displayName,
state,
subscriptionRequired,
subscriptionsLimit,
systemData,
terms,
type
FROM azure.api_management.workspace_product
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
AND product_id = '{{ product_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists a collection of products in the specified workspace in a service instance.
SELECT
id,
name,
application,
approvalRequired,
authenticationType,
description,
displayName,
state,
subscriptionRequired,
subscriptionsLimit,
systemData,
terms,
type
FROM azure.api_management.workspace_product
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
AND expandGroups = '{{ expandGroups }}'
AND tags = '{{ tags }}'
;
INSERT examples
- create_or_update
- Manifest
Creates or Updates a product.
INSERT INTO azure.api_management.workspace_product (
properties,
resource_group_name,
service_name,
workspace_id,
product_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ workspace_id }}',
'{{ product_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: workspace_product
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the workspace_product resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the workspace_product resource.
- name: workspace_id
value: "{{ workspace_id }}"
description: Required parameter for the workspace_product resource.
- name: product_id
value: "{{ product_id }}"
description: Required parameter for the workspace_product resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the workspace_product resource.
- name: properties
description: |
Product entity contract properties.
value:
description: "{{ description }}"
terms: "{{ terms }}"
subscriptionRequired: {{ subscriptionRequired }}
approvalRequired: {{ approvalRequired }}
subscriptionsLimit: {{ subscriptionsLimit }}
authenticationType:
- "{{ authenticationType }}"
application:
entra:
applicationId: "{{ applicationId }}"
audience: "{{ audience }}"
state: "{{ state }}"
displayName: "{{ displayName }}"
UPDATE examples
- update
Update existing product details.
UPDATE azure.api_management.workspace_product
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND product_id = '{{ product_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
REPLACE examples
- create_or_update
Creates or Updates a product.
REPLACE azure.api_management.workspace_product
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND product_id = '{{ product_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Delete product.
DELETE FROM azure.api_management.workspace_product
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND product_id = '{{ product_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND deleteSubscriptions = '{{ deleteSubscriptions }}'
;
Lifecycle Methods
- get_entity_tag
Gets the entity state (Etag) version of the product specified by its identifier.
EXEC azure.api_management.workspace_product.get_entity_tag
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@workspace_id='{{ workspace_id }}' --required,
@product_id='{{ product_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;