Microsoft Azure Virtual Machines
The Microsoft Azure Virtual Machines connector allows for the management of VMs through automated tasks, facilitating cloud infrastructure operations. This Connector ingests data from the Microsoft Azure Virtual Machines and integrates it with Swimlane Turbine.
Microsoft Azure Virtual Machines offer scalable computing resources in the cloud, providing the flexibility of virtualization without the need for physical hardware. This connector enables Swimlane Turbine users to manage Azure VMs directly from the platform, allowing for the listing, starting, and stopping of virtual machines within specified resource groups. By integrating with Azure Virtual Machines, security automation is enhanced, offering streamlined management and operational efficiency for incident response and routine tasks.
Prerequisites
To utilize the Microsoft Azure Virtual Machines connector within Swimlane Turbine, ensure you have the following:
- OAuth 2.0 client credentials for authentication with the following parameters:
- URL: Endpoint for Azure management API
- Client ID: Identifier for the registered Azure application
- Client Secret: Secret key generated for the Azure application
- Token URL: URL to retrieve the OAuth2 token
- Scopes: Permissions the app requires
Capabilities
This Connector provides the following capabilities:
- List All Virtual Machines
- Power Off Virtual Machines
- Start Virtual Machines
API Documentation Link
Configurations
Microsoft Azure Virtual Machines Oauth 2.0
Authenticates using oauth 2.0 client credentials
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
url | A URL to the target host. | string | Required |
token_url | Must start with https://login.microsoftonline.com/ and then continue with the tenant_id, and then be prepended with /oauth2/v2.0/token. | string | Required |
client_id | The client ID. | string | Required |
client_secret | The client secret. | string | Required |
scope | Permission scopes for this action. | array | Required |
verify_ssl | Verify SSL certificate. | boolean | Optional |
http_proxy | A proxy to route requests through. | string | Optional |
Actions
List All Virtual Machines
Retrieves a list of all virtual machines within a specified resource group in Microsoft Azure, requiring resource GroupName, subscription ID, and api-version.
Endpoint
- URL: /subscriptions/{{subscriptionId}}/providers/Microsoft.Compute/virtualMachines
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
parameters.api-version | string | Required | Client Api Version. |
parameters.$filter | string | Optional | The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq /subscriptions/ο»Ώ/resourceGroups/ο»Ώ/providers/Microsoft.Compute/virtualMachineScaleSets/ο»Ώ'. |
parameters.$expand | string | Optional | The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this can only be specified if a valid $filter option is specified. |
parameters.statusOnly | string | Optional | statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. |
path_parameters.subscriptionId | string | Required | Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
Input Example
{"parameters":{"api-version":"2024-03-01","$filter":"'virtualMachineScaleSet/id' eq /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'","$expand":"instanceView","statusOnly":"true"},"path_parameters":{"subscriptionId":"abcIZ47"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
value | array | Value for the parameter |
value.properties | object | Value for the parameter |
value.type | string | Type of the resource |
value.location | string | Value for the parameter |
value.tags | object | Value for the parameter |
value.id | string | Unique identifier |
value.name | string | Name of the resource |
value.plan | object | Value for the parameter |
value.plan.name | string | Name of the resource |
value.resources | array | Value for the parameter |
value.resources.properties | object | Value for the parameter |
value.resources.id | string | Unique identifier |
value.resources.name | string | Name of the resource |
value.resources.type | string | Type of the resource |
value.resources.location | string | Value for the parameter |
value.resources.tags | object | Value for the parameter |
value.resources.tags.key9428 | string | Value for the parameter |
value.identity | object | Unique identifier |
value.zones | array | Value for the parameter |
nextLink | string | Output field: nextLink |
Output Example
{"status_code":200,"response_headers":{"Transfer-Encoding":"chunked","Content-Type":"application/json","Content-Encoding":"gzip","Vary":"Accept-Encoding","Strict-Transport-Security":"max-age=31536000","Date":"Tue, 30 Apr 2024 10:36:47 GMT"},"reason":"OK","json_body":{"value":[{}],"nextLink":"a"}}
Power Off Virtual Machines
Powers off a specified Azure virtual machine without deallocating resources, allowing for a restart with existing provisions.
Endpoint
- URL: /subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.Compute/virtualMachines/{{vmName}}/powerOff
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
parameters.api-version | string | Required | Client Api Version. |
parameters.skipShutdown | boolean | Optional | The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified. |
path_parameters.resourceGroupName | string | Required | The name of the resource group. |
path_parameters.subscriptionId | string | Required | Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
path_parameters.vmName | string | Required | The name of the virtual machine. |
Input Example
{"parameters":{"api-version":"2024-03-01","skipShutdown":false},"path_parameters":{"resourceGroupName":"VM357","subscriptionId":"abcIZ47","vmName":"aaaaa"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
Output Example
{"status_code":200,"response_headers":{"Transfer-Encoding":"chunked","Content-Type":"application/json","Content-Encoding":"gzip","Vary":"Accept-Encoding","Strict-Transport-Security":"max-age=31536000","Date":"Tue, 30 Apr 2024 10:36:47 GMT"},"reason":"OK","json_body":{}}
Start Virtual Machines
Initiates the start process for an Azure VM specified by resource group, subscription ID, and VM name.
Endpoint
- URL: /subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.Compute/virtualMachines/{{vmName}}/start
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
parameters.api-version | string | Required | Client Api Version. |
path_parameters.resourceGroupName | string | Required | The name of the resource group. |
path_parameters.subscriptionId | string | Required | Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
path_parameters.vmName | string | Required | The name of the virtual machine. |
Input Example
{"parameters":{"api-version":"2024-03-01"},"path_parameters":{"resourceGroupName":"VM357","subscriptionId":"abcIZ47","vmName":"aaaaa"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
Output Example
{"status_code":200,"response_headers":{"Transfer-Encoding":"chunked","Content-Type":"application/json","Content-Encoding":"gzip","Vary":"Accept-Encoding","Strict-Transport-Security":"max-age=31536000","Date":"Tue, 30 Apr 2024 10:36:47 GMT"},"reason":"OK","json_body":{}}
Response Headers
Header | Description | Example |
|---|---|---|
Content-Encoding | HTTP response header: Content-Encoding | gzip |
Content-Type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Tue, 30 Apr 2024 10:36:47 GMT |
Strict-Transport-Security | HTTP response header: Strict-Transport-Security | max-age=31536000 |
Transfer-Encoding | HTTP response header: Transfer-Encoding | chunked |
Vary | HTTP response header: Vary | Accept-Encoding |