azure-devops-python-api icon indicating copy to clipboard operation
azure-devops-python-api copied to clipboard

[azure arm endpoint creation] too many 500 error responses

Open mo-saeed opened this issue 5 years ago • 2 comments

Hello,

I am trying to use service_endpoint_client to create a new azure ARM service connection, here's the code I am using:

core_client = self.__get_connection().clients_v6_0.get_service_endpoint_client()
        try:
            azure_arm = core_client.create_service_endpoint(
                {
                    "authorization": {
                        "parameters": {
                            "tenantid": "TENANT_ID",
                            "scope": "/subscriptions/SUB_ID/resourcegroups/RG_NAME"
                        },
                        "scheme": "ServicePrincipal"
                    },
                    "data": {
                        "environment": "AzureCloud",
                        "scopeLevel": "Subscription",
                        "subscriptionId": "SUB_ID",
                        "subscriptionName": "SUB_NAME",
                        "creationMode": "Automatic"
                    },
                    "name": "TEST_ME",
                    "type": "azurerm",
                    "isReady": True,
                    "url": "https://management.azure.com/",
                    "serviceEndpointProjectReferences": [
                        {
                            "name": "TEST_ME",
                            "description": "test",
                            "projectReference": {
                                "id": "AZ_DEVOPS_PROJECT_ID"
                            }
                        }
                    ]
                }
            )

The service connection was created successfully but I got this exception:

msrest.exceptions.ClientRequestError: Error occurred in request., RetryError: HTTPSConnectionPool(host='****', port=443): Max retries exceeded with url: /_apis/serviceendpoint/endpoints (Caused by ResponseError('too many 500 error responses'))

Could you please help to identify the issue?

mo-saeed avatar Aug 20 '20 09:08 mo-saeed

Ok now this issue doesn't happen anymore and I am able to create the service connection but the service connection is created without the creation of the service principal account in azure and the verification of service connection failed with this error:

Failed to obtain the Json Web Token(JWT) using service principal client ID

mo-saeed avatar Aug 21 '20 07:08 mo-saeed

@mo-saeed Are you still facing the same issue even now. Actually we were also facing this same issue when we use above rest api but after adding my account as an owner role on the subscription issue got fixed

direddivya avatar Aug 21 '20 18:08 direddivya