Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dannysongg
Copy link
Member

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

  • SHOULD update ChangeLog.md file(s) appropriately
    • For SDK-based development mode, update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • For autorest-based development mode, include the changelog in the PR description.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copy link

azure-client-tools-bot-prd bot commented Apr 25, 2024

️✔️Az.Accounts
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Network
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
❌Az.Websites
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help Example Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️File Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️UX Metadata Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
❌Test
❌PowerShell Core - Linux
❌PowerShell Core - MacOS
❌PowerShell Core - Windows
❌Windows PowerShell - Windows

@YanaXu
Copy link
Contributor

YanaXu commented Apr 26, 2024

Hi @dannysongg, please check my comments and suppress the "Invalid_Cmdlet" errors in CI.

Co-authored-by: Yan Xu <yanxu1@microsoft.com>
Copy link

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

@YanaXu
Copy link
Contributor

YanaXu commented May 8, 2024

/azp run

Copy link
Contributor

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"
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

Suggested change
$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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Remove-AzureRmResourceGroup -Name $rgname -Force
Remove-AzResourceGroup -Name $rgname -Force

try
{
#Setup
New-AzureRmResourceGroup -Name $rgname -Location $location
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants