欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Azure App services使用

程序员文章站 2023-12-30 17:52:58
...

实验内容链接:

https://microsoftlearning.github.io/AZ-104-MicrosoftAzureAdministrator/Instructions/Labs/LAB_09a-Implement_Web_Apps.html

 

需要注意几点:

 

在Azure Portal中找到  App services (不是App service plan等),开始创建Web App。

Task4 在git push时提交到的是master分支,而有些仓库的默认分支是main,那么需要如下三步,新建master分支,切换至master分支,再上传。

PS /home/user/web> git branch master

PS /home/user/web> git checkout master
Switched to branch 'master'

PS /home/user/web> git branch
  main
* master
PS /home/user/web> git push [email protected] master

 

如下为Task4

Task 4: Deploy code to the staging deployment slot

In this task, you will deploy code to the staging deployment slot.

  1. In the Azure portal, open the Azure Cloud Shell by clicking on the icon in the top right of the Azure Portal.

  2. If prompted to select either Bash or PowerShell, select PowerShell.

    Note: If this is the first time you are starting Cloud Shell and you are presented with the You have no storage mounted message, select the subscription you are using in this lab, and click Create storage.

  3. From the Cloud Shell pane, run the following to clone the remote repository containing the code for the web app.

    git clone https://github.com/Azure-Samples/php-docs-hello-world
    
  4. From the Cloud Shell pane, run the following to set the current location to the newly created clone of the local repository containing the sample web app code.

    Set-Location -Path $HOME/php-docs-hello-world/
    
  5. From the Cloud Shell pane, run the following to add the remote git (make sure to replace the [deployment_user_name] and [git_clone_url] placeholders with the value of the Deployment Credentials user name and Git Clone Url, respectively, which you identified in previous task):

    git remote add [deployment_user_name] [git_clone_url]
    

    Note: The value following git remote add does not have to match the Deployment Credentials user name, but has to be unique

  6. From the Cloud Shell pane, run the following to push the sample web app code from the local repository to the Azure web app staging deployment slot (make sure to replace the [deployment_user_name] placeholder with the value of the Deployment Credentials user name, which you identified in previous task):
    git push [deployment_user_name] master
    
  7. If prompted to authenticate, type the [deployment_user_name] and the corresponding password (which you set in the previous task).

  8. Close the Cloud Shell pane.

  9. On the staging slot blade, click Overview and then click the URL link to display the default web page in a new browser tab.

  10. Verify that the browser page displays the Hello World! message and close the new tab.

 

 

 

 

上一篇:

下一篇: