Add user agent to table storage state store
@@ -45,6 +45,7 @@ import (
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/data/aztables"
jsoniter "github.com/json-iterator/go"
"github.com/pkg/errors"
@@ -102,6 +103,14 @@ func (r *StateStore) Init(metadata state.Metadata) error {
}
}
+ opts := aztables.ClientOptions{
+ ClientOptions: policy.ClientOptions{
+ Telemetry: policy.TelemetryOptions{
+ ApplicationID: "dapr-" + logger.DaprVersion,
+ },
+ },
+ }
+
if meta.AccountKey != "" {
// use shared key authentication
cred, innerErr := aztables.NewSharedKeyCredential(meta.AccountName, meta.AccountKey)
@@ -109,7 +118,7 @@ func (r *StateStore) Init(metadata state.Metadata) error {
return innerErr
}
- client, innerErr = aztables.NewServiceClientWithSharedKey(serviceURL, cred, nil)
+ client, innerErr = aztables.NewServiceClientWithSharedKey(serviceURL, cred, &opts)
if innerErr != nil {
return innerErr
}
@@ -130,7 +139,7 @@ func (r *StateStore) Init(metadata state.Metadata) error {
if innerErr != nil {
return innerErr
}
- client, innerErr = aztables.NewServiceClient(serviceURL, token, nil)
+ client, innerErr = aztables.NewServiceClient(serviceURL, token, &opts)
if err != nil {
return innerErr
}
