I am trying to figure out how to create an API Management resource and an API Management API from a script. I believe there are two options:
.
Use the powershell Management api from AzureRm.ApiManagement
To do this I believe the two commands to use are:
New-AzureRmApiManagement
New-AzureRmApiManagementApi
.
Use the Management REST API
For this I believe to create the resource you would need to use the first option and then can use the following method with the Invoke-RestMethod powershell command:
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}?api-version=2019-01-01
.
I just want to pass the name of the new management api resource and the name of the devlab to create it under and have it created and then create an api underneath it that is not associated to a product (or associated to the unlimited default product...whichever is easier).
Can anyone help with the powershell script to do this?
Thanks.