-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Import-AzureRmApiManagementApi can not set version #8432
Comments
@valiorik orik Can you verify whether you are using Az cmdlets, or AzureRm cmdlets for this? If you have executed Enable-AzureRmAlias, then the above would be using Az cmdlets, otherwise, it would be using your installed AzureRm cmdlets. Note that, if you don't want these cmdlets installed side-by-side, you cna use Uninstall-AzureRm to remove old versions of AzureRm cmdlets. |
@markcowl was running Az cmdlets. Had Enable-AzureRmAlias at the begging of the script and it didn't got to the code snippet I have posted. To double check removed AzureRm modules by running Uninstall-AzureRm and restarting the machine. PsApiManagementApi object I am getting after importing or creating new API looks like this:
ApiVersion property can be set, but calling Ideally Import-AzureRmApiManagementApi and New-AzureRmApiManagementApi should take ApiVersionSetId and ApiVersion as optional parameter to mimic portal behaviour and allow to create new Api with versioning from the begging. |
@solankisamir Can you take a look at this issue? |
Are there any plans to add what @valiorik suggested in Import-AzureRmApiManagementApi? |
Yes, we are fixing a bug in the service side and then add support. ETA 1 month |
released - v2.4.0-July2019 |
I still get the issue after updating to the latest Az Module. Running my script twice solves it.
|
Description
Powershell command Import-AzureRmApiManagementApi does not allow to set up the version of imported APIs.
Script/Steps for Reproduction
In Azure web portal I can choose a version of new API during its creation (ticking "Version this API?") and it will build a path just like I want it:
https://xxx.azure-api.net/1.0/
So in future new versions will fall to same format:
https://xxx.azure-api.net/1.1/
https://xxx.azure-api.net/1.2/
https://xxx.azure-api.net/2.0/
It would be ace to be able to do the same with PowerShell command. My deployments are fully automated, so configuring in Azure portal is out of the question.
As a workarround I have tried to import API without a version, get back PsApiManagementApi object and set it's version by calling
But getting the error:
Sadly PsApiManagementApi does not expose ApiVersionSetId parameter. So got stuck with this workarround as well.
Any ideas please?
Module Version
Environment Data
Debug Output
The text was updated successfully, but these errors were encountered: