Azure Quantum client: Add environment variable to set User-Agent prefix (#805)
* Add environment variable to set User-Agent prefix * Reuse QuantumJobClientOptions to pass the user-agent prefix
This commit is contained in:
Родитель
7bf27f0b3b
Коммит
85190d2bec
|
@ -196,7 +196,7 @@ Tests will be marked as Inconclusive if the pre-reqs are not correctly setup.";
|
|||
}
|
||||
|
||||
var options = new QuantumJobClientOptions();
|
||||
options.Diagnostics.ApplicationId = "ClientTests";
|
||||
options.Diagnostics.ApplicationId = Environment.GetEnvironmentVariable("AZURE_QUANTUM_NET_APPID") ?? "ClientTests";
|
||||
|
||||
var credential = Authentication.CredentialFactory.CreateCredential(Authentication.CredentialType.Default);
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ namespace Microsoft.Azure.Quantum
|
|||
// Optional parameters:
|
||||
credential ??= CredentialFactory.CreateCredential(CredentialType.Default, subscriptionId);
|
||||
options ??= new QuantumJobClientOptions();
|
||||
options.Diagnostics.ApplicationId = options.Diagnostics.ApplicationId
|
||||
?? Environment.GetEnvironmentVariable("AZURE_QUANTUM_NET_APPID");
|
||||
|
||||
this.ResourceGroupName = resourceGroupName;
|
||||
this.WorkspaceName = workspaceName;
|
||||
|
|
Загрузка…
Ссылка в новой задаче