Newbie question. I am using "az apim api import" CLI to register my API in APIM. We are using different gateways in the APIM. By default, it uses the default gateway as the Base URL. My question is how do you use CLI to assign a different gateway to the Base URL? I don't see a parameter for the CLI to assign the "Base URL" to a given API. Am I missing something? Thanks
Asked
Active
Viewed 2,876 times
1 Answers
0
There is no way to change gateway URL i.e, Base URL
through CLI or any other place. When we create Azure APIM
by default it takes(base url:<apim-service-name>.azure-api.net
, Developer url:<apim-service-name>.developer.azure-api.net
) which is provided by AZURE which will be similar for all azure resources like web App service url
uses this https://websitename.azurewebsites.net
.
To add or change gateway url you will need to create Custom domain name .You can refer this MICROSOFT DOCUMENTATION: For Configuring a custom domain name for your Azure API Management instance

AjayKumarGhose
- 4,257
- 2
- 4
- 15
-
Thanks Ajay. Yes, I am going to create a custom domain for it. My APIM currently have multiple custom domains in it. My question is, how do you associated an API to a particular custom domain during the "az apim api import"? – Ultra GC Jan 21 '22 at 21:13
-
Hello @Ultra GC, Could you please refer this SO THREAD : [Azure CLI - Bash script to set up API Management custom domain](https://stackoverflow.com/questions/64851783/azure-cli-bash-script-to-set-up-api-management-custom-domain) – AjayKumarGhose Jan 22 '22 at 03:55
-
AFAIK, during `az apim api import` Its not possible . We can use [az apim update](https://learn.microsoft.com/en-us/cli/azure/apim/api?view=azure-cli-latest#az-apim-api-update) to update the host name. – AjayKumarGhose Jan 22 '22 at 03:59