Skip to main content

hybrid_use_benefits

Creates, updates, deletes, gets or lists a hybrid_use_benefits resource.

Overview

Namehybrid_use_benefits
TypeResource
Idazure.software_plan.hybrid_use_benefits

Fields

The following fields are returned by SELECT queries:

OK - returns the plan that is created

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
namestringThe name of the resource
etaginteger (int32)Indicates the revision of the hybrid use benefit
propertiesobjectProperty bag for a hybrid use benefit response
skuobjectHybrid use benefit SKU
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, planIdGets a given plan ID
listselectscope$filterGet all hybrid use benefits associated with an ARM resource.
createinsertscope, planId, data__skuCreate a new hybrid use benefit under a given scope
updateupdatescope, planId, data__skuUpdates an existing hybrid use benefit
deletedeletescope, planIdDeletes a given plan ID

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.

NameDatatypeDescription
planIdstringThis is a unique identifier for a plan. Should be a guid.
scopestringThe scope at which the operation is performed. This is limited to Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now
$filterstringSupports applying filter on the type of SKU

SELECT examples

Gets a given plan ID

SELECT
id,
name,
etag,
properties,
sku,
type
FROM azure.software_plan.hybrid_use_benefits
WHERE scope = '{{ scope }}' -- required
AND planId = '{{ planId }}' -- required
;

INSERT examples

Create a new hybrid use benefit under a given scope

INSERT INTO azure.software_plan.hybrid_use_benefits (
data__sku,
data__properties,
scope,
planId
)
SELECT
'{{ sku }}' /* required */,
'{{ properties }}',
'{{ scope }}',
'{{ planId }}'
RETURNING
id,
name,
etag,
properties,
sku,
type
;

UPDATE examples

Updates an existing hybrid use benefit

UPDATE azure.software_plan.hybrid_use_benefits
SET
data__sku = '{{ sku }}',
data__properties = '{{ properties }}'
WHERE
scope = '{{ scope }}' --required
AND planId = '{{ planId }}' --required
AND data__sku = '{{ sku }}' --required
RETURNING
id,
name,
etag,
properties,
sku,
type;

DELETE examples

Deletes a given plan ID

DELETE FROM azure.software_plan.hybrid_use_benefits
WHERE scope = '{{ scope }}' --required
AND planId = '{{ planId }}' --required
;