profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/VaanPan/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Van Pan VaanPan Microsoft Corporation Shanghai

Azure/service-fabric-mesh-preview 88

Service Fabric Mesh is the Service Fabric's serverless offering to enable developers to deploy containerized applications without managing infrastructure. Service Fabric Mesh , aka project “SeaBreeze” is currently available in private preview. This repository will be used for tracking bugs/feature requests as GitHub issues and for maintaining the latest documentation.

VaanPan/HoloHacker 1

This project contains all test demo Holograms

VaanPan/azure-mobile-services 0

Client SDKs and Samples for Azure Mobile Services

VaanPan/iot-hub-python-get-started 0

This Python sample app is used by the getting started content to demonstrate how easy it is to create an IoTHub Instance on Azure portal, and register a new device for the IoTHub, then send a message from device (simulated device app) to cloud.

VaanPan/service-fabric-dotnet-key-functions 0

This C# project demonstrates use simple codes to present most Azure Service Fabric key functions, such as how to use Stateless WebAPI, Stateless Service, Stateful Service, Stateful Actor and communication between them.

PR opened Azure-Samples/resource-manager-python-resources-and-groups

Upgrade resource mgmt sdk from t1 to t2
  1. Upgrade resource mgmt sdk from t1 to t2.
  2. Updated files:
    1. README.md
    2. example.py
    3. requirements.txt

@jongio for notification.

+43 -43

0 comment

3 changed files

pr created time in 6 days

push eventAzure-Samples/storage-anti-malware

Tomi Paananen

commit sha e67fb46873d20d84b10422c362c3175bc74ae68c

Replaces templated URLs with correct ones.

view details

push time in 21 days

PublicEvent

issue closedAzure/service-fabric-mesh-preview

SeaBreeze CLI Setup not working

When following the SeaBreeze CLI Setup it fails. Running Azure CLI 2.0.30 in WSL fails when installing the Seabreeze extensions

az extension add --source https://seabreezepreview.blob.core.windows.net/cli/azure_cli_sbz-0.4.0-py2.py3-none-any.whl

Error: Traceback (most recent call last): File "/opt/az/lib/python3.6/runpy.py", line 183, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/opt/az/lib/python3.6/runpy.py", line 142, in _get_module_details return _get_module_details(pkg_main_name, error) File "/opt/az/lib/python3.6/runpy.py", line 109, in _get_module_details import(pkg_name) File "/opt/az/lib/python3.6/site-packages/pip/init.py", line 28, in <module> from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/opt/az/lib/python3.6/site-packages/pip/vcs/mercurial.py", line 9, in <module> from pip.download import path_to_url File "/opt/az/lib/python3.6/site-packages/pip/download.py", line 36, in <module> from pip.utils.glibc import libc_ver File "/opt/az/lib/python3.6/site-packages/pip/utils/glibc.py", line 4, in <module> import ctypes File "/opt/az/lib/python3.6/ctypes/init.py", line 7, in <module> from _ctypes import Union, Structure, Array ImportError: libffi.so.5: cannot open shared object file: No such file or directory

Command '['/opt/az/bin/python3', '-m', 'pip', 'install', '--target', '/home/Chris/.azure/cliextensions/azure-cli-sbz', '/tmp/tmp_ji7mrpn/azure_cli_sbz-0.4.0-py2.py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 1. Pip failed so deleting anything we might have installed at /home/Chris/.azure/cliextensions/azure-cli-sbz

closed time in a month

cvs79

PR opened Azure-Samples/AnomalyDetector

Update AnomalyDetector SDK to T2.

Updated sdk list:

  • Azure.AI.AnomalyDetector

@jongio for notification.

+33 -36

0 comment

1 changed file

pr created time in a month

Pull request review commentAzure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2

 package com.microsoft.cognitiveservice.anomalydetection; -import org.apache.http.HttpEntity;-import org.apache.http.client.methods.CloseableHttpResponse;-import org.apache.http.client.methods.HttpPost;-import org.apache.http.entity.StringEntity;-import org.apache.http.impl.client.CloseableHttpClient;-import org.apache.http.impl.client.HttpClients;-import org.apache.http.util.EntityUtils;+import com.azure.ai.anomalydetector.AnomalyDetectorAsyncClient;+import com.azure.ai.anomalydetector.AnomalyDetectorClientBuilder;+import com.azure.ai.anomalydetector.models.*;+import com.azure.core.credential.AzureKeyCredential;+import com.azure.core.http.HttpHeaders;+import com.azure.core.http.HttpPipeline;+import com.azure.core.http.HttpPipelineBuilder;+import com.azure.core.http.policy.AddHeadersPolicy;+import com.azure.core.http.policy.AzureKeyCredentialPolicy;+import com.azure.core.http.policy.HttpPipelinePolicy;+import org.json.JSONArray; import org.json.JSONObject; import org.json.JSONTokener; -import java.io.*;+import java.io.IOException;+import java.nio.CharBuffer;+import java.nio.charset.CharacterCodingException;+import java.nio.charset.Charset;+import java.nio.charset.CharsetDecoder;+import java.time.Instant;+import java.time.OffsetDateTime;+import java.time.ZoneOffset;+import java.util.ArrayList;+import java.util.List;  public class Main {     // **********************************************     // *** Update or verify the following values. ***     // **********************************************      // Replace the subscriptionKey string value with your valid subscription key.-    private static final String subscriptionKey = "<Subscription Key>";--    // Choose which anomaly detection way you want to use and change the uriBase's second part-    private static final String rootUrl = "https://westus2.api.cognitive.microsoft.com/anomalydetector/v1.0";-    private static final String lastDetect = "/timeseries/last/detect";-    private static final String entireDetect = "/timeseries/entire/detect";-    private static final String uriBase = rootUrl + lastDetect;--    public static void main(String[] args) throws FileNotFoundException  {-        String resourceName = "/request-data.json";-        InputStream is = Main.class.getResourceAsStream(resourceName);-        if (is == null) {-            throw new NullPointerException("Cannot find resource file " + resourceName);+    private static final String OCP_APIM_SUBSCRIPTION_KEY = "Ocp-Apim-Subscription-Key";++    private static final String CONTENT_TYPE = "Content-Type";++    private static final String APPLICATION_JSON = "application/json";++    private static final String SUBSCRIPTION_KEY = "<YOUR-SUBSCRIPTION-KEY>";++    private static final String END_POINT = "<YOUR-ANOMALY-DETECTOR-END-POINT>";++    private static final HttpPipelinePolicy AUTH_POLICY =+            new AzureKeyCredentialPolicy(OCP_APIM_SUBSCRIPTION_KEY,+                    new AzureKeyCredential(SUBSCRIPTION_KEY));++    private static final AddHeadersPolicy ADD_HEADERS_POLICY =+            new AddHeadersPolicy(new HttpHeaders().put(CONTENT_TYPE, APPLICATION_JSON));++    private static final HttpPipeline HTTP_PIPELINE =+            new HttpPipelineBuilder().policies(AUTH_POLICY, ADD_HEADERS_POLICY).build();++    public static void main(String[] args) throws IOException {++        AnomalyDetectorAsyncClient asyncClient = new AnomalyDetectorClientBuilder()+                .endpoint(END_POINT).pipeline(HTTP_PIPELINE).buildAsyncClient();++        JSONObject requestJson = new JSONObject(new JSONTokener((Main.class.getResourceAsStream("/request-data.json"))));+        List<TimeSeriesPoint> timeSeriesPointList = new ArrayList<>();+        JSONArray seriesArray = requestJson.getJSONArray("series");+        for (int i = 0; i < seriesArray.length(); i++) {+            JSONObject seriesObject = seriesArray.getJSONObject(i);+            TimeSeriesPoint timeSeriesPoint = new TimeSeriesPoint()+                    .setTimestamp(OffsetDateTime.ofInstant(Instant.parse(seriesObject.getString("timestamp")), ZoneOffset.UTC))+                    .setValue(seriesObject.getFloat("value"));+            timeSeriesPointList.add(timeSeriesPoint);         }-        JSONTokener tokener = new JSONTokener(is);-        String content = new JSONObject(tokener).toString();-        CloseableHttpClient client = HttpClients.createDefault();-        HttpPost request = new HttpPost(uriBase);--        // Request headers.-        request.setHeader("Content-Type", "application/json");-        request.setHeader("Ocp-Apim-Subscription-Key", subscriptionKey);--        try {-            StringEntity params = new StringEntity(content);-            request.setEntity(params);--            CloseableHttpResponse response = client.execute(request);-            try {-                HttpEntity respEntity = response.getEntity();-                if (respEntity != null) {-                    System.out.println("----------");-                    System.out.println(response.getStatusLine());-                    System.out.println("Response content is :\n");-                    System.out.println(EntityUtils.toString(respEntity, "utf-8"));-                    System.out.println("----------");++        DetectRequest request = new DetectRequest()+                .setGranularity(TimeGranularity.fromString(requestJson.getString("granularity")))+                .setSeries(timeSeriesPointList);++        asyncClient.detectLastPointWithResponse(request).subscribe(response -> {

Is there a reason you want access to the HttpResponse object? We expect people to generally not care about that and instead, use detectLastPoint

hongli750210

comment created time in a month

Pull request review commentAzure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2

 package com.microsoft.cognitiveservice.anomalydetection; -import org.apache.http.HttpEntity;-import org.apache.http.client.methods.CloseableHttpResponse;-import org.apache.http.client.methods.HttpPost;-import org.apache.http.entity.StringEntity;-import org.apache.http.impl.client.CloseableHttpClient;-import org.apache.http.impl.client.HttpClients;-import org.apache.http.util.EntityUtils;+import com.azure.ai.anomalydetector.AnomalyDetectorAsyncClient;+import com.azure.ai.anomalydetector.AnomalyDetectorClientBuilder;+import com.azure.ai.anomalydetector.models.*;+import com.azure.core.credential.AzureKeyCredential;+import com.azure.core.http.HttpHeaders;+import com.azure.core.http.HttpPipeline;+import com.azure.core.http.HttpPipelineBuilder;+import com.azure.core.http.policy.AddHeadersPolicy;+import com.azure.core.http.policy.AzureKeyCredentialPolicy;+import com.azure.core.http.policy.HttpPipelinePolicy;+import org.json.JSONArray; import org.json.JSONObject; import org.json.JSONTokener; -import java.io.*;+import java.io.IOException;+import java.nio.CharBuffer;+import java.nio.charset.CharacterCodingException;+import java.nio.charset.Charset;+import java.nio.charset.CharsetDecoder;+import java.time.Instant;+import java.time.OffsetDateTime;+import java.time.ZoneOffset;+import java.util.ArrayList;+import java.util.List;  public class Main {     // **********************************************     // *** Update or verify the following values. ***     // **********************************************      // Replace the subscriptionKey string value with your valid subscription key.-    private static final String subscriptionKey = "<Subscription Key>";--    // Choose which anomaly detection way you want to use and change the uriBase's second part-    private static final String rootUrl = "https://westus2.api.cognitive.microsoft.com/anomalydetector/v1.0";-    private static final String lastDetect = "/timeseries/last/detect";-    private static final String entireDetect = "/timeseries/entire/detect";-    private static final String uriBase = rootUrl + lastDetect;--    public static void main(String[] args) throws FileNotFoundException  {-        String resourceName = "/request-data.json";-        InputStream is = Main.class.getResourceAsStream(resourceName);-        if (is == null) {-            throw new NullPointerException("Cannot find resource file " + resourceName);+    private static final String OCP_APIM_SUBSCRIPTION_KEY = "Ocp-Apim-Subscription-Key";++    private static final String CONTENT_TYPE = "Content-Type";++    private static final String APPLICATION_JSON = "application/json";++    private static final String SUBSCRIPTION_KEY = "<YOUR-SUBSCRIPTION-KEY>";++    private static final String END_POINT = "<YOUR-ANOMALY-DETECTOR-END-POINT>";++    private static final HttpPipelinePolicy AUTH_POLICY =+            new AzureKeyCredentialPolicy(OCP_APIM_SUBSCRIPTION_KEY,+                    new AzureKeyCredential(SUBSCRIPTION_KEY));++    private static final AddHeadersPolicy ADD_HEADERS_POLICY =+            new AddHeadersPolicy(new HttpHeaders().put(CONTENT_TYPE, APPLICATION_JSON));++    private static final HttpPipeline HTTP_PIPELINE =+            new HttpPipelineBuilder().policies(AUTH_POLICY, ADD_HEADERS_POLICY).build();++    public static void main(String[] args) throws IOException {++        AnomalyDetectorAsyncClient asyncClient = new AnomalyDetectorClientBuilder()+                .endpoint(END_POINT).pipeline(HTTP_PIPELINE).buildAsyncClient();++        JSONObject requestJson = new JSONObject(new JSONTokener((Main.class.getResourceAsStream("/request-data.json"))));+        List<TimeSeriesPoint> timeSeriesPointList = new ArrayList<>();+        JSONArray seriesArray = requestJson.getJSONArray("series");+        for (int i = 0; i < seriesArray.length(); i++) {+            JSONObject seriesObject = seriesArray.getJSONObject(i);+            TimeSeriesPoint timeSeriesPoint = new TimeSeriesPoint()+                    .setTimestamp(OffsetDateTime.ofInstant(Instant.parse(seriesObject.getString("timestamp")), ZoneOffset.UTC))+                    .setValue(seriesObject.getFloat("value"));+            timeSeriesPointList.add(timeSeriesPoint);         }-        JSONTokener tokener = new JSONTokener(is);-        String content = new JSONObject(tokener).toString();-        CloseableHttpClient client = HttpClients.createDefault();-        HttpPost request = new HttpPost(uriBase);--        // Request headers.-        request.setHeader("Content-Type", "application/json");-        request.setHeader("Ocp-Apim-Subscription-Key", subscriptionKey);--        try {-            StringEntity params = new StringEntity(content);-            request.setEntity(params);--            CloseableHttpResponse response = client.execute(request);-            try {-                HttpEntity respEntity = response.getEntity();-                if (respEntity != null) {-                    System.out.println("----------");-                    System.out.println(response.getStatusLine());-                    System.out.println("Response content is :\n");-                    System.out.println(EntityUtils.toString(respEntity, "utf-8"));-                    System.out.println("----------");++        DetectRequest request = new DetectRequest()+                .setGranularity(TimeGranularity.fromString(requestJson.getString("granularity")))+                .setSeries(timeSeriesPointList);++        asyncClient.detectLastPointWithResponse(request).subscribe(response -> {+            System.out.println("Request detail information...................................");+            System.out.println("**************************************************************");+            System.out.println(String.format("Request url is : %s", response.getRequest().getUrl().toString()));+            response.getRequest().getHeaders().forEach(httpHeader -> {

There is no need to manually print these out. You can build the pipeline with new HttpLogOptions().setLogLevel(HttpLogDetailLevel.HEADERS_AND_BODY)?

hongli750210

comment created time in a month

Pull request review commentAzure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2

 package com.microsoft.cognitiveservice.anomalydetection; -import org.apache.http.HttpEntity;-import org.apache.http.client.methods.CloseableHttpResponse;-import org.apache.http.client.methods.HttpPost;-import org.apache.http.entity.StringEntity;-import org.apache.http.impl.client.CloseableHttpClient;-import org.apache.http.impl.client.HttpClients;-import org.apache.http.util.EntityUtils;+import com.azure.ai.anomalydetector.AnomalyDetectorAsyncClient;+import com.azure.ai.anomalydetector.AnomalyDetectorClientBuilder;+import com.azure.ai.anomalydetector.models.*;+import com.azure.core.credential.AzureKeyCredential;+import com.azure.core.http.HttpHeaders;+import com.azure.core.http.HttpPipeline;+import com.azure.core.http.HttpPipelineBuilder;+import com.azure.core.http.policy.AddHeadersPolicy;+import com.azure.core.http.policy.AzureKeyCredentialPolicy;+import com.azure.core.http.policy.HttpPipelinePolicy;+import org.json.JSONArray; import org.json.JSONObject; import org.json.JSONTokener; -import java.io.*;+import java.io.IOException;+import java.nio.CharBuffer;+import java.nio.charset.CharacterCodingException;+import java.nio.charset.Charset;+import java.nio.charset.CharsetDecoder;+import java.time.Instant;+import java.time.OffsetDateTime;+import java.time.ZoneOffset;+import java.util.ArrayList;+import java.util.List;  public class Main {     // **********************************************     // *** Update or verify the following values. ***     // **********************************************      // Replace the subscriptionKey string value with your valid subscription key.-    private static final String subscriptionKey = "<Subscription Key>";--    // Choose which anomaly detection way you want to use and change the uriBase's second part-    private static final String rootUrl = "https://westus2.api.cognitive.microsoft.com/anomalydetector/v1.0";-    private static final String lastDetect = "/timeseries/last/detect";-    private static final String entireDetect = "/timeseries/entire/detect";-    private static final String uriBase = rootUrl + lastDetect;--    public static void main(String[] args) throws FileNotFoundException  {-        String resourceName = "/request-data.json";-        InputStream is = Main.class.getResourceAsStream(resourceName);-        if (is == null) {-            throw new NullPointerException("Cannot find resource file " + resourceName);+    private static final String OCP_APIM_SUBSCRIPTION_KEY = "Ocp-Apim-Subscription-Key";++    private static final String CONTENT_TYPE = "Content-Type";++    private static final String APPLICATION_JSON = "application/json";++    private static final String SUBSCRIPTION_KEY = "<YOUR-SUBSCRIPTION-KEY>";++    private static final String END_POINT = "<YOUR-ANOMALY-DETECTOR-END-POINT>";++    private static final HttpPipelinePolicy AUTH_POLICY =+            new AzureKeyCredentialPolicy(OCP_APIM_SUBSCRIPTION_KEY,+                    new AzureKeyCredential(SUBSCRIPTION_KEY));++    private static final AddHeadersPolicy ADD_HEADERS_POLICY =+            new AddHeadersPolicy(new HttpHeaders().put(CONTENT_TYPE, APPLICATION_JSON));++    private static final HttpPipeline HTTP_PIPELINE =+            new HttpPipelineBuilder().policies(AUTH_POLICY, ADD_HEADERS_POLICY).build();++    public static void main(String[] args) throws IOException {++        AnomalyDetectorAsyncClient asyncClient = new AnomalyDetectorClientBuilder()+                .endpoint(END_POINT).pipeline(HTTP_PIPELINE).buildAsyncClient();++        JSONObject requestJson = new JSONObject(new JSONTokener((Main.class.getResourceAsStream("/request-data.json"))));+        List<TimeSeriesPoint> timeSeriesPointList = new ArrayList<>();+        JSONArray seriesArray = requestJson.getJSONArray("series");+        for (int i = 0; i < seriesArray.length(); i++) {+            JSONObject seriesObject = seriesArray.getJSONObject(i);+            TimeSeriesPoint timeSeriesPoint = new TimeSeriesPoint()+                    .setTimestamp(OffsetDateTime.ofInstant(Instant.parse(seriesObject.getString("timestamp")), ZoneOffset.UTC))+                    .setValue(seriesObject.getFloat("value"));+            timeSeriesPointList.add(timeSeriesPoint);         }-        JSONTokener tokener = new JSONTokener(is);-        String content = new JSONObject(tokener).toString();-        CloseableHttpClient client = HttpClients.createDefault();-        HttpPost request = new HttpPost(uriBase);--        // Request headers.-        request.setHeader("Content-Type", "application/json");-        request.setHeader("Ocp-Apim-Subscription-Key", subscriptionKey);--        try {-            StringEntity params = new StringEntity(content);-            request.setEntity(params);--            CloseableHttpResponse response = client.execute(request);-            try {-                HttpEntity respEntity = response.getEntity();-                if (respEntity != null) {-                    System.out.println("----------");-                    System.out.println(response.getStatusLine());-                    System.out.println("Response content is :\n");-                    System.out.println(EntityUtils.toString(respEntity, "utf-8"));-                    System.out.println("----------");++        DetectRequest request = new DetectRequest()+                .setGranularity(TimeGranularity.fromString(requestJson.getString("granularity")))+                .setSeries(timeSeriesPointList);++        asyncClient.detectLastPointWithResponse(request).subscribe(response -> {+            System.out.println("Request detail information...................................");+            System.out.println("**************************************************************");+            System.out.println(String.format("Request url is : %s", response.getRequest().getUrl().toString()));+            response.getRequest().getHeaders().forEach(httpHeader -> {+                System.out.println("**************************************************************");+                System.out.println(String.format("Request httpHeader name is : %s", httpHeader.getName()));+                System.out.println(String.format("Request httpHeader Value is : %s", httpHeader.getValue()));+            });+            response.getRequest().getBody().subscribe(byteBuffer -> {+                System.out.println("**************************************************************");+                Charset charset = Charset.forName("UTF-8");

StandardCharsets.UTF_8 is more common.

hongli750210

comment created time in a month

Pull request review commentAzure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2

 package com.microsoft.cognitiveservice.anomalydetection; -import org.apache.http.HttpEntity;-import org.apache.http.client.methods.CloseableHttpResponse;-import org.apache.http.client.methods.HttpPost;-import org.apache.http.entity.StringEntity;-import org.apache.http.impl.client.CloseableHttpClient;-import org.apache.http.impl.client.HttpClients;-import org.apache.http.util.EntityUtils;+import com.azure.ai.anomalydetector.AnomalyDetectorAsyncClient;+import com.azure.ai.anomalydetector.AnomalyDetectorClientBuilder;+import com.azure.ai.anomalydetector.models.*;+import com.azure.core.credential.AzureKeyCredential;+import com.azure.core.http.HttpHeaders;+import com.azure.core.http.HttpPipeline;+import com.azure.core.http.HttpPipelineBuilder;+import com.azure.core.http.policy.AddHeadersPolicy;+import com.azure.core.http.policy.AzureKeyCredentialPolicy;+import com.azure.core.http.policy.HttpPipelinePolicy;+import org.json.JSONArray; import org.json.JSONObject; import org.json.JSONTokener; -import java.io.*;+import java.io.IOException;+import java.nio.CharBuffer;+import java.nio.charset.CharacterCodingException;+import java.nio.charset.Charset;+import java.nio.charset.CharsetDecoder;+import java.time.Instant;+import java.time.OffsetDateTime;+import java.time.ZoneOffset;+import java.util.ArrayList;+import java.util.List;  public class Main {     // **********************************************     // *** Update or verify the following values. ***     // **********************************************      // Replace the subscriptionKey string value with your valid subscription key.-    private static final String subscriptionKey = "<Subscription Key>";--    // Choose which anomaly detection way you want to use and change the uriBase's second part-    private static final String rootUrl = "https://westus2.api.cognitive.microsoft.com/anomalydetector/v1.0";-    private static final String lastDetect = "/timeseries/last/detect";-    private static final String entireDetect = "/timeseries/entire/detect";-    private static final String uriBase = rootUrl + lastDetect;--    public static void main(String[] args) throws FileNotFoundException  {-        String resourceName = "/request-data.json";-        InputStream is = Main.class.getResourceAsStream(resourceName);-        if (is == null) {-            throw new NullPointerException("Cannot find resource file " + resourceName);+    private static final String OCP_APIM_SUBSCRIPTION_KEY = "Ocp-Apim-Subscription-Key";++    private static final String CONTENT_TYPE = "Content-Type";++    private static final String APPLICATION_JSON = "application/json";++    private static final String SUBSCRIPTION_KEY = "<YOUR-SUBSCRIPTION-KEY>";++    private static final String END_POINT = "<YOUR-ANOMALY-DETECTOR-END-POINT>";++    private static final HttpPipelinePolicy AUTH_POLICY =+            new AzureKeyCredentialPolicy(OCP_APIM_SUBSCRIPTION_KEY,+                    new AzureKeyCredential(SUBSCRIPTION_KEY));++    private static final AddHeadersPolicy ADD_HEADERS_POLICY =+            new AddHeadersPolicy(new HttpHeaders().put(CONTENT_TYPE, APPLICATION_JSON));++    private static final HttpPipeline HTTP_PIPELINE =+            new HttpPipelineBuilder().policies(AUTH_POLICY, ADD_HEADERS_POLICY).build();++    public static void main(String[] args) throws IOException {++        AnomalyDetectorAsyncClient asyncClient = new AnomalyDetectorClientBuilder()+                .endpoint(END_POINT).pipeline(HTTP_PIPELINE).buildAsyncClient();++        JSONObject requestJson = new JSONObject(new JSONTokener((Main.class.getResourceAsStream("/request-data.json"))));+        List<TimeSeriesPoint> timeSeriesPointList = new ArrayList<>();+        JSONArray seriesArray = requestJson.getJSONArray("series");+        for (int i = 0; i < seriesArray.length(); i++) {+            JSONObject seriesObject = seriesArray.getJSONObject(i);+            TimeSeriesPoint timeSeriesPoint = new TimeSeriesPoint()+                    .setTimestamp(OffsetDateTime.ofInstant(Instant.parse(seriesObject.getString("timestamp")), ZoneOffset.UTC))

This can be simplified to: Instant.parse(seriesObject.getString("timestamp")).atOffset(ZoneOffset.UTC);

Rather than using another static method.

hongli750210

comment created time in a month

Pull request review commentAzure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2

 package com.microsoft.cognitiveservice.anomalydetection; -import org.apache.http.HttpEntity;-import org.apache.http.client.methods.CloseableHttpResponse;-import org.apache.http.client.methods.HttpPost;-import org.apache.http.entity.StringEntity;-import org.apache.http.impl.client.CloseableHttpClient;-import org.apache.http.impl.client.HttpClients;-import org.apache.http.util.EntityUtils;+import com.azure.ai.anomalydetector.AnomalyDetectorAsyncClient;+import com.azure.ai.anomalydetector.AnomalyDetectorClientBuilder;+import com.azure.ai.anomalydetector.models.*;+import com.azure.core.credential.AzureKeyCredential;+import com.azure.core.http.HttpHeaders;+import com.azure.core.http.HttpPipeline;+import com.azure.core.http.HttpPipelineBuilder;+import com.azure.core.http.policy.AddHeadersPolicy;+import com.azure.core.http.policy.AzureKeyCredentialPolicy;+import com.azure.core.http.policy.HttpPipelinePolicy;+import org.json.JSONArray; import org.json.JSONObject; import org.json.JSONTokener; -import java.io.*;+import java.io.IOException;+import java.nio.CharBuffer;+import java.nio.charset.CharacterCodingException;+import java.nio.charset.Charset;+import java.nio.charset.CharsetDecoder;+import java.time.Instant;+import java.time.OffsetDateTime;+import java.time.ZoneOffset;+import java.util.ArrayList;+import java.util.List;  public class Main {     // **********************************************     // *** Update or verify the following values. ***     // **********************************************      // Replace the subscriptionKey string value with your valid subscription key.-    private static final String subscriptionKey = "<Subscription Key>";--    // Choose which anomaly detection way you want to use and change the uriBase's second part-    private static final String rootUrl = "https://westus2.api.cognitive.microsoft.com/anomalydetector/v1.0";-    private static final String lastDetect = "/timeseries/last/detect";-    private static final String entireDetect = "/timeseries/entire/detect";-    private static final String uriBase = rootUrl + lastDetect;--    public static void main(String[] args) throws FileNotFoundException  {-        String resourceName = "/request-data.json";-        InputStream is = Main.class.getResourceAsStream(resourceName);-        if (is == null) {-            throw new NullPointerException("Cannot find resource file " + resourceName);+    private static final String OCP_APIM_SUBSCRIPTION_KEY = "Ocp-Apim-Subscription-Key";++    private static final String CONTENT_TYPE = "Content-Type";++    private static final String APPLICATION_JSON = "application/json";++    private static final String SUBSCRIPTION_KEY = "<YOUR-SUBSCRIPTION-KEY>";++    private static final String END_POINT = "<YOUR-ANOMALY-DETECTOR-END-POINT>";++    private static final HttpPipelinePolicy AUTH_POLICY =

Is there a reason these all (AUTH_POLICY, ADD_HEADERS_POLICY, HTTP_PIPELINE) have to be static rather than using them inline in the main method?

This makes it really hard to follow.

hongli750210

comment created time in a month

Pull request review commentAzure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2

     <groupId>com.microsoft.cognitiveservice</groupId>     <artifactId>anomalydetction</artifactId>     <version>1.0</version>-+    <build>+        <plugins>+            <plugin>+                <groupId>org.apache.maven.plugins</groupId>+                <artifactId>maven-compiler-plugin</artifactId>+                <version>3.8.0</version>+                <configuration>+                    <source>11</source>+                    <target>11</target>+                </configuration>+            </plugin>+        </plugins>+    </build>     <dependencies>-        <dependency>-            <groupId>org.apache.httpcomponents</groupId>-            <artifactId>httpclient</artifactId>-            <version>4.5.2</version>-        </dependency>         <dependency>             <groupId>org.json</groupId>

You don't need to pull in this dependency. The track2 libraries have a dependency on Jackson which will easily deserialize the json file to an object.

hongli750210

comment created time in a month

Pull request review commentAzure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2

     <groupId>com.microsoft.cognitiveservice</groupId>     <artifactId>anomalydetction</artifactId>     <version>1.0</version>-+    <build>+        <plugins>+            <plugin>+                <groupId>org.apache.maven.plugins</groupId>+                <artifactId>maven-compiler-plugin</artifactId>+                <version>3.8.0</version>+                <configuration>+                    <source>11</source>

By default, we target JDK8

hongli750210

comment created time in a month

pull request commentAzure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2

@conniey - Is this something you can review for us? Thanks, Jon

hongli750210

comment created time in a month

issue commentAzure/service-fabric-mesh-preview

Service Instance ID for Logging

The service is retiring so don't think it's coming.

heymega

comment created time in a month

issue commentAzure/service-fabric-mesh-preview

Service Instance ID for Logging

I am interested as well to know.

heymega

comment created time in a month

issue commentAzure/service-fabric-mesh-preview

GA - Any time soon?

:(

dazinator

comment created time in a month

issue closedAzure/service-fabric-mesh-preview

GA - Any time soon?

We currently run a simple asp.net core website on azure app service for windows containers. We are now looking at expanding into more of a microservices architecture, and SF Mesh seems the next logical progression. We need to assess whether SF Mesh is going to faesible within our time frame, as we will have production customers and would need the SLA's and compliance that GA would bring, as opposed to "preview" status which doesn't offer the same level of guarantees. Is there any rough estimate on GA yet?

closed time in a month

dazinator

issue commentAzure/service-fabric-mesh-preview

GA - Any time soon?

That was a long time coming lol. I'll close this now.

dazinator

comment created time in a month

issue commentAzure/service-fabric-mesh-preview

GA - Any time soon?

It's here: https://azure.microsoft.com/en-us/updates/azure-service-fabric-mesh-preview-retirement/

dazinator

comment created time in a month

issue commentAzure/service-fabric-mesh-preview

GA - Any time soon?

@scottgu @ChackDan I too would like to know what is going on with Service Fabric Mesh. The getting started documentation is 2 years old, and requires us to use VS Studio 2017, and for me is not working. Even the Hello world is not working If I go to the samples the samples will not open even in VS 2017. When this was first announced this sounded like a great idea, bringing the power of service fabric but with a pay as you use model, but it looks like this has failed to deliver the same programming models including actors and reliable collections, and now is just being abandoned. Frankly even just being able to have serverless websites without a cold start would meet a lot of my needs. Please just let us know that this is the case.

dazinator

comment created time in a month

PR opened Azure-Samples/AnomalyDetector

Update Anomaly Detector SDK track1 to track2
  1. Update Anomaly Detector SDK track1 to track2
  2. Change files:
    1. quickstarts/sdk/node/src/index.ts
    2. quickstarts/sdk/node/package.json

@jongio for notification.

+17 -25

0 comment

2 changed files

pr created time in a month

issue commentAzure/service-fabric-mesh-preview

Provide sample with reliable collections

@tomkerkhove Above sample shows usage of Service Fabric Reliable volume not Reliable Collections.

tomkerkhove

comment created time in a month

PR opened Azure-Samples/AnomalyDetector

Change anomaly detector sample for java from track 1 to track2
  1. Change anomaly detector sample for java from track 1 to track2
  2. Changed file: 1)other-samples/java-sample/pom.xml 2)other-samples/java-sample/src/main/java/com/microsoft/cognitiveservice/anomalydetection/Main.java

@jongio for notification.

+114 -68

0 comment

2 changed files

pr created time in a month

MemberEvent
MemberEvent

issue commentAzure/service-fabric-mesh-preview

Visual Studio Extension not compatible with Visual Studio 2019 (Preview)

Bummers. I was excited about mesh and then found my way here. Looks like it's dead.

ppluijten

comment created time in 2 months

issue commentAzure/service-fabric-mesh-preview

Quickstart: Deploy Hello World not working

Hi. I got answer from MS Support: Service Fabric Mesh preview is temporarily disabled due to security reasons. While the service is disabled, if you attempt to utilize the Mesh service you will receive the following error message: "Cannot deploy Service Fabric Mesh application in region, reports insufficient capacity".

Waiting when Microsoft guys will enable SFM.

TobiasNissen

comment created time in 3 months

issue commentAzure/service-fabric-mesh-preview

Quickstart: Deploy Hello World not working

Hi @cankanat. Thank you for answer! Yes, It's help me. The deployment started but I got another error during deployment application (gateway and network is ok): { "status": "Failed", "error": { "code": "ClusterAllocationInsufficientCapacity", "message": "Insufficient capacity is available in this region. Please try again later or try a different region.", "details": [] } }

I'm trying two region West Europe and East US, checked quotas and nothing. Could you know something about it?

TobiasNissen

comment created time in 3 months

issue commentAzure/service-fabric-mesh-preview

Quickstart: Deploy Hello World not working

Hi @cankanat. Thank you for answer! Yes, It's help me. The deployment started but I got another error during deployment application (gateway and network is ok): { "status": "Failed", "error": { "code": "ClusterAllocationInsufficientCapacity", "message": "Insufficient capacity is available in this region. Please try again later or try a different region.", "details": [] } }

I'm trying two region West Europe and East US, checked quotas and nothing. Could you know something about it?

TobiasNissen

comment created time in 3 months

issue commentAzure/service-fabric-mesh-preview

Quickstart: Deploy Hello World not working

I solve this issue with using Deploy Custom Template. You can paste the template file to the template editor. I don't know exactly why, but when I did it this way, the deployment was successfully done.

image

TobiasNissen

comment created time in 3 months