DEV Community

emmilly immaculate
emmilly immaculate

Posted on

Creating an Azure App Service Using Azure CLI

1.Log into your azure cli using

az login

Enter fullscreen mode Exit fullscreen mode

2.Next we shall create an azure resource group for our web app resources.

resource group

3.Now to create an app service use
create app service

  • --plan - to specify the azure web app plan name
  • --to specify the resource group
  • --is-linux - to specify os to run web app service on

4.To publish code first, we need to create a deployment user.

create user

  • user-name - username
  • password - the password

5.Then we have to check the available runtimes depending on the language of the web app.

run times list

6.Now, lets try to ceate the web app using

create web app

  • --plan - specify the name of app service plan
  • --name - to specify the name of web app
  • --resource-group - the resource group
  • --deployment-container-image-name - to specify web server to run web app on.
  • --deployment-local-git -enable use of git repository
  • --runtime - to specify the runtime for the web app

this should return a url

url

Curently the web app url shows the default nginx because we have deployed the code yet.
nginx default page

7.We are now going to add this url as a remote to our github project.

add remote

8.Next we are going to push the code to the azure repository.

push

.Add the deployment user password.

password

Top comments (0)