func getClients()

in internal/provider/provider.go [391:411]


func getClients(token *azidentity.ChainedTokenCredential, data gen.AlzModel, userAgent string) (*AlzProviderClients, diag.Diagnostics) {
	var diags diag.Diagnostics
	clients := new(AlzProviderClients)

	popts := new(policy.ClientOptions)
	popts.DisableRPRegistration = data.SkipProviderRegistration.ValueBool()
	popts.PerRetryPolicies = append(popts.PerRetryPolicies, withUserAgent(userAgent))

	client, err := armauthorization.NewRoleAssignmentsClient("", token, popts)

	// Create the clients
	//roleAssignmentsClient, err := newRoleAssignmentsClient(data)
	if err != nil {
		diags.AddError("failed to create Azure Role Assignments client: %v", err.Error())
		return clients, diags
	}

	clients.RoleAssignmentsClient = client

	return clients, diags
}