Automating Daily Metric Collection and Storage in Private Azure Environment

Yu-Jeong Seo 130 Reputation points
2024-11-19T01:45:20.81+00:00

I want to extract the metric values of VMs configured in the Azure environment and automatically save them as CSV files to a Storage Account on a daily basis. While my PowerShell script is working, I am facing difficulties in saving the data to the Storage Account due to the specific constraints of the Azure environment.

  1. To access the Azure Portal, I must go through the proxy of the VM already configured in Azure.
  2. Both the Storage Account and VMs have very restrictive inbound allow rules (Storage Account + Private Link, VM + NSG).
  3. Additionally, there are restrictions in place due to VWAN and Azure Firewall.

Q1: Given these circumstances, is it possible to use Azure Automation to perform daily checks and save the CSV files to the Storage Account? While using a Hybrid Worker to save to Storage is an option, will it work in this constrained environment? I am also unsure about how Azure Automation communicates with the VMs (e.g., via internet traffic, Microsoft network backbone, etc.).

Q2: If Azure Automation is not an option, are there alternative methods to check the resource usage daily? Ultimately, the CPU, memory, and disk usage need to be saved as a CSV file in the Storage Account. (In this case, the storage has restricted access through Private Link.)

I'm sorry for the lengthy questions as my English is not very strong. I really appreciate your help. Thank you!

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,244 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,264 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,634 questions
{count} votes

Accepted answer
  1. Ashok Gandhi Kotnana 860 Reputation points Microsoft Vendor
    2024-11-19T07:09:21.4166667+00:00

    HI @Yu-Jeong Seo

    Welcome to Microsoft Q&A Forum, thank you for posting your query here! I have understood your required Please find the below two solution that might help you.

    A1) Yes it will work using automation account you need to follow the below steps

    1.Create an automation account in the Networking tab of the automation account disable public network access and enable private endpoint
    Note: The private endpoint should be created on the same network where your storage account resides so that your automation account will speak to the storage account within your network Please check the configuration below.
    Disable the Public IP and enable the private endpointUser's image While creating the private endpoint please make sure you select same network where the storage account is created so that traffic will flow within your internal networkUser's image
    A2) Create a new virtual machine within the same network as your storage account. Enable the System Assigned Managed Identity on the VM and assign it the appropriate permissions to access the storage account. Specifically, grant the identity the "Storage Blob Data Contributor" role. Follow these steps:

    User's image

    User's imageSelect the identity which you have enabled for the virtual machine to communicate with the storage account.User's image Please select the resource instance belowUser's image

    Please let us know if any help, we are always here to help whenever you need us.User's image

    Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.