Description
I wanted to perform the following task using GO SDK for which I couldn't found any good example:
- Establishing Connection with Azure
- Stopping a VM instance
- Restarting the VM instance
- The first part is establishing the connection for which I used:
package main
import (
"fmt"
"github.com/Azure/go-autorest/autorest/azure/auth"
)
func main() {
authorizer, err := auth.NewAuthorizerFromEnvironment()
not sure it is the correct one. Anything else we need to set up here.
- For stopping the VM couldn't get the exact function but in the Go SDK code I found one:
- Same for starting the VM:
How to use it in GO SDK using the client?