Closed enaess closed 1 year ago
@wangmingliang-ms You have any updates on this, I created a Pull Request, but seems like nobody at Microsoft is watching this project???
@enaess Thanks a lot for your effort and really sorry for the late response. I've merged your fix,and will release the fix asap
@enaess Thanks again for your help, we have released gradle functions plugin 1.13.1 and gradle webapp plugin 1.8.1 which including your fixes. Please feel free to contact us once you meet any other issues!
Azure.az().config().setLogLevel(HttpLogDetailLevel.NONE.name());
Azure.az().config().setUserAgent(TelemetryAgent.getInstance().getUserAgent());
@Flanker32 Looks like the plugin still references the getUserAgent() from within the TelemetryAgent instance. Though, without the TelemetryAgent intialized at this point, the UserAgent string is null/null which is probably not what you want. However, if this Telemetry agent is disabled, this shouldn't have any impact. When it is enabled, I am not sure if that is what you want.
1697482319.290 191 172.21.0.1 NONE_NONE/200 0 CONNECT dc.services.visualstudio.com:443 - HIER_DIRECT/52.175.198.74 -
1697482319.324 126 172.21.0.1 NONE_NONE/200 0 CONNECT dc.services.visualstudio.com:443 - HIER_DIRECT/52.175.198.74 -
1697482319.353 58 172.21.0.1 TCP_MISS/200 619 POST https://dc.services.visualstudio.com/v2/track - HIER_DIRECT/52.175.198.74 application/json
1697482319.364 38 172.21.0.1 TCP_MISS/200 619 POST https://dc.services.visualstudio.com/v2/track - HIER_DIRECT/52.175.198.74 application/json
1697482319.388 290 172.21.0.1 NONE_NONE/200 0 CONNECT rt.services.visualstudio.com:443 - HIER_DIRECT/23.100.122.113 -
1697482319.452 62 172.21.0.1 TCP_MISS/200 499 POST https://rt.services.visualstudio.com/QuickPulseService.svc/ping? - HIER_DIRECT/23.100.122.113 -
1697482324.678 223 172.21.0.1 NONE_NONE/200 0 CONNECT rt.services.visualstudio.com:443 - HIER_DIRECT/23.100.122.113 -
1697482324.744 64 172.21.0.1 TCP_MISS/200 499 POST https://rt.services.visualstudio.com/QuickPulseService.svc/ping? - HIER_DIRECT/23.100.122.113 -
Apparently, upgrading to 1.13.1 didn't fix my problem. I don't know why gradle is still is trying to reach out to the URLs. It seems like the code DefaultQuickPulseDataFetcher is somehow enabled (maybe statically) in the code to to collect and send data to Microsoft??? I have no idea ...
It's great that you should be able to turn off the telemetry option via gradle extension
Though the option doesn't seem to work. When I specify this snippet in the my build.gradle file, it still sends requests to Microsoft:
This is the output for my squid cache:
Inspecting the AzureFunctionsPlugin.java, I find through code inspection that the option cannot possibly work (I've also stepped through the debugger to verify this).
While the extension is indeed registered, it is not populated with values until project is configured, e.g. project.afterEvaluate(), and the initialization of the TelemetryAgent occurs prior to any evaluation of the azureFunctions { } closure. At this point, the value of allowTelemetry in the extension object always evaluates to null, which the BooleanUtils.isNotFalse() evaluates to true (!isFalse(null) is true).
Anyhow, I'd like to be able to disable the telemetry option from my builds. Also, another aspect of this could be to embed (or allow a user to run
./gradlew -Pcom.microsoft.azure.allowTelemetry=false
on the command line alternatively set it in gradle.properties).Also, it maybe good to change the AzureFunctionExtension to use Property<> API with Gradle to allow for Lazy initialization. See here: https://docs.gradle.org/current/userguide/lazy_configuration.html
It would allow tasks you register to connect with the properties of the extension, but let the evaluation of these happen if the task is actually realized.