Azure App services使用
实验内容链接:
需要注意几点:
在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.
-
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 add
does 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.
推荐阅读
-
使用F# Azure Storage Type Provider探索Azure
-
Azure App services使用
-
使用F# Azure Storage Type Provider探索Azure
-
Azure使用azure-cli创建虚拟机
-
使用 PowerShell 创建 Azure VM 的自定义映像
-
使用 Azure PowerShell 模块创建和管理 Windows VM
-
[Azure]使用Powershell将ARM虚拟机加入可用性集
-
使用Azure powershell 创建Azure虚拟机
-
[Azure]使用Powershell将ARM虚拟机(托管磁盘)加入可用性集
-
如何使用 Azure PowerShell 在 Azure Marketplace 中查找 Windows VM 映像