I am trying to programmatically using C# fetch the details of Auto-shutdown parameters for a selected VM from azure portal. The things i want to achieve are given below:
- First, get the auto shut down status it is enabled or disabled?
- If it is enabled then get auto shutdown time and its time zone related information
- Based on input update the timezone and time or disable the auto shutdown status on need basis
I want this to be done via C# program.
I am not knowing how to achieve it through the googling i have done. Please provide a detailed step by step guide how to achieve it as i am new to coding, C#, and AZURE
Please note that the VM's in our project are not created in any DevTest labs these are created through LCS directly and with DEMO env an option while creation.
Can you please provide details taking the above points into consideration? Or this is not possible as the step is not correct?
Please let me know if any other information is needed from my end to enable you provide me a solution.
I have already looked into below PowerShell script:
How to collect the Azure VM auto-shutdown time using PowerShell?
But this seems to be involving a VM created in DEV TEST lab which in my case will not work as our VM'S are not created in a separate lab has tried to explain above. Hence i think the script does not work
Tried to look into a few REST API but could not find anything there also.