实验内容链接:
需要注意几点:
在Azure Portal中找到 App services (不是App service plan等),开始创建Web App。
===========限制已经可以直接创建Web app,不需要再创建App services了。=============
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 fei@6666 master
如下为Task4
Task 4: Deploy code to the staging deployment slot
In this task, you will deploy code to the staging deployment slot.
-
In the Azure portal, open the Azure Cloud Shell by clicking on the icon in the top right of the Azure Portal.
-
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.
-
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 -
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/ -
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 adddoes not have to match the Deployment Credentials user name, but has to be unique - 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 -
If prompted to authenticate, type the
[deployment_user_name]and the corresponding password (which you set in the previous task). -
Close the Cloud Shell pane.
-
On the staging slot blade, click Overview and then click the URL link to display the default web page in a new browser tab.
- Verify that the browser page displays the Hello World! message and close the new tab.
本文指导如何通过Azure Cloud Shell使用PowerShell将Web应用代码部署到Azure Web App的预发布槽位,并验证部署结果。


被折叠的 条评论
为什么被折叠?



