Azure
Prerequisite: Set Up Proxy and/or Load Balancer
Set up a proxy or load balancer that will intercept and manage traffic to your resources. This component is what enables the seamless start/stop functionality.
<h4>Azure App Gateway</h4>
Azure Application Gateway is a web traffic load balancer that enables you to manage traffic to your web applications. Application Gateway can make routing decisions based on additional attributes of an HTTP request, for example URI path or host headers.
<h4>AutoStopping Proxy</h4>
A This proxy VM sits in front of your virtual machines and intelligently starts or stops them based on incoming traffic. It supports both HTTP(S) and TCP connections. Built on the proven, open-source Envoy Proxy, the AutoStopping Proxy is capable of managing traffic for multiple AutoStopping-managed VMs from a single instance.Below table shows the resources supported by AutoStopping and the appropriate traffic management you can use for each resource type.
Azure VM
✅
✅
In the AutoStopping overview page, click Load Balancers in the top right. Click on Create Load Balancer and then Create AutoStopping Proxy.
Enter a name and select Azure in Cloud Provider
Choose a cloud connector or create a new one.
Enter Application Gateway Configuration.
Region: The region where your target VM or the cloud resource is hosted.
Resource Group: A Resource Group (RG) in Azure is a logical container that holds related resources for a solution. In the context of an Azure Application Gateway, the resource group serves as the container for the various resources associated with the Application Gateway, such as: Virtual Machines (VMs), Storage Accounts, Networking Resources, etc.
Virtual Network: Azure Virtual Network is a service that provides the fundamental building block for your private network in Azure. VNet allows you to create and manage virtual private networks (VPNs) in the Azure cloud.
Subnet: AppGateway subnet should only contain AppGateway, no other resources can be placed in this subnet.
Security Group to define the security rules that determine the inbound and outbound traffic.
TLS Certificate Configuration:
TLS Certificate Secret Version: Enter the value displayed in the Secret Identifier field on the Azure console.
TLS Private Key Secret Version: Create another secret for the private key and enter the value in this field.
Machine type: Select the type of VM that you want to set the AutoStopping rule for.
Key Pair: Enter the SSH key pair.
This key can be used to access the machine over SSH with the ubuntu user
API Key: Enter the NG API key. Choose No Expiration in the Expiration dropdown list while creating this API key. Go to Create an API Key for more information.
[OPTIONAL] Allocate Static IP: Enable to assign an elastic IP address
Makes the proxy publicly accessible
Remember to update your DNS records to point to this IP
5. Click on Save AutoStopping Proxy.
In the AutoStopping overview page, click Load Balancers in the top right
Enter a name and select Azure in Cloud Provider
Choose a cloud connector or create a new one.
Enter Application Gateway Configuration.
Region: The region where your target VM or the cloud resource is hosted.
Resource Group: A Resource Group (RG) in Azure is a logical container that holds related resources for a solution. In the context of an Azure Application Gateway, the resource group serves as the container for the various resources associated with the Application Gateway, such as: Virtual Machines (VMs), Storage Accounts, Networking Resources, etc.
Certificate (Optional)
Virtual Network: Azure Virtual Network is a service that provides the fundamental building block for your private network in Azure. VNet allows you to create and manage virtual private networks (VPNs) in the Azure cloud.
Subnet: AppGateway subnet should only contain AppGateway, no other resources can be placed in this subnet.
Frontend IP
SKU
Azure Function Region
Click on Save Load Balancer.
This newly created application gateway can be imported in any new Autostopping rule.
Create AutoStopping Rule
In Harness, navigate to Cloud Costs > AutoStopping Rules and click New AutoStopping Rule.

Select Cloud Provider as AWS. Select an existing AWS connector or create a new one.
Enter a Name for your rule
AutoStopping Type: Choose how you want your resources to be managed automatically. You can either choose Traffic-based with schedules optionally or Schedules only.
Traffic-based with schedules optionally: Resources automatically stop when idle and restart when traffic is detected. You can configure schedule overrides in advanced settings.
Schedules only: Resources automatically start and stop based on defined schedules. You can configure multiple schedules in advanced settings.
Set the Idle Time - how long an instance should be inactive before stopping
In the Resources to be managed by the AutoStopping rules section, select "VM". Post this, specify how you would like the resources to be handled once idle for the specified Idle Time: Shut Down or Hibernate.
Click on + Add an instance and select the VM you want to onboard.

Advanced Configuration (Optional):
Hide Progress Page: Toggle this to disable the display of a progress page during instance warm-up.
Dry-Run: Toggle this button if you wish to evaluate the feature without terminating your cloud resources.
Link your rule to other AutoStopping rules if resources depend on each other.
Click Add Dependency and select a rule from the RULES drop-down list.
In DELAY IN SECS, enter the number of seconds the dependent rule should wait after warming up before warming up this rule.

Create fixed uptime or downtime schedules for the resources managed by this rule. A fixed schedule takes precedence over the idle time logic.
Click Add Fixed Schedule.
Give the schedule a Name.
Select the Type of schedule (Uptime or Downtime).
Select the Time Zone.
Set the schedule period with Begins on and Ends on dates and times. You can also select the Never ends checkbox.
To set a recurring schedule, select the repeat frequency and the days of the week, and set the Start and End times. You can also select All Day.

-------
Now that you have the AutoStopping rule configured, define how you would want to access the underlying application running on the resources managed by this Rule. You can use either of the following or both the methods depending on your requirement.
Set up Access for HTTP/HTTPS workload: If the underlying applications running on the resources managed by the AutoStopping Rule are accessed by an HTTP or HTTPS URL.
Set up Access for TCP workload or SSH/RDP: If the underlying applications running on the resources managed by the AutoStopping Rule are accessed via TCP, SSH, or RDP.
OR Use Harness CLI to access resources through SSH/RDP
Set up access for TCP workload or SSH/RDP
Setting up access for TCP workload or SSH/RDP allows AutoStopping to detect activity and idleness, and ensure that the database is up and running only when you need it. Use the AutoStopping Proxy URL (IP/Hostname of the Proxy and a unique autogenerated port number) for this AutoStopping Rule when you connect to the RDS database using any database client. The Proxy URL is generated when you save the AutoStopping Rule. If you need to access the resources managed by this AutoStopping rule using TCP or SSH/RDP HTTPS URL, you need to perform the following steps:
Choose an AutoStopping Proxy load balancer from the Specify AutoStopping Proxy dropdown list to set up access.
Toggle SSH or RDP to specify the listening ports. The port number is autopopulated based on the security group.
Specify the source port numbers and the target TCP ports your application is listening to. If the source port is not specified, a random port will be generated at the backend. This auto-generated port will continue to be used as long as the target port remains unchanged or unless the user explicitly modifies the source port.
Click Next.
Set up access for HTTP/HTTPS workload
If you need to access the resources managed by this AutoStopping rule using an HTTP or HTTPS URL, you need to perform the following steps:
Choose an Application Load Balancer or an AutoStopping Proxy load balancer from the dropdown list to set up access.
Option A: HTTP/HTTPS Access (Load Balancer i.e. Azure Application Gateway)
Option B: SSH/RDP Access (AutoStopping Proxy)
In Review, verify all the configuration details and click Save Rule. To edit any of the configuration settings, click EDIT and modify the settings.
Your AutoStopping rule is listed under the AutoStopping Rules dashboard.
Azure AutoStopping Savings Computation
Billing data from Azure's amortized billing export will be used to compute savings for Azure VM-based AutoStopping rules. Please ensure the connector has amortized billing export enabled.
Important points to Remember:
Savings numbers will become precise only after the savings numbers are finalized after the 15th of the next month (after the final settlement). Savings will be recomputed for the previous month on the 15th of the next month to ensure any updates to CUR/billing-export are considered in the final savings numbers for the month.
GCP billing export configured in the billing connector needs to be "detailed".
Azure billing export configured in the billing connector needs to be "amortized".
For cluster-based AutoStopping rules, the corresponding billing-enabled connector of the CSP should be configured in Harness; otherwise, savings computation will be based on public pricing data.
Last updated
Was this helpful?