Attempt to create OpenAPI document only if rest is enabled#1872
Merged
Aniruddh25 merged 4 commits intomainfrom Nov 10, 2023
Merged
Attempt to create OpenAPI document only if rest is enabled#1872Aniruddh25 merged 4 commits intomainfrom
Aniruddh25 merged 4 commits intomainfrom
Conversation
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
abhishekkumams
approved these changes
Nov 9, 2023
aaronburtle
approved these changes
Nov 9, 2023
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
ayush3797
approved these changes
Nov 9, 2023
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
seantleonard
approved these changes
Nov 9, 2023
Contributor
seantleonard
left a comment
There was a problem hiding this comment.
thanks for updating.
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Aniruddh25
added a commit
that referenced
this pull request
Nov 13, 2023
## Why make this change? - OpenAPI document is needed only when rest is enabled. For cosmosdb_nosql it is never enabled. So, any attempts to create the document will always fail. This shows up as a failure in the logs and has the potential to misguide the actual error that could cause a failure to start the engine. - E.g. see below logs from a [question on stackoverflow](https://stackoverflow.com/questions/77432995/dataapibuilderexception-while-trying-to-run-swa-start) > [dataApi] fail: Azure.DataApiBuilder.Service.Startup[0] > [dataApi] OpenAPI Documentor initialization failed. > [dataApi] Azure.DataApiBuilder.Service.Exceptions.DataApiBuilderException: OpenAPI description document can't be created when the REST endpoint is disabled globally. > [dataApi] at Azure.DataApiBuilder.Core.Services.OpenApiDocumentor.CreateDocument() in /_/src/Core/Services/OpenAPI/OpenApiDocumentor.cs:line 108 > [dataApi] at Azure.DataApiBuilder.Service.Startup.PerformOnConfigChangeAsync(IApplicationBuilder app) in /_/src/Service/Startup.cs:line 687 > [dataApi] Unable to launch the runtime due to an error. > [dataApi] Error: Failed to start the engine. > [dataApi] cd "C:\Users\alexa\source\repos\az-lead\swa-db-connections" && "C:\Users\alexa\.swa\dataApiBuilder\0.9.6-rc\Microsoft.DataApiBuilder.exe" start -c staticwebapp.database.config.json --no-https-redirect exited with code 0 - On the surface the above error seems to be due to an OpenApi document creation failure, but it shouldn't be the case. We still need more customer logs to understand the issue. This PR is to fix the misguided logs. ## What is this change? - Gaurd OpenAPI document creation call with a check for REST is enabled or not. - Change the log error to log warning - to avoid misguiding. ## How was this tested? - Started the engine locally to verify after the change the failure is gone for CosmosDb_NoSql. ## Sample Request(s) Before when the engine has successfully started for CosmosDB_NoSql:  After:  --------- Co-authored-by: Abhishek Kumar <[email protected]>
Aniruddh25
added a commit
that referenced
this pull request
Nov 13, 2023
## Why make this change? This is simply cherry-picking the following PRs before creating the next stable 0.9 version: - #1876 - #1821 - #1854 - #1851 - #1872 - #1868 --------- Co-authored-by: Sean Leonard <[email protected]> Co-authored-by: Abhishek Kumar <[email protected]> Co-authored-by: neeraj-sharma2592 <[email protected]> Co-authored-by: Neeraj Sharma (from Dev Box) <[email protected]> Co-authored-by: aaronburtle <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
question on stackoverflow
What is this change?
How was this tested?
Sample Request(s)
Before when the engine has successfully started for CosmosDB_NoSql:

After:
