azure-powershell
azure-powershell copied to clipboard
Import-AzApiManagementApi: AuthorizationServerId is reset when importing an API.
Description
Step 1: Run New-AzApiManagementApi and specify -AuthorizationServerId. Authorization is set as expected. Step 2: Run Import-AzApiManagementApi. Authorization is being set to null.
I would expect the import to not have any effect on the AuthorizationServerId, since i cannot specify it in the parameters of Import-AzApiManagementApi.
Issue script & Debug output
New-AzApiManagementApi `
-Context $ApiMgmtContext `
-ApiId "test" `
-Name "test" `
-ServiceUrl "https://test.com/api" `
-Path "test" `
-Protocols @("https") `
-AuthorizationServerId $AuthorizationServerId
Import-AzApiManagementApi `
-Context $ApiMgmtContext `
-ApiId "test" `
-SpecificationFormat "OpenApiJson" `
-SpecificationPath $SpecificationPath `
-Path "test"
Environment data
Name Value
---- -----
PSVersion 7.2.5
PSEdition Core
GitCommitId 7.2.5
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Module versions
ModuleType Version PreRelease Name
---------- ------- ---------- ----
Script 3.0.0 Az.ApiManagement
Error output
No response
Thank you for your feedback. This has been routed to the support team for assistance.
Any thoughts?
@johnsrsly Apologies for the late reply. Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.
CC @RakeshMohanMSFT
@johnsrsly We are unable to reproduce this issue at our end. Please see image below. 1) We created an API with a auth server. 2) We imported an API without specifying any auth server.


Let us know if we are missing something.
Hi @johnsrsly. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.
Hi @johnsrsly, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.