2022-06-10 07:18:30 -04:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
2022-08-24 08:35:38 -04:00
|
|
|
"context"
|
|
|
|
|
2022-06-10 07:18:30 -04:00
|
|
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
|
|
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|