Create API service using powershell

WinTechie 286 Reputation points
2023-09-02T12:31:39.4233333+00:00

Hi

I am looking for powershell command to provision API service (one of the app service kind)

I can't find relevant knowledge base on this azure offering, although I can create it from azure marketplace using portal.

When I look for the powershell commands most of them are either related to APIM service OR azure webapp service (New-AzWebApp)

Any suggestions or inputs would be highly appreciated

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

Accepted answer
  1. Konstantinos Passadis 19,586 Reputation points MVP
    2023-09-06T22:29:20.33+00:00

    Hello @WinTechie !

    Azure API Apps and Web Apps are both technically Azure App Services under the hood. The differentiation like "kind" is a matter of how Azure sets up and manages the app, rather than it being a completely separate resource. This is evident when you see that there's no direct PowerShell commandlet for creating an API App.

    In fact the API app can deploy any package the same way as other APP Services

    So to sum it up , no there is no similar command in Powershell

    If you look here :https://learn.microsoft.com/en-us/powershell/module/az.websites/new-azwebapp?view=azps-10.2.0

    you can see the supported commands

    I agree that the template shows API as kind but the only actual and observable difference is the Premium version

    We can re deploy the Template and change the kind to API as well , the same result we will get !

    Here is my proof , i deployed the same template :----------->

    User's image

    User's image

    User's image

    And then just changed the word api to app in the same template :

    User's image

    User's image

    Success! Only the icon changes !


    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Konstantinos Passadis 19,586 Reputation points MVP
    2023-09-04T02:26:51.36+00:00

    Hello @WinTechie !

    Good news !

    Finally i got this :

    https://learn.microsoft.com/en-us/azure/app-service/deploy-local-git?tabs=powershell

    Just change the cloned Repo to the API Repo !

    With a small tweak :

    git remote add azure <url>

    git push azure main:master It worked !

    Just skip the step to create a Deployment User and use the available from the Portal , Local Git Credentials!

    It worked like a charm !

    User's image

    User's image


    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.