Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.37k stars 4.79k forks source link

[QUERY] Determining IsOnline in ApiCollection.GetAllAsync #37854

Closed adahlinvcrs closed 9 months ago

adahlinvcrs commented 1 year ago

Library name and version

Azure.ResourceManager.ApiManagement 1.0.1

Query/Question

When using the ApiCollection.GetAllAsync method, APIs that are offline are indicated by the IsOnline property being set as false, but for online APIs it is null. image

Using the API Management Rest API, we can see that the property is not included in the response for APIs that are online, but included as false for APIs that are offline.

Example properties for an API that is online:

"properties": {
    "displayName": "Test Api",
    "apiRevision": "123123123",
    "description": "123123123",
    "subscriptionRequired": true,
    "serviceUrl": "123123123",
    "path": "123123123",
    "protocols": [
        "https"
    ],
    "authenticationSettings": {
        "oAuth2": null,
        "openid": null
    },
    "subscriptionKeyParameterNames": {
        "header": "123123123",
        "query": "123123123"
    },
    "contact": {
        "name": null,
        "url": null,
        "email": "123123123"
    },
    "isCurrent": true,
    "apiRevisionDescription": "123123123",
    "apiVersion": "v2",
    "apiVersionDescription": "",
    "apiVersionSetId": "123123123"
}

Example properties for an API that is offline:

"properties": {
    "displayName": "Test Api",
    "apiRevision": "123123123",
    "description": "123123123",
    "subscriptionRequired": true,
    "serviceUrl": "123123123",
    "path": "123123123",
    "protocols": [
        "https"
    ],
    "authenticationSettings": {
        "oAuth2": null,
        "openid": null
    },
    "subscriptionKeyParameterNames": {
        "header": "123123123",
        "query": "123123123"
    },
    "contact": {
        "name": null,
        "url": null,
        "email": "123123123"
    },
    "isCurrent": true,
    "isOnline": false,
    "apiRevisionDescription": "123123123",
    "apiVersion": "v2",
    "apiVersionDescription": "",
    "apiVersionSetId": "123123123"
}

Is the expected method for determining that an API is online to check for the property being null when using the Azure.ResourceManager.ApiManagement nuget package?

Thank you!

Environment

Windows 10 net6.0 project Visual Studio 2022 17.4.2

jsquire commented 1 year ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

github-actions[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @miaojiang.

HarveyLink commented 1 year ago

This looks like a service domain quetion, add service attention label here.

HarveyLink commented 9 months ago

As the test results using REST Api, the isOnline property will only show when value is false in the result, its a service issue.

ArthurMa1978 commented 9 months ago

Hey @adahlinvcrs , thank you for reaching out to us about the Azure SDK for .NET. Unfortunately, this issue is related to the service side and not the SDK side, so we are not able to help you with it. Therefore, we are closing this issue for now. If you need more assistance, please open an Azure support request. We apologize for any inconvenience this may cause you.

We value your feedback and we want to make sure that your problem is solved. If you think that we have misunderstood your issue or closed it incorrectly, please feel free to comment on this thread and reopen the issue. We will be happy to assist you further. Thank you for your understanding and cooperation.