You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Import-AzureRmApiManagementApi is not mapping the relative path for SpecificationPath to the current working directory. It jumps to the root of the drive.
Script/Steps for Reproduction
$SwaggerFilePath=".\apim\swagger\apimanager-api-SomeService.json"#CWD is somewhere nested deep in folder hierarchy.$ApiMgmtContext=New-AzureRmApiManagementContext-ResourceGroupName $ResourceGroupName-ServiceName $APIMServiceNameImport-AzureRmApiManagementApi-Context $ApiMgmtContext-SpecificationFormat Swagger -SpecificationPath $SwaggerFilePath-Path $APIMEndpointPath
Module Version
Update: I updated AzureRM module to latest version at the time of this comment. I don't see a difference in the debug output.
Get-Module-Name AzureRM -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
-------------------------------------
Script 6.4.0 AzureRM
Script 5.5.0 AzureRM
Environment Data
$PSVersionTable
Name Value
---------
PSVersion 5.1.15063.1088
PSEdition Desktop
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
BuildVersion 10.0.15063.1088
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Debug Output
Import-AzureRmApiManagementApi : Could not find a part of the path 'D:\apim\swagger\apimanager-api-SomeService.json'.
At line:1 char:1
Description
Import-AzureRmApiManagementApi
is not mapping the relative path forSpecificationPath
to the current working directory. It jumps to the root of the drive.Script/Steps for Reproduction
Module Version
Update: I updated AzureRM module to latest version at the time of this comment. I don't see a difference in the debug output.
Environment Data
Debug Output
Import-AzureRmApiManagementApi : Could not find a part of the path 'D:\apim\swagger\apimanager-api-SomeService.json'.
At line:1 char:1
DEBUG: AzureQoSEvent: CommandName - Import-AzureRmApiManagementApi; IsSuccess - False; Duration - 00:00:00.0601188; Exception - System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\apim\swagger\apimanager-api-SomeService.json'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath,
Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.Azure.Commands.ApiManagement.ServiceManagement.ApiManagementClient.ApiImportFromFile(PsApiManagementContext context, String apiId, PsApiManagementApiFormat specificationFormat, String specificationPath, String apiPath, String wsdlServiceName,
String wsdlEndpointName, Nullable`1 apiType)
at Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands.ImportAzureApiManagementApi.ExecuteApiManagementCmdlet()
at Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands.AzureApiManagementCmdletBase.ExecuteCmdlet();
DEBUG: Finish sending metric.
DEBUG: 3:18:12 PM - ImportAzureApiManagementApi end processing.
DEBUG: 3:18:12 PM - ImportAzureApiManagementApi end processing.
The text was updated successfully, but these errors were encountered: