(subscriptionId string)
| 260 | } |
| 261 | |
| 262 | func initTelemetryClient(subscriptionId string) telemetry.Client { |
| 263 | cfg, err := cfgfile.GetConfig() |
| 264 | if err != nil { |
| 265 | return telemetry.NewNullClient() |
| 266 | } |
| 267 | enabled, installId := cfg.TelemetryEnabled, cfg.InstallationId |
| 268 | if !enabled { |
| 269 | return telemetry.NewNullClient() |
| 270 | } |
| 271 | if installId == "" { |
| 272 | uuid, err := uuid.NewV4() |
| 273 | if err == nil { |
| 274 | installId = uuid.String() |
| 275 | } else { |
| 276 | installId = "undefined" |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | sessionId := "undefined" |
| 281 | if uuid, err := uuid.NewV4(); err == nil { |
| 282 | sessionId = uuid.String() |
| 283 | } |
| 284 | return telemetry.NewAppInsight(subscriptionId, installId, sessionId) |
| 285 | } |
| 286 | |
| 287 | func (f FlagSet) buildAuthConfig() (*config.AuthConfig, error) { |
| 288 | clientId := f.flagClientId |
no test coverage detected