-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ZipDeploy API when deploying functions apps #24740
base: main
Are you sure you want to change the base?
Conversation
️✔️Az.Accounts
️✔️Az.Network
❌Az.Websites
|
Hi @dannysongg, please check my comments and suppress the "Invalid_Cmdlet" errors in CI. |
Co-authored-by: Yan Xu <yanxu1@microsoft.com>
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s), but failed to run 1 pipeline(s). |
# Set Java runtime to 1.8 | Tomcat. In order to deploy war, site should be configured to run with stack = TOMCAT | ||
# or JBOSSEAP (only availble on Linux). In this test case, it creates Windows app. | ||
$javaVersion="1.8" | ||
$javaContainer="TOMCAT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format is not right. Please re-format it.
try | ||
{ | ||
#Setup | ||
New-AzureRmResourceGroup -Name $rgname -Location $location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a deprecated cmdlet. Please double confirm your cmdlets in test.
{ | ||
#Setup | ||
New-AzureRmResourceGroup -Name $rgname -Location $location | ||
$serverFarm = New-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $planName -Location $location -Tier $tier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AzureRm prefix has been replaced with Az. Please use the new prefix.
$serverFarm = New-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $planName -Location $location -Tier $tier | |
$serverFarm = New-AzAppServicePlan -ResourceGroupName $rgname -Name $planName -Location $location -Tier $tier |
$serverFarm = New-AzureRmAppServicePlan -ResourceGroupName $rgname -Name $planName -Location $location -Tier $tier | ||
|
||
# Create new web app | ||
$webapp = New-AzureRmWebApp -ResourceGroupName $rgname -Name $appName -Location $location -AppServicePlan $planName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$webapp = New-AzureRmWebApp -ResourceGroupName $rgname -Name $appName -Location $location -AppServicePlan $planName | |
$webapp = New-AzWebApp -ResourceGroupName $rgname -Name $appName -Location $location -AppServicePlan $planName |
finally | ||
{ | ||
# Cleanup | ||
Remove-AzureRmResourceGroup -Name $rgname -Force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove-AzureRmResourceGroup -Name $rgname -Force | |
Remove-AzResourceGroup -Name $rgname -Force |
try | ||
{ | ||
#Setup | ||
New-AzureRmResourceGroup -Name $rgname -Location $location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New-AzureRmResourceGroup -Name $rgname -Location $location | |
New-AzResourceGroup -Name $rgname -Location $location |
$javaContainer="TOMCAT" | ||
$javaContainerVersion="8.5" | ||
$PropertiesObject = @{javaVersion = $javaVersion;javaContainer = $javaContainer;javaContainerVersion = $javaContainerVersion} | ||
New-AzResource -PropertyObject $PropertiesObject -ResourceGroupName $rgname -ResourceType Microsoft.Web/sites/config -ResourceName "$appName/web" -ApiVersion 2018-02-01 -Force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New-AzResource
is a cmdlet from Az.Resources module and currently this module is not a dependency of Websites. Is it possible to replace this cmdlet with any command/API that exists in the Websites? It caused the CI failure.
New-AzResource -PropertyObject $PropertiesObject -ResourceGroupName $rgname -ResourceType Microsoft.Web/sites/config -ResourceName "$appName/web" -ApiVersion 2018-02-01 -Force | ||
|
||
$warPath = Join-Path $ResourcesPath "HelloJava.war" | ||
$publishedApp = Publish-AzWebApp -ResourceGroupName:$rgname -Name:$appName -ArchivePath:$warPath -UseZipDeploy -Force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace the colon (:) with space ( ) as it is not a common practice to use this character to separate parameter name and value although it is valid.
Description
Adding logic to use ZipDeploy instead of OneDeploy when deploying functions apps. This change also adds a switch to deploy using ZipDeploy.
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.