Skip to main content

cloud_services

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

Overview

Namecloud_services
TypeResource
Idazure.compute.cloud_services

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource Id.
namestringResource name.
locationstringResource location.
propertiesobjectCloud service properties
systemDataobjectThe system meta data relating to this resource.
tagsobjectResource tags.
typestringResource type.
zonesarrayList of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. This field is optional.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, cloudServiceName, subscriptionIdDisplay information about a cloud service.
get_instance_viewselectresourceGroupName, cloudServiceName, subscriptionIdGets the status of a cloud service.
listselectresourceGroupName, subscriptionIdGets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services.
list_allselectsubscriptionIdGets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services.
create_or_updateinsertresourceGroupName, cloudServiceName, subscriptionId, data__locationCreate or update a cloud service. Please note some properties can be set only during cloud service creation.
updateupdateresourceGroupName, cloudServiceName, subscriptionIdUpdate a cloud service.
deletedeleteresourceGroupName, cloudServiceName, subscriptionIdDeletes a cloud service.
startexecresourceGroupName, cloudServiceName, subscriptionIdStarts the cloud service.
power_offexecresourceGroupName, cloudServiceName, subscriptionIdPower off the cloud service. Note that resources are still attached and you are getting charged for the resources.
restartexecresourceGroupName, cloudServiceName, subscriptionId, roleInstancesRestarts one or more role instances in a cloud service.
reimageexecresourceGroupName, cloudServiceName, subscriptionId, roleInstancesReimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
rebuildexecresourceGroupName, cloudServiceName, subscriptionId, roleInstancesRebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances.
delete_instancesexecresourceGroupName, cloudServiceName, subscriptionId, roleInstancesDeletes role instances in a cloud service.

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
cloudServiceNamestringName of the cloud service.
resourceGroupNamestringName of the resource group.
subscriptionIdstringSubscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

SELECT examples

Display information about a cloud service.

SELECT
id,
name,
location,
properties,
systemData,
tags,
type,
zones
FROM azure.compute.cloud_services
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND cloudServiceName = '{{ cloudServiceName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Create or update a cloud service. Please note some properties can be set only during cloud service creation.

INSERT INTO azure.compute.cloud_services (
data__location,
data__tags,
data__properties,
data__systemData,
data__zones,
resourceGroupName,
cloudServiceName,
subscriptionId
)
SELECT
'{{ location }}' /* required */,
'{{ tags }}',
'{{ properties }}',
'{{ systemData }}',
'{{ zones }}',
'{{ resourceGroupName }}',
'{{ cloudServiceName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type,
zones
;

UPDATE examples

Update a cloud service.

UPDATE azure.compute.cloud_services
SET
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND cloudServiceName = '{{ cloudServiceName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type,
zones;

DELETE examples

Deletes a cloud service.

DELETE FROM azure.compute.cloud_services
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND cloudServiceName = '{{ cloudServiceName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;

Lifecycle Methods

Starts the cloud service.

EXEC azure.compute.cloud_services.start 
@resourceGroupName='{{ resourceGroupName }}' --required,
@cloudServiceName='{{ cloudServiceName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;