2022-06-10 07:18:30 -04:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
|
|
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (c *Client) CreateApplicationInsight(ctx context.Context) error {
|
|
|
|
properties := armapplicationinsights.Component{
|
2022-07-27 16:02:33 -04:00
|
|
|
Kind: to.Ptr("web"),
|
|
|
|
Location: to.Ptr(c.location),
|
2022-06-10 07:18:30 -04:00
|
|
|
Properties: &armapplicationinsights.ComponentProperties{
|
2022-07-27 16:02:33 -04:00
|
|
|
ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
|
2022-06-10 07:18:30 -04:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
_, err := c.applicationInsightsAPI.CreateOrUpdate(
|
|
|
|
ctx,
|
|
|
|
c.resourceGroup,
|
|
|
|
"constellation-insights-"+c.uid,
|
|
|
|
properties,
|
|
|
|
nil,
|
|
|
|
)
|
|
|
|
return err
|
|
|
|
}
|