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

Application Insights API now returns an undocumented 201 #2465

Closed
tombuildsstuff opened this issue Aug 15, 2018 · 2 comments
Closed

Application Insights API now returns an undocumented 201 #2465

tombuildsstuff opened this issue Aug 15, 2018 · 2 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization.

Comments

@tombuildsstuff
Copy link
Contributor

tombuildsstuff commented Aug 15, 2018

Bug Report

We're using v18.0.0 of the SDK and the package github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights

What happened?

Prior to ~2018-08-14 the Application Insights API returned a HTTP 200 when an Application Insights Component had been successfully created, as is documented in the Swagger. From around this date onwards the API is now returning a HTTP 201 - which isn't documented in the Swagger (either for v18.0.0, v19.1.0, or the latest branch) - which returns an error from the SDK.

What did you expect or want to happen?

A HTTP 200 should be returned from the API since this is what's documented in the Swagger. Whilst the Swagger could be updated to support returning a HTTP 201 - the API shouldn't return status codes which aren't defined in the Swagger - doubly so when this is a ~3 year old API version which has clients in-use.

We're able to work around this in the short-term by checking for this status code when an error occurs, but the API should be updated to return a HTTP 200 as is documented (rather than patching the Swagger). Given returning a different status code is a behavioural change - I believe that should be made in a new version of the API, so this doesn't break existing clients?

How can we reproduce it?

Request:

PUT /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tf-test/providers/Microsoft.Insights/components/tf-test-appinsights?api-version=2015-05-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.10.3 (amd64-darwin) go-autorest/v10.12.0 Azure-SDK-For-Go/v18.0.0 insights/2015-05-01;HashiCorp-Terraform-v0.11.3
Content-Length: 155
Content-Type: application/json; charset=utf-8
Accept-Encoding: gzip

{
	"kind": "Web",
	"location": "westeurope",
	"name": "tf-test-appinsights",
	"properties": {
		"ApplicationId": "tf-test-appinsights",
		"Application_Type": "Web"
	},
	"tags": {}
}

Response:

HTTP/1.1 201 Created
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 810
Content-Type: application/json; charset=utf-8
Expires: -1
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-writes: 1198
Server: Microsoft-IIS/8.5
X-Powered-By: ASP.NET
x-ms-request-id: e05192bf-ae47-45ba-b943-5f47f7a683b4
x-ms-correlation-request-id: e05192bf-ae47-45ba-b943-5f47f7a683b4
x-ms-routing-request-id: UKNORTH:20180815T065518Z:e05192bf-ae47-45ba-b943-5f47f7a683b4
Date: Wed, 15 Aug 2018 06:55:17 GMT

{
	"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tf-test/providers/microsoft.insights/components/tf-test-appinsights",
	"name": "tf-test-appinsights",
	"type": "microsoft.insights/components",
	"location": "westeurope",
	"tags": {},
	"kind": "Web",
	"etag": "\"1d00c625-0000-0000-0000-5b73ce550000\"",
	"properties": {
		"ApplicationId": "tf-test-appinsights",
		"AppId": "8d83c8a2-208b-48e0-a37d-bd35d7f127a5",
		"Application_Type": "Web",
		"Flow_Type": null,
		"Request_Source": null,
		"InstrumentationKey": "57fdaf46-d64e-48f3-aad7-027d08dd3cb5",
		"Name": "tf-test-appinsights",
		"CreationDate": "2018-08-15T06:55:17.9507571+00:00",
		"PackageId": null,
		"TenantId": "c0a607b2-6372-4ef3-abdb-dbe52a7b56ba",
		"HockeyAppId": null,
		"HockeyAppToken": null,
		"provisioningState": "Succeeded",
		"SamplingPercentage": null,
		"CustomMetricsOptedInType": null
	}
}

issue tracking this from our side: hashicorp/terraform-provider-azurerm#1762

@jhendrixMSFT
Copy link
Member

Per offline conversation with the service team this change was reverted on 8/30 so it should be returning 200 again. Please re-open if still an issue.

@ghost ghost removed the committed label Sep 11, 2018
@RickWinter RickWinter added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jul 12, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
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.
Projects
None yet
Development

No branches or pull requests

4 participants