Open Strandfelt opened 1 year ago
Thank you for opening this issue, we will look into it.
This also happened to us.
@Hekku2 Our hotfix for now is to replace the az apim api update
command with the following:
az rest --method PATCH --uri https://management.azure.com/subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.ApiManagement/service/REDACTED/apis/REDACTED?api-version=2022-09-01-preview --body '{\"properties\":{\"authenticationSettings\":{\"oAuth2\":{\"authorizationServerId\":\"REDACTED\"}}}}'
Thanks @Strandfelt, I'll test that!
Adding Service team to look into this.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @adrianhall, @KedarJoshi.
Author: | Strandfelt |
---|---|
Assignees: | - |
Labels: | `bug`, `Service Attention`, `API Management`, `customer-reported`, `Auto-Assign` |
Milestone: | - |
FYI having the same issue as well
We are facing the same problem.
Looks like the issue is with the way control plane validates the OAuth2AuthenticationSettings contract. PG is aware of the issue and working on it now. Thanks for your patience.
Also getting this error when we run az apim api revision create
e.g.
az apim api revision create --api-id $ApiMgmtApiID `
--api-revision $NewRevision `
--resource-group $ResourceGroup `
--service-name $ApiMgmtName `
--api-revision-description "DeployID: $Build.BuildNumber"
ERROR: (ValidationError) One or more fields contain incorrect values: Code: ValidationError Message: One or more fields contain incorrect values: Exception Details: (ValidationError) Cannot use OAuth2AuthenticationSettings in combination with OAuth2 nor openid. Code: ValidationError Message: Cannot use OAuth2AuthenticationSettings in combination with OAuth2 nor openid. Target: oAuth2AuthenticationSettings (ValidationError) Cannot use OpenidAuthenticationSettings in combination with Openid nor OAuth2. Code: ValidationError Message: Cannot use OpenidAuthenticationSettings in combination with Openid nor OAuth2. Target: openidAuthenticationSettings
az version
{
"azure-cli": "2.53.0",
"azure-cli-core": "2.53.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"azure-devops": "0.26.0",
"interactive": "0.5.3",
"logic": "0.1.7",
"portal": "0.1.3",
"resource-graph": "2.1.0",
"storage-preview": "1.0.0b1"
}
}
Any updates @yingru97 ?
We are also facing same.
we are also facing the same issue when using REST API to import an API to APIM Workspace
Describe the bug
Following update to azure cli version
2.50.0
, our deployment script that imports an API to API Management Service and sets the OAuth2 authorization server ID now fails with the error:Cannot use OAuth2AuthenticationSettings in combination with OAuth2
This has been working for a long time on previous versions of the CLI. We are running the script in Azure Pipeline Agents.
Related command
az apim api import
az apim api update
Errors
Issue script & Debug output
First we import the API from its OpenAPI specifications:
Then we update the "authenticationSettings.oAuth2.authorizationServerId" property to enable authentication on the API
Full output with
--debug
:Expected behavior
The API should be imported from the specification and OAuth2 should be enabled on the API.
Environment Summary
Additional context
No response