Azure / azure-cli

Azure Command-Line Interface
MIT License
3.98k stars 2.96k forks source link

Creating Api App in Azure App Services #2866

Closed prashanthmadi closed 6 years ago

prashanthmadi commented 7 years ago

Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: pip

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here: 2.0

OS Version: What OS and version are you using?
Answer here: any OS

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: cmd.exe


Description

I haven't seen option to create Api Apps at below link... Difference between webapps/apiapps/logicapps would be setting --kind.. is this option available ? https://docs.microsoft.com/en-us/cli/azure/appservice

yugangw-msft commented 7 years ago

No other user voices, so move to the backlog. For now, you can use az resource set to tweak the kind

tjprescott commented 7 years ago

Why do we not have a strongly typed generic update? az webapp update?

yugangw-msft commented 7 years ago

az webapp update is tracked by #892. It should do the work, but not really better though as both options are conceptual confusing

TomasMorton commented 7 years ago

@yugangw-msft Could you please provide an example of how to use az resource set to change the kind to an API app? I have tried the following, but the value does not change. az resource update -g "*" --resource-type "Microsoft.Web/sites" -n "*" --set kind="api" az resource update -g "*" --resource-type "Microsoft.Web/sites" -n "*" --set properties.kind="api"

yugangw-msft commented 7 years ago

@TomasMorton, apologize for giving out invalid suggestion, but updating the kind on an existing webapp is not a supported approach to switch app type . Not getting an error from server on invalid payload is a known server defects. I suggest you use az resource create to create api-app. For example:

az resource create -g yugangw2 -n yugangw2-api12 --resource-type Microsoft.web/sites  --is-full-object -p "{\"kind\":\"api\", \"location\":\"West US\", \"properties\":{  \"serverFarmId\":\"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272xxxxxx/resourcegroups/yugangw2/providers/Microsoft.Web/serverfarms/yugangw2-plan\"}}"
phekmat commented 7 years ago

@yugangw-msft related to this, is there a plan to include API apps (really, any app service whose kind is not "app") when doing az webapp list? I believe az appservice web list used to include them

yugangw-msft commented 7 years ago

//CC @mayurid @williexu We scoped webapp commands be only for webapps, when we integrated functionapp support. Since we don't have bear-term plans yet to on-board strong typed commands for api-app, I am fine to change our filtering logics from in ['app', 'app,linux'] to !=functionapp

yugangw-msft commented 6 years ago

I have updated the filter so webapp list should include api-app