如何使用服务主体创建Azure事件中心客户端,而不是通过环境变量传递所有参数

Create eventhub client using service principal but not from the environment varibales, using parameters, 1. Create Eventhub client options := getOptions(tenantId, clientId,secret) provider, _ := aad.NewJWTProvider(options) hub, err := eventhubGo.NewHub(namespace, name, provider)

2. The blow function provide the Options,

func getOptions(tenantId string, clientId, secrets string) 
    aad.JWTProviderOption {
    return func(config *aad.TokenProviderConfiguration) error {
        config.TenantID = tenantId
        config.ClientID = clientId
        config.ClientSecret = secrets
        config.Env = &azure.PublicCloud
        return nil
    }
}

Is my approach is correct?