Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot retrieve Operational Insights Workspaces in East US #33536

Closed
droyad opened this issue Jan 17, 2023 · 5 comments · Fixed by #34031
Closed

[BUG] Cannot retrieve Operational Insights Workspaces in East US #33536

droyad opened this issue Jan 17, 2023 · 5 comments · Fixed by #34031
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. Monitor Monitor, Monitor Ingestion, Monitor Query needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@droyad
Copy link

droyad commented Jan 17, 2023

Library name and version

Azure.ResourceManager.OperationalInsights 1.0.0

Describe the bug

In some regions (e.g. East US) retrieving Operational Insights Workspaces throws:

System.FormatException: One of the identified items was in an invalid format.
   at System.Text.Json.ThrowHelper.ThrowFormatException()
   at System.Text.Json.JsonElement.GetDateTimeOffset()
   at Azure.ResourceManager.OperationalInsights.Models.OperationalInsightsWorkspaceSku.DeserializeOperationalInsightsWorkspaceSku(JsonElement element)
   at Azure.ResourceManager.OperationalInsights.OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(JsonElement element)
   at Azure.ResourceManager.OperationalInsights.WorkspacesRestOperations.GetAsync(String subscriptionId, String resourceGroupName, String workspaceName, CancellationToken cancellationToken)
   at Azure.ResourceManager.OperationalInsights.OperationalInsightsWorkspaceCollection.GetAsync(String workspaceName, CancellationToken cancellationToken)
   at Azure.ResourceManager.OperationalInsights.OperationalInsightsExtensions.GetOperationalInsightsWorkspaceAsync(ResourceGroupResource resourceGroupResource, String workspaceName, CancellationToken cancellationToken)

However in Australia East it works fine.

I've traced the code and it looks like it the API returns:

{ "name": "pergb2018", "lastSkuUpdate": "Tue, 17 Jan 2023 06:33:30 GMT"    }

Which can't be parsed as it expects an ISO formatted date

Expected behavior

The date is parsed correctly and the workspace is retrieved

Actual behavior

An exception is thrown

Reproduction Steps

var client = new ArmClient(new DefaultAzureCredential());
var subscription = client.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscriptionId));
var resourceGroup = subscription.GetResourceGroups().CreateOrUpdate(WaitUntil.Completed, "repro", new ResourceGroupData("East US"));
var workspace = resourceGroup.Value.GetOperationalInsightsWorkspaces().CreateOrUpdate(WaitUntil.Completed, "repro", new OperationalInsightsWorkspaceData("East US"));

resourceGroup.Value.GetOperationalInsightsWorkspace("repro");

Environment

No response

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 17, 2023
@droyad
Copy link
Author

droyad commented Jan 17, 2023

I ran it against all the regions, and it's only East US:


foreach (var location in subscription.GetLocations().Where(s => s.Metadata.RegionCategory == RegionCategory.Recommended))
{

	try
	{
		var workspace = resourceGroup.Value.GetOperationalInsightsWorkspaces().CreateOrUpdate(WaitUntil.Completed, location.Name, new OperationalInsightsWorkspaceData(location));
		resourceGroup.Value.GetOperationalInsightsWorkspace(location.Name);
		$"{location.DisplayName} Success".Dump();
	}
	catch (FormatException)
	{
		$"{location.DisplayName} Failed".Dump();
	}
}
East US Failed
East US 2 Success
South Central US Success
West US 2 Success
West US 3 Success
Australia East Success
Southeast Asia Success
North Europe Success
Sweden Central Success
UK South Success
West Europe Success
Central US Success
South Africa North Success
Central India Success
East Asia Success
Japan East Success
Korea Central Success
Canada Central Success
France Central Success
Germany West Central Success
Norway East Success
Switzerland North Success
UAE North Success
Brazil South Success

@droyad droyad changed the title [BUG] Cannot retrieve Operational Insights Workspaces [BUG] Cannot retrieve Operational Insights Workspaces in East US Jan 17, 2023
@jsquire jsquire added Monitor - Operational Insights Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jan 17, 2023
@jsquire
Copy link
Member

jsquire commented Jan 17, 2023

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

@fengzhou-msft fengzhou-msft added Service Attention Workflow: This issue is responsible by Azure service team. Monitor Monitor, Monitor Ingestion, Monitor Query labels Jan 17, 2023
@ghost
Copy link

ghost commented Jan 17, 2023

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

Issue Details

Library name and version

Azure.ResourceManager.OperationalInsights 1.0.0

Describe the bug

In some regions (e.g. East US) retrieving Operational Insights Workspaces throws:

System.FormatException: One of the identified items was in an invalid format.
   at System.Text.Json.ThrowHelper.ThrowFormatException()
   at System.Text.Json.JsonElement.GetDateTimeOffset()
   at Azure.ResourceManager.OperationalInsights.Models.OperationalInsightsWorkspaceSku.DeserializeOperationalInsightsWorkspaceSku(JsonElement element)
   at Azure.ResourceManager.OperationalInsights.OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(JsonElement element)
   at Azure.ResourceManager.OperationalInsights.WorkspacesRestOperations.GetAsync(String subscriptionId, String resourceGroupName, String workspaceName, CancellationToken cancellationToken)
   at Azure.ResourceManager.OperationalInsights.OperationalInsightsWorkspaceCollection.GetAsync(String workspaceName, CancellationToken cancellationToken)
   at Azure.ResourceManager.OperationalInsights.OperationalInsightsExtensions.GetOperationalInsightsWorkspaceAsync(ResourceGroupResource resourceGroupResource, String workspaceName, CancellationToken cancellationToken)

However in Australia East it works fine.

I've traced the code and it looks like it the API returns:

{ "name": "pergb2018", "lastSkuUpdate": "Tue, 17 Jan 2023 06:33:30 GMT"    }

Which can't be parsed as it expects an ISO formatted date

Expected behavior

The date is parsed correctly and the workspace is retrieved

Actual behavior

An exception is thrown

Reproduction Steps

var client = new ArmClient(new DefaultAzureCredential());
var subscription = client.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscriptionId));
var resourceGroup = subscription.GetResourceGroups().CreateOrUpdate(WaitUntil.Completed, "repro", new ResourceGroupData("East US"));
var workspace = resourceGroup.Value.GetOperationalInsightsWorkspaces().CreateOrUpdate(WaitUntil.Completed, "repro", new OperationalInsightsWorkspaceData("East US"));

resourceGroup.Value.GetOperationalInsightsWorkspace("repro");

Environment

No response

Author: droyad
Assignees: xboxeer
Labels:

Monitor, Monitor - Operational Insights, Service Attention, Mgmt, customer-reported, question, needs-team-attention

Milestone: -

@fengzhou-msft
Copy link
Member

@sameergMS @dadunl please help check if there is a disrepancy in the datetime format of the lastSkuUpdate property of WorkspaceSku between the East US location and others. The .NET SDK assumes that they all follow ISO 8601 format.

@waldyhester
Copy link

waldyhester commented Jan 31, 2023

Look at these requests and see that the datetime props are of different standards, this only happens in the region EASTUS

Example in eastus
"lastSkuUpdate": "Tue, 31 Jan 2023 14:29:38 GMT"
Example in eastus2
"lastSkuUpdate": "2023-01-31T15:01:27.5666098Z"

Request to eastus
https://management.azure.com/subscriptions/{HIDE}/resourcegroups/{HIDE}/providers/Microsoft.OperationalInsights/workspaces/{HIDE}?api-version=2022-10-01

Response body

{
  "properties": {
    "source": "Azure",
    "customerId": "{HIDE}",
    "provisioningState": "Succeeded",
    "sku": {
      "name": "pergb2018",
      "lastSkuUpdate": "Tue, 31 Jan 2023 14:29:38 GMT"
    },
    "retentionInDays": 30,
    "features": {
      "legacy": 0,
      "searchVersion": 1,
      "enableLogAccessUsingOnlyResourcePermissions": true
    },
    "workspaceCapping": {
      "dailyQuotaGb": -1,
      "quotaNextResetTime": "Wed, 01 Feb 2023 08:00:00 GMT",
      "dataIngestionStatus": "RespectQuota"
    },
    "publicNetworkAccessForIngestion": "Enabled",
    "publicNetworkAccessForQuery": "Enabled",
    "createdDate": "Tue, 31 Jan 2023 14:29:38 GMT",
    "modifiedDate": "Tue, 31 Jan 2023 14:32:11 GMT"
  },
  "id": "/subscriptions/{HIDE}/resourcegroups/rg-monitoring/providers/microsoft.operationalinsights/workspaces/{HIDE}",
  "name": "DefaultWorkspaceName",
  "type": "Microsoft.OperationalInsights/workspaces",
  "location": "eastus",
  "tags": {}
}

Request to eastus2
https://management.azure.com/subscriptions/{HIDE}/resourcegroups/{HIDE}/providers/Microsoft.OperationalInsights/workspaces/{HIDE}?api-version=2022-10-01

Response body

{
  "properties": {
    "customerId": "{HIDE}",
    "provisioningState": "Succeeded",
    "sku": {
      "name": "PerGB2018",
      "lastSkuUpdate": "2023-01-31T15:01:27.5666098Z"
    },
    "retentionInDays": 30,
    "features": {
      "legacy": 0,
      "searchVersion": 1,
      "enableLogAccessUsingOnlyResourcePermissions": true
    },
    "workspaceCapping": {
      "dailyQuotaGb": -1,
      "quotaNextResetTime": "2023-01-31T20:00:00Z",
      "dataIngestionStatus": "RespectQuota"
    },
    "publicNetworkAccessForIngestion": "Enabled",
    "publicNetworkAccessForQuery": "Enabled",
    "createdDate": "2023-01-31T15:01:27.5666098Z",
    "modifiedDate": "2023-01-31T15:01:27.5666098Z"
  },
  "location": "eastus2",
  "tags": {},
  "id": "/subscriptions/{HIDE}/resourceGroups/{HIDE}/providers/Microsoft.OperationalInsights/workspaces/{HIDE}",
  "name": "DefaultWorkspace",
  "type": "Microsoft.OperationalInsights/workspaces"
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. Monitor Monitor, Monitor Ingestion, Monitor Query needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants