azure-sdk-for-net: [BUG] 502 (Bad gateway) when using CheckExistence() for Event Grid
Describe the bug Hi, I’m trying to use the following method to check existence of Azure Event Grid existence:
client.Resources.CheckExistence(Configuration.ResourceGroupName, "Microsoft.EventGrid", "", "topics", "test", "2020-06-01");
I managed to get a result few times, but most executions fails with Service request failed. error.
Expected behavior
I should receive Response object with no error.
Actual behavior (include Exception or Stack Trace) In response I’m getting the following exception:
Service request failed.
Status: 502 (Bad Gateway)
Content:
Headers:
Cache-Control: no-cache
Pragma: no-cache
x-ms-failure-cause: REDACTED
x-ms-request-id: REDACTED
x-ms-correlation-request-id: REDACTED
x-ms-routing-request-id: REDACTED
Strict-Transport-Security: REDACTED
X-Content-Type-Options: REDACTED
Date: Tue, 09 Feb 2021 20:11:35 GMT
Connection: close
Content-Length: 151
Content-Type: application/json; charset=utf-8
Expires: -1
To Reproduce Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)
I’m authenticating and creating the client as follows:
var credentials = new ClientSecretCredential(Configuration.TenantId, Configuration.ClientId, Configuration.ClientSecret);
var client = new ResourcesManagementClient(Configuration.SubscriptionId, credentials);
Then I’m performing a bunch of other operations(like checking if RG exists and perfoming deployment - those operations succeed):
var rgExists = client.ResourceGroups.CheckExistence(Configuration.ResourceGroupName);
client.Deployments.StartCreateOrUpdate((..)
But the command client.Resources.CheckExistence(Configuration.ResourceGroupName, "Microsoft.EventGrid", "", "topics", "test", "2020-06-01") fails.
Environment:
- Azure.ResourceManager.Resources 1.0.0-preview.2, Azure.Identity 1.3.0
- VS Code 1.53.0
.NET SDK (reflecting any global.json):
Version: 5.0.102
Commit: 71365b4d42
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.102\
Host (useful for support):
Version: 5.0.2
Commit: cb5f173b96
.NET SDKs installed:
2.1.805 [C:\Program Files\dotnet\sdk]
3.1.102 [C:\Program Files\dotnet\sdk]
5.0.102 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (9 by maintainers)
I’m seeing the same issue with this api https://docs.microsoft.com/en-us/rest/api/resources/resources/checkexistencebyid also, however the response is
BadRequestfor me.P.S. the api version listed in the docs appears to be incorrect, if I use resources/getbyid which references the same api version
2020-06-01, I get an error that its not a supported api version.Thank you, @ahamad-MS. I believe the
ARMtag is what we’re looking for. I’ve retagged based on your feedback.