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

Microsoft.Web FunctionSecrets incorrect response body #7155

Closed

Conversation

lawrencegripper
Copy link

This is a quick PR to resolve an inconsistency between the rest specs and the actual response from the service API which is blocking a Terraform change.

Terraform Change: hashicorp/terraform-provider-azurerm#4066

Response does not container key and trigger under a properties object. They are at the top level. Also the ProxyOnlyResource values are not populated so I have removed these. Below is a response observed from the API.

2019/09/06 18:44:58 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/5774ad8f-d51e-4456-a72e-0447910568d3/resourceGroups/acctestRG-190906184259523442/providers/Microsoft.Web/sites/acctest-190906184259523442-func/functions/testfunc/listsecrets?api-version=2018-02-01: 
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Fri, 06 Sep 2019 17:44:57 GMT
Expires: -1
Pragma: no-cache
Server: Microsoft-IIS/10.0
Server: Microsoft-IIS/10.0
Set-Cookie: ARRAffinity=dcb710fa4b4f37e252a09aa7622aa6877443e01a6826dc6315d627d3e24938b7;Path=/;HttpOnly;Domain=acctest-190906184259523442-func.scm.azurewebsites.net
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding,Accept-Encoding
X-Aspnet-Version: 4.0.30319
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 6798cf5f-0f80-4edb-417a-795f39053598
X-Ms-Ratelimit-Remaining-Subscription-Writes: 1195
X-Ms-Request-Id: 3ec9d873-52eb-40a3-b3cb-c757384b029c
X-Ms-Routing-Request-Id: UKWEST:20190906T174458Z:9c9e5933-e722-4a86-94de-6ddf9d4a0a80
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET

Body:
{"key":"eL43nOMQie1Yd5somekeyhere0y5V2AqEX2tA==","trigger_url":"https://acctest-190906184259523442-func.azurewebsites.net/api/testfunc?code=eL43nOMQie1Yd5somekeyhereWrzS30y5V2AqEX2tA=="}

Co-authored-by: Eliise Seling [email protected]

Contribution checklist:

  • I have reviewed the documentation for the workflow.
  • Validation tools were run on swagger spec(s) and have all been fixed in this PR.
  • The OpenAPI Hub was used for checking validation status and next steps.

@openapi-sdkautomation
Copy link

openapi-sdkautomation bot commented Sep 9, 2019

In Testing, Please Ignore

[Logs] (Generated from 19f764b, Iteration 4)

Succeeded .NET: test-repo-billy/azure-sdk-for-net [Logs] [Diff]
Succeeded Python: test-repo-billy/azure-sdk-for-python [Logs] [Diff]
Failed Java: test-repo-billy/azure-sdk-for-java [Logs] [Diff]
Warning Go: test-repo-billy/azure-sdk-for-go [Logs] [Diff]
Succeeded JavaScript: test-repo-billy/azure-sdk-for-js [Logs] [Diff]
Succeeded Ruby: test-repo-billy/azure-sdk-for-ruby [Logs] [Diff]

@AutorestCI
Copy link

AutorestCI commented Sep 9, 2019

Automation for azure-sdk-for-go

Encountered an unknown error: (azure-sdk-for-go)

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/azure_devtools/ci_tools/github_tools.py", line 33, in exception_to_github
    yield context
  File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 170, in rest_handle_action
    return rest_pull_close(body, restapi_repo, sdk_pr_target_repo, sdkbase, sdk_tag)
  File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 185, in rest_pull_close
    rest_pr_management(rest_pr, sdk_pr_target_repo, sdk_tag, sdk_default_base)
  File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github_handler.py", line 151, in rest_pr_management
    sdk_tag=sdk_tag
  File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/SwaggerToSdkNewCLI.py", line 254, in generate_sdk_from_git_object
    with manage_git_folder(gh_token, Path(temp_dir) / Path("rest"), branched_rest_api_id, pr_number=pr_number) as restapi_git_folder, \
  File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.6/dist-packages/azure_devtools/ci_tools/github_tools.py", line 272, in manage_git_folder
    clone_to_path(gh_token, temp_dir, split_git_id[0], branch_or_commit=branch, pr_number=pr_number)
  File "/usr/local/lib/python3.6/dist-packages/azure_devtools/ci_tools/github_tools.py", line 212, in clone_to_path
    repo.git.checkout(branch_or_commit)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 548, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 1014, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 825, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git checkout 06c15be24fef689eae7d274343c508c113dc53cc
  stderr: 'fatal: reference is not a tree: 06c15be24fef689eae7d274343c508c113dc53cc'

@AutorestCI
Copy link

AutorestCI commented Sep 9, 2019

Automation for azure-sdk-for-python

Encountered an unknown error: (azure-sdk-for-python)

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/azure_devtools/ci_tools/github_tools.py", line 33, in exception_to_github
    yield context
  File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 170, in rest_handle_action
    return rest_pull_close(body, restapi_repo, sdk_pr_target_repo, sdkbase, sdk_tag)
  File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 185, in rest_pull_close
    rest_pr_management(rest_pr, sdk_pr_target_repo, sdk_tag, sdk_default_base)
  File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github_handler.py", line 151, in rest_pr_management
    sdk_tag=sdk_tag
  File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/SwaggerToSdkNewCLI.py", line 254, in generate_sdk_from_git_object
    with manage_git_folder(gh_token, Path(temp_dir) / Path("rest"), branched_rest_api_id, pr_number=pr_number) as restapi_git_folder, \
  File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.6/dist-packages/azure_devtools/ci_tools/github_tools.py", line 272, in manage_git_folder
    clone_to_path(gh_token, temp_dir, split_git_id[0], branch_or_commit=branch, pr_number=pr_number)
  File "/usr/local/lib/python3.6/dist-packages/azure_devtools/ci_tools/github_tools.py", line 212, in clone_to_path
    repo.git.checkout(branch_or_commit)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 548, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 1014, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 825, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git checkout 06c15be24fef689eae7d274343c508c113dc53cc
  stderr: 'fatal: reference is not a tree: 06c15be24fef689eae7d274343c508c113dc53cc'

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@lawrencegripper
Copy link
Author

Looks like I broke something, just looking to fix up now. Sorry my first time submitting a PR to the specs.

@lawrencegripper
Copy link
Author

Looks like this is stuck on the following validation:

Potential new ARM errors
========================
R3016 - DefinitionsPropertiesNamesCamelCase
Property named: 'trigger_url', for definition: 'FunctionSecrets' must follow camelCase style. Example: 'trigger_url'.
  at specification/web/resource-manager/Microsoft.Web/stable/2018-11-01/WebApps.json:18904

The problem I have is that this is how the API behaves and I am not part of the team maintaining it so can't response this bit.

What is the best way to proceed?

@yungezz
Copy link
Member

yungezz commented Sep 17, 2019

add code owners for reviewing @LukaszStem @naveedaz @nking92. since this is breaking change in stable version, need code owners to determine are they swagger spec bug or breaking change.

@lawrencegripper
Copy link
Author

Closing this out now as partially covered by #7174 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants