azure / webapps-deploy Goto Github PK
View Code? Open in Web Editor NEWEnable GitHub developers to deploy to Azure WebApps using GitHub Actions
License: MIT License
Enable GitHub developers to deploy to Azure WebApps using GitHub Actions
License: MIT License
Hi,
We are having a WebGL project which we are trying to host in an Azure App service plan. When we host the site in the App Service plan in Central US region and try to access the same from either Azure VM (P1v2: 1) in Central US or a machine in Asia region the time for a file to load is very high.
Please find the network trace screenshot of one such request -
The above took around 1.1 min.
When we host the application in Southeast Asia region the time is reduced to ~20 seconds.
And when we are hosting the same application in Github pages the load time is less then 5 seconds -
Kindly help us in why is the time taken for a unityweb file so high.
PS: the internet speed is not a factor as the same is being tested via Azure VMs.
My deployments started failing today with the following error.
Error: Deployment Failed with Error: Error: Failed to get app runtime OS
I'm running my WebApp in Linux containers and until today everything worked fine. I tried to update my publish profile but that didn't help. Actions workflow was autogenerated by Azure console when setting up deployments. But as I said, that exact config was working a couple of days ago.
There are not many logs in the output so it's hard to figure out what's going on. Any hint, please?
This is the debug output
##[debug]Could not parse response body.
##[debug]{}
##[debug]Encountered a retriable status code: 503. Message: 'Service Temporarily Unavailable'.
##[debug][GET] https://***.scm.azurewebsites.net:443/diagnostics/runtime
##[debug]Could not parse response body.
##[debug]{}
##[debug]Encountered a retriable status code: 503. Message: 'Service Temporarily Unavailable'.
##[debug][GET] https://***.scm.azurewebsites.net:443/diagnostics/runtime
##[debug]Could not parse response body.
##[debug]{}
##[debug]Encountered a retriable status code: 503. Message: 'Service Temporarily Unavailable'.
##[debug][GET] https://***.scm.azurewebsites.net:443/diagnostics/runtime
##[debug]Could not parse response body.
##[debug]{}
##[debug]Encountered a retriable status code: 503. Message: 'Service Temporarily Unavailable'.
##[debug][GET] https://***.scm.azurewebsites.net:443/diagnostics/runtime
##[debug]Could not parse response body.
##[debug]{}
##[debug]loaded affinity cookie ["ARRAffinity=f2e7c40719d65274f71e47ab410e8962551aca6eb1a4ecd4d8fee5af422a7912;Path=/;HttpOnly;Secure;Domain=***.scm.azurewebsites.net","ARRAffinitySameSite=f2e7c40719d65274f71e47ab410e8962551aca6eb1a4ecd4d8fee5af422a7912;Path=/;HttpOnly;SameSite=None;Secure;Domain=***.scm.azurewebsites.net"]
##[debug]getAppRuntime. Data: {"statusCode":503,"statusMessage":"Service Temporarily Unavailable","headers":{"content-length":"19","server":"nginx","set-cookie":["ARRAffinity=f2e7c40719d65274f71e47ab410e8962551aca6eb1a4ecd4d8fee5af422a7912;Path=/;HttpOnly;Secure;Domain=***.scm.azurewebsites.net","ARRAffinitySameSite=f2e7c40719d65274f71e47ab410e8962551aca6eb1a4ecd4d8fee5af422a7912;Path=/;HttpOnly;SameSite=None;Secure;Domain=***.scm.azurewebsites.net"],"date":"Sat, 12 Dec 2020 23:41:17 GMT","connection":"close"},"body":"Service Unavailable"}
##[debug]Failed to fetch Kudu App Runtime diagnostics.
##[debug]Service Temporarily Unavailable (CODE: 503)
Error: Deployment Failed with Error: Error: Failed to get app runtime OS
And I indeed had problems with accessing Kudu services - I was receiving status 503 when I tried to access Advanced Tools, Log Stream, SSH, or Deployment Center (logs).
I'm using a workflow file adapted from "build and deploy a Node.js Web app to Azure using publish profile".
(side remark) : I had issues with symbolic links too (see #54 (comment))
Upon analysis, it seems that the whole copy of the node_modules
folders to the webroot of the webapp takes ages (10-12 minutes for the Azure Webapp deploy step !) It's very inefficient to process and send many little files over network.
=> Shouldn't the final npm install
(and npm run build
β I'm using typescript) commands be executed on the target machine instead of a github action container ?
IMHO, the workflow should be like this for the "nodeJS with publish profile" scenario :
npm install
, npm run build
and npm start
should be done on the targeted runtime machineazure/webapps-deploy
Related questions :
.deployment
file, deployment hooks, etc.It's allowed to schedule an Azure WebApp using ARM Template or powershell specifying all existing Storage Account Sku's
But backups fails where the storage Account has Sku "Premium LRS".
When i get the request that filtering storage accounts from WebApp backup selection in portal, i can see that the filter "Premium LRS" is applied.
where type in~ ('microsoft.storage/storageaccounts','microsoft.classicstorage/storageaccounts')| extend isClassic = (type =~ 'microsoft.classicstorage/storageaccounts')| extend isHnsEnabled = coalesce(properties.isHnsEnabled, false)| extend allowSharedKeyAccess = coalesce(properties.allowSharedKeyAccess, true)| extend skuName = replace('-', '_', tostring(iff(isClassic, properties.accountType, sku.name)))| project id, name, location, skuName, kind, isHnsEnabled, allowSharedKeyAccess| summarize name = any(name), location = any(location), skuName = any(skuName), ['kind'] = any(kind), isHnsEnabled = any(isHnsEnabled), allowSharedKeyAccess = any(allowSharedKeyAccess) by id| order by name asc | where skuName !in~ ('Premium_LRS')"
Otherwise there is no information about this requirement in documentation :
https://docs.microsoft.com/en-us/azure/app-service/manage-backup#requirements-and-restrictions
If this requirement is "Normal", it should be impossible to schedule backups using Storage Accounts with "Premium LRS" Sku through ARM template or Edit-AzWebAppBackupConfiguration cmdlet and the documentation should be indicate this requirement
My repo has many projects inside and when I'm using GitHub actions it is deploying the entire repo to Azure. After looking into this I don't see a way we can set the default deployment folder but it is unusable to me unless I can achieve this
Thanks,
Joshua
I'm deploying a nodeJS app with Github actions and it seems that once the code gets to the azure web app server the symlinks from within node_modules/.bin folder are all messed up and app doesn't start.
For example when I run my code locally, if I do a node ./node_modules/.bin/next --help
it works, and ./node_modules/.bin/next
is actually a symlink to ../next/dist/bin/next
But after code is deployed on Azure with the webapps-deploy action it seems that ./node_modules/.bin/next
is no longer a symlink to ../next/dist/bin/next
but it actually becomes a text file with ../next/dist/bin/next
as its contents and so if I connect to ssh to the Azure server and run node ./node_modules/.bin/next --help
(same command I run locally, or that also works ok inside the GitHub action, there I get an error:
/home/site/wwwroot>node ./node_modules/.bin/next --help
/home/site/wwwroot/node_modules/.bin/next:1
../next/dist/bin/next
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1047:16)
at Module._compile (internal/modules/cjs/loader.js:1097:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
I have noticed the deployment only creates new files and overwrites existing ones, but does not delete files not part of the deployment. This is causing our workspace to be cluttered and may lead to harder to pinpoint issues in the future.
Is there the option to delete the old files as new ones are deployed?
This is a feature available through other existing deployment options
Hi,
so far I've had great success using this action together with https://github.com/Azure/login.
I like the idea of publish profiles for specific workflows, since they seem slightly less cumbersome and akin to SAS tokens.
I was slightly surprised, when I wanted to use the lazy approach and set up multiple CI pipelines for different WebApps:
az webapp deployment list-publishing-profiles \
--query "[? publishMethod=='MSDeploy'] | [0]" \
--resource-group "foo" \
--name "bar"
produces
{
"SQLServerDBConnectionString": "",
"controlPanelLink": "http://windows.azure.com",
"databases": null,
"destinationAppUrl": "http://<name>.azurewebsites.net",
"hostingProviderForumLink": "",
"msdeploySite": "<name>",
"mySQLDBConnectionString": "",
"profileName": "<name> - Web Deploy",
"publishMethod": "MSDeploy",
"publishUrl": "<name>.scm.azurewebsites.net:443",
"userName": "$<name>",
"userPWD": "<secret>",
"webSystem": "WebSites"
}
https://github.com/Azure/webapps-deploy/blob/master/lib/Utilities/PublishProfile.js#L22
new actions_secret_parser_1.SecretParser(publishProfileContent, actions_secret_parser_1.FormatType.XML);
π€
"Well it does make sense when looking at the Publish Profile description (where you describe the Portal approach).
No biggie. They certainly have different output formats.
az webapp deployment list-publishing-profiles --help
--output -o : Output format. Allowed values:
json
,jsonc
,none
,table
,tsv
,yaml
,yamlc
π€¦
It's not a big thing to convert the JSON/YAML you retrieve via azure-cli
to the XML as you would retrieve it via the portal. General support for either format (or both) supported by azure-cli
would be greatly appreciated.
Or is it better to bring this up with the azure-cli
team?
In any case, either solution would be welcome, because service principals can only perform non-UI approaches, so the only way to retrieve the XML is not always possible π.
Is it possible to use run from package deployment? This seems the default for functions-action which takes care of these steps:
home/data/SitePackages
packagename.txt
WEBSITE_RUN_FROM_PACKAGE
to 1 in app settingsAlso the AzureWebApp@1 task for Azure pipelines does same as above. However, webapps-deploy action just extracts the package into wwwroot
.
I get an error deploying Azure Functions if I am using RBAC. This does not occur if you are using an issue profile.
Run azure/webapps-deploy@v2 Error: Deployment Failed with Error: Error: Action does not support app service with kind functionapp.
I know there is an Azure/functions-action
, but it would be redundant to not be able to use the same Action when deploying in parallel using strategy.
Hello!
Not sure if this is a place to report this, as there seems to be no activity in the issues tab here.
But I'll try, and if no reply, try somewhere else.
We have been getting this error lately:
It is causing our builds to fire an error, but it's working anyways.
Error: Cannot find module 'azure-actions-webclient/webClient'
Require stack:
- /home/runner/work/_actions/azure/webapps-container-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/KuduServiceClient.js
- /home/runner/work/_actions/azure/webapps-container-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js
- /home/runner/work/_actions/azure/webapps-container-deploy/v1/node_modules/azure-actions-appservice-rest/Utilities/AzureAppServiceUtility.js
- /home/runner/work/_actions/azure/webapps-container-deploy/v1/lib/main.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/runner/work/_actions/azure/webapps-container-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/KuduServiceClient.js:13:21)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19) ***
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/runner/work/_actions/azure/webapps-container-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/KuduServiceClient.js',
'/home/runner/work/_actions/azure/webapps-container-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js',
'/home/runner/work/_actions/azure/webapps-container-deploy/v1/node_modules/azure-actions-appservice-rest/Utilities/AzureAppServiceUtility.js',
'/home/runner/work/_actions/azure/webapps-container-deploy/v1/lib/main.js'
]
*******
I have the same problem with GitHub Actions as with the issue.
It may succeed if executed repeatedly.
I am using a B1 instance of App Service on Linux, and I am attaching the yaml of GitHub Actions and the error log.
I am deploying a zip file to a .NET 5 website, using this configuration:
- uses: azure/webapps-deploy@v2
with:
app-name: sharplab-edge
package: WebApp.Server.zip
I only added this deployment just now, and I am running into an error:
Error: Failed to change file that is currently being used "D:\home\site\wwwroot\SharpLab.Runtime.dll"
Run azure/webapps-deploy@v2
with:
app-name: sharplab-edge
package: WebApp.Server.zip
slot-name: production
env:
AZURE_HTTP_USER_AGENT:
AZUREPS_HOST_ENVIRONMENT:
Package deployment using ZIP Deploy initiated.
Updating submodules.
Preparing deployment for commit id '7561bb78b5'.
Generating deployment script.
Using cached version of deployment script (command: 'azure -y --no-dot-deployment -r "D:\local\Temp\zipdeploy\extracted" -o "D:\home\site\deployments\tools" --basic --sitePath "D:\local\Temp\zipdeploy\extracted"').
Running deployment command...
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling Basic Web Site deployment.
Creating app_offline.htm
Error: Failed to change file that is currently being used "D:\home\site\wwwroot\SharpLab.Runtime.dll"
KuduSync.NET from: 'D:\local\Temp\zipdeploy\extracted' to: 'D:\home\site\wwwroot'
Copying file: 'appsettings.Development.json'
Copying file: 'appsettings.json'
Copying file: 'SharpLab.Native.Profiler.dll'
Copying file: 'SharpLab.Native.Profiler.pdb'
Copying file: 'SharpLab.Runtime.dll'
Failed exitCode=1, command="kudusync" -v 50 -f "D:\local\Temp\zipdeploy\extracted" -t "D:\home\site\wwwroot" -n "D:\home\site\deployments\7561bb78b59f41d5a5d59fdf27c09a6e\manifest" -p "D:\home\site\deployments\4be36940f6a4876eed6d36ed24c97117df5433d31609801997951\manifest" -i ".git;.hg;.deployment;deploy.cmd"
An error has occurred during web site deployment.
Error: Failed to change file that is currently being used "D:\home\site\wwwroot\SharpLab.Runtime.dll"\r\nD:\Program Files (x86)\SiteExtensions\Kudu\91.21119.4922\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
Error: Failed to deploy web package to App Service.
Error: Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Successfully updated deployment History at https://sharplab-edge.scm.azurewebsites.net/api/deployments/29a251b6083275b643acd856dc6d449e86c587821609802731619
App Service Application URL: http://sharplab-edge.azurewebsites.net
I thought this might be due to the site not correctly handling app_offline.htm
(maybe due to a WebSocket connection). But on the other hand when using SCM I can somehow do anything with the files -- they don't seem locked at all even without app_offline.
Not sure what's the actual problem and the right solution here -- maybe action should have an option to stop/start web app explicitly, or a wait/retry setting? Either way some graceful way of handling this and letting the user know what exactly is wrong would be great.
How can this be used to deploy a WebJob project to an AppService?
I've enabled GitHub Actions for my Azure App Service Dev
Slot, but it fails on the deployment step using the webapps-deploy action.
##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
name: Build and deploy XXXXXX - XXXXXX-web(dev)
env:
AZURE_WEBAPP_NAME: XXXXXX-web
AZURE_WEBAPP_PATH: '.'
AZURE_WEBAPP_SLOT: 'dev'
DOTNET_VERSION: '3.1.102'
GITHUB_BRANCH: 'dev'
on:
push:
branches:
- dev
jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build XXXXXX project
run: dotnet build .\XXXXXX\XXXXXX.csproj --configuration Release
- name: Publish XXXXXX project
run: dotnet publish .\XXXXXX\XXXXXX.csproj -c Release -o ${{ env.DOTNET_ROOT }}/myapp
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'XXXXXX-web'
slot-name: 'Dev'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_YYYYYYYYYYYYYYYYYYYYYY }}
package: ${{env.DOTNET_ROOT}}/myapp
package: C:\hostedtoolcache\windows\dncs\3.1.102\x64/myapp
env:
AZURE_WEBAPP_NAME: XXXXXX-web
AZURE_WEBAPP_PATH: .
AZURE_WEBAPP_SLOT: dev
DOTNET_VERSION: 3.1.102
GITHUB_BRANCH: dev
DOTNET_ROOT: C:\hostedtoolcache\windows\dncs\3.1.102\x64
Package deployment using ZIP Deploy initiated.
Updating submodules.
Preparing deployment for commit id '2a48ddc76b'.
Generating deployment script.
Using cached version of deployment script (command: 'azure -y --no-dot-deployment -r "D:\local\Temp\zipdeploy\extracted" -o "D:\home\site\deployments\tools" --basic --sitePath "D:\local\Temp\zipdeploy\extracted\XXXXXX.com"').
Running deployment command...
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling Basic Web Site deployment.
Creating app_offline.htm
Error: Could not find a part of the path 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com'.
KuduSync.NET from: 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com' to: 'D:\home\site\wwwroot'
Failed exitCode=1, command="kudusync" -v 50 -f "D:\local\Temp\zipdeploy\extracted\XXXXXX.com" -t "D:\home\site\wwwroot" -n "D:\home\site\deployments\2a48ddc76bbd4b4c87cb0834cd179a08\manifest" -p "D:\Program Files (x86)\SiteExtensions\Kudu\87.20522.4610\bin\Scripts\firstDeploymentManifest" -i ".git;.hg;.deployment;deploy.cmd"
An error has occurred during web site deployment.
Error: Could not find a part of the path 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com'.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\87.20522.4610\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Successfully updated deployment History at https://XXXXXX-web-dev.scm.azurewebsites.net/api/deployments/517bd24fdfb7cee6da766301e1a72a83b52d221e1593760589047
App Service Application URL: http://XXXXXX-web-dev.azurewebsites.net
The slot-name setting will be ignored when deploying using SCM credentials.
Since the SCM credential only have access to either production/slot site, we cannot derived web app slot from the product site SCM credentials.
When SCM credential is used, I would recommend concatenating appname-slotname as sitename, and perform a validation against SCM credentals' destinationAppUrl.
This issue is also related to Azure/functions-action#25
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
Generates:
Run azure/login@v1
/usr/bin/az --version
WARNING: You have 3 updates available. Consider updating your CLI installation.
azure-cli 2.0.74 *
command-modules-nspkg 2.0.3
core 2.0.74 *
nspkg 3.0.4
telemetry 1.0.3 *
Python location '/opt/az/bin/python3'
Extensions directory '/home/runner/.azure/cliextensions'
Python (Linux) 3.6.5 (default, Sep 20 2019, 05:42:39)
[GCC 7.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Login failed. Please check the credentials.
##[error]Error: The process '/usr/bin/az' failed because one or more lines were written to the STDERR stream
##[error]Node run failed with exit code 1
It's allowed to set a backup scheduling using ARM template or powershell.
Otherwise, backups fail
it seems that backups are only functionnal using StorageV2. but it's not specified in requirements :
https://docs.microsoft.com/en-us/azure/app-service/manage-backup#requirements-and-restrictions
My deployment of a typescript/node based web app does not update files in node_modules.
If I delete the offending file, it will be updated with the new version on the next deployment.
As of the update this afternoon to restrict usage of set-env, this task now fails. https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Full error:
Run Azure/webapps-deploy@v1
with:
app-name: featureflags-data-eu-service
package: serviceapp
slot-name: staging
env:
AZURE_HTTP_USER_AGENT:
AZUREPS_HOST_ENVIRONMENT:
Error: Unable to process command '::set-env name=AZURE_HTTP_USER_AGENT,::GITHUBACTIONS_DeployWebAppToAzure_6a3d8fbc4fa9b0a8568f4b02dcb98ca6aa6248e064d52b6d666423fb24ff6a2c' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Package deployment using ZIP Deploy initiated.
Deploy logs can be viewed at https://featureflags-data-eu-service-staging.scm.azurewebsites.net/api/deployments/00271bf5bba7486a9203f66263ce5bbd/log
Successfully deployed web package to App Service.
Successfully updated deployment History at https://featureflags-data-eu-service-staging.scm.azurewebsites.net/api/deployments/ff45d2b9a986fc4f1e7209c19943be7f0dce44f81605577784550
App Service Application URL: http://featureflags-data-eu-service-staging.azurewebsites.net
Error: Unable to process command '::set-env name=AZURE_HTTP_USER_AGENT,::' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
I would like to automate the deployment of code to Azure Web App for Containers using GitHub Actions.
The approach that I am taking includes the following steps:
However, I have noticed that the job to validate the deployment to the staging slot (step#3) runs before the staging slot is actually updated with the new code, which is not what is intended.
One potential approach might be to wait a certain amount of time before moving on to step#3, but this would only increase the likelihood that the deployment to staging is done, rather than guaranteeing it. And adding a long wait would unnecessarily increase the lead time until the deployment is done.
Another approach could be to check the version number deployed on the staging slot before moving on to step#3. However, I'm wondering if there is a simpler way (e.g., adding a line or two to the GitHub Action workflow yaml code to check for this).
Could someone provide advice please?
Is it possible to run post-script actions? such as an yarn install and start?
If not possible part of the action, would it be possible to link in an example of how to solve this issue?
Apologies if this isn't the correct place to report this issue - feel free to direct me elsewhere!
When I set up deployment using GitHub Actions from the Azure Portal, Azure automatically creates a workflow using the webapps-deploy action in my repository, with the following setting:
with:
app-name: 'my-app(slotname)'
slot-name: 'slotname'
However, this format for the app-name
property fails validation when the webapps-deploy action runs, on these lines:
webapps-deploy/src/ActionInputValidator/Validations.ts
Lines 29 to 43 in 8d236f5
The field needs to be formatted this way in order to pass validation:
with:
app-name: 'my-app'
slot-name: 'slotname'
Once I changed this setting in my workflow config file, deployment worked fine.
This issue is to request two changes:
app-name
property (possibly not the right place to request this - sorry about that)app-name
and slot-name
fields (the slot-name
field doesn't currently appear in any of the documentation for this repo)Azure Pipelines App Service Deploy tasks have the "VirtualApplication" input to allow deployment to a virtual application within the main App Service. There is no equivalent in this Action. Is this by design?
I'm sorry if this is not the right place to report this issue, feel free to direct me elsewhere.
I'm currently working on a test application to evaluate the capabilities of GH Actions and the Azure AppService. I've been using the default node.js example and built upon that. Deploying the the production slot of my App Service worked without any issues. However, my issue is the deployment to other deployment slots such as staging.
Currently, there is no mention of the "slot-name" property in the documentation other than #25. Since official documentation is lacking I referred to the issue when formatting my configuration which now looks like this
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Deployment Pipeline
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: 'Checkut Code'
uses: actions/checkout@v2
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
#- run: npm test
- name: 'Deploy to Azure App Service'
uses: azure/webapps-deploy@v2
with:
app-name: 'my-app'
publish-profile: ${{ secrets.AZURE_PUBLISHING_PROFILE }}
slot-name: 'staging'
I generated the publishing profile using the "Generate publish profile" on the panel, but using the azure cli with the --xml flag produces the same output. I also manually created the deployment slot using the panel.
Executing the workflow with the configuration shown above results in the following error:
##[error]Deployment Failed with Error: Error: Publish profile is invalid for app-name and slot-name provided. Provide correct publish profile credentials for app.
wich appears to be caused by failing the validation here
webapps-deploy/src/ActionInputValidator/Validations.ts
Lines 25 to 38 in e985d6f
I followed this document for general setup of my workflow.
Were there any breaking changes that resulted in the documentation being outdated?
For some reason the applicationURL
value in this action is getting a non-SSL based URI which then gets passed along to other areas like the output of webapp-url
which can be used in later actions.
This should be changed to have the SSL-based URI by default.
It appears to be coming from:
https://github.com/microsoft/pipelines-appservice-lib/blob/714433932820111567046bd53f47e9131d95930a/src/RestUtilities/AzureAppServiceUtility.ts#L39
Which is in the publish profile. Indeed the pubprofile destinationAppUrl is a non-secure URL for some reason when downloading the publish profiles...this should be changed. Other places in the publish profile are 443/SSL based except this one.
Deploying fairly small (3x components) angular app to Azure App Service. Web App built and deployment attempted but resulted in There is not enough space on the disk.\r\n
.
Package deployment using ZIP Deploy initiated.
Fetching changes.
Cleaning up temp folders from previous zip deployments and extracting pushed zip file C:\local\Temp\zipdeploy\ad1141rx.zip (152.54 MB) to C:\local\Temp\zipdeploy\extracted
There is not enough space on the disk.\r\n
Error: Failed to deploy web package to App Service.
Error: Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Using v2 or v1, I'm unable to deploy a Spring Boot app (JHipster)
Error: Deployment Failed with Error: Error: Invalid entry header
Error: Error: Invalid entry header
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: _my-app-name_
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: '${{ github.workspace }}/target/*jar'
I tried to deploy an app with Tomcat 8.5 on Windows. but after the deployment, I have to access the app via <app_url>/<app_name>
I used to use Azure DevOps to deploy app to Azure WebApp. In Azure DevOps, I can set customDeployFolder
to 'ROOT'
, so that the app can be accessed without referring to the app name.
Question: How can I deploy the app to the root via this action?
I'm using webapps-deploy to deploy a linux webapp through actions, which I had done before with no issues a few months ago, but I believe now the publish profile is pointing to a publish URL which this action does not recognize.
You can see here the failure I'm referring to here:
https://github.com/brasky/OpenSync/actions/runs/129035722
I noticed in an old PublishSettings for a previous site I deployed the Web Deploy publishUrl was elliotdematteis.scm.azurewebsites.net:443 but the new site's publishUrl was waws-prod-sn1-165.publish.azurewebsites.windows.net:443
After changing the publish URL to [sitename].scm.azurewebsites.net I no longer received the error and it deployed fine.
https://github.com/brasky/OpenSync/actions/runs/129050312
I'm relatively new with github actions and webapps-deploy, but is this an issue with azure giving me an incorrect publish URL or is this an issue where the URL validation of webapps-deploy doesn't include a new publish URL schema?
Edit:
It looks like checking for "scm" is hardcoded into Utilities/PublishProfile.ts
I'm unfamiliar with whether the *.publish.azurewebsite.windows.net is an acceptable alternative but can test it out.
I'm not sure this is an issue with this action or something on Azure but i try here first.
My deployments has worked fine for a while but when i tried to deploy today i started to get these errors in the eventlog on Azure.
ZIP_SUPPORT::OpenZipFile(861): Failed to read central end of central directory record due to signature mismatch. (Path:"\\?\d:\local\SitePackages\812114890.zip" Err:0x8007026a)
Failed to open zip file \\?\d:\local\SitePackages\812114890.zip. Error: 0x8007026a
What i've tried.
Well, that's mainly it. Not sure what you need more.
We're using this GitHub action to deploy an app to Azure App Services.
The workflows seems to works (and the deployment occurs) but the startup-command
is ignored, and GitHub raises an error:
This message contradicts the yaml action definition file.
Here is our yaml action file:
name: REDACTED
on:
push:
branches:
- production
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: "10.x"
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
- name: "Deploy to Azure Web App"
uses: azure/webapps-deploy@v1
with:
app-name: "REDACTED"
startup-command: "npm run api-prd"
slot-name: "production"
publish-profile: REDACTED
package: .
Am I missing something or is it a known issue?
Failed to fetch credentials from Publish Profile. For more details on how to set publish profile credentials refer https://aka.ms/create-secrets-for-GitHub-workflows
Deployment Failed with Error: Error: Publish profile does not contain kudu URL
On deployment I got this error. I have added the entire content of publish setting file. Any possible reason for this?
Reproduction steps:
Create a Linux App Service:
https://github.com/Azure/azure-quickstart-templates/tree/master/101-app-service-docs-linux
Attempt to deploy via azure/webapps-deploy@v2:
Error: Deployment Failed with Error: Error: Action does not support app service with kind linux.
The Linux App Service above is defined with a kind value of 'linux', per:
https://github.com/Azure/azure-quickstart-templates/blob/master/101-app-service-docs-linux/azuredeploy.json#L54
Currently, only a kind value of 'app,linux' is supported in actionparameters.ts
I have a workflow that I use to deploy to 2 different app services for containers.
To the best of my ability, they are identical other than the environment variables passed to the container and the subscriptions they are in. I can configure both in azure portal and start the docker container manually in both, no problem.
Both are deployed to azure "app service environments" for my client. They are under 2 different subscriptions, thus I use 2 different credentials to log in depending on which one I'm deploying.
The workflow contains steps like this
- name: Login to Azure Non Prod
uses: Azure/login@v1
if: github.event.inputs.environment != 'prod'
with:
creds: ${{secrets.AZURE_CREDENTIALS}}
- name: Login to Azure Prod
uses: Azure/login@v1
if: github.event.inputs.environment == 'prod'
with:
creds: ${{secrets.AZURE_CREDENTIALS_PROD}}
- name: Deploy
uses: Azure/webapps-deploy@v2
with:
app-name: web-app-foo-${{ github.event.inputs.environment }}
images: ghcr.io/client-name/image-name:tag
The problem, is that just one of them always errors with
Error: Deployment Failed with Error: Error: Action does not support app service with kind linux,container.
What else can I look at in terms of properties of the app services or arguments passed to the action that would cause this to only fail for one?
After triggering azure/webapps-deploy@v2, my instance of Web App for Containers does not actively pull the newest docker image hosted in GitHub Packages (docker.pkg.github.com).
Workaround: Make a GET-request to the web app's URL - this seems to trigger the pending image retrieval.
How does one go about mapping volumes? I want to map to a an Azure File Storage. Basically, what I'm looking is being able to do something like this (if it was a docker-compose.yml file):
services:
...
...
volumes:
- data:/var/www/html
Where data
is the name of my Azure Storage mount name. Thank you!
My workflow did this successfully yesterday night:
- name: Deploy ApiReview.Client
uses: azure/[email protected]
with:
app-name: apireviews
package: './artifacts/ApiReview.Client'
which fails with this:
An action could not be found at the URI 'https://api.github.com/repos/azure/webapps-deploy/tarball/v2.1'
hacking the URL reveals that this works:
https://codeload.github.com/Azure/webapps-deploy/legacy.tar.gz/v2.1.0
Is that intentional?
I keep getting permission denied during the ZIP Deploy part. Im not sure whats the problem at all :(
Copying file: '.next/cache/next-babel-loader/08ef92379bf38b48cd13a4fa5b92882a.json'
Copying file: '.next/cache/next-babel-loader/0a0a15bfd8c3ce8c3eec97dfc374607a.json'
Copying file: '.next/cache/next-babel-loader/0a5664b08205e9ebb21c1c33a74fa0e5.json'
Omitting next output lines...
Error: EACCES: permission denied, open '/home/site/wwwroot/.next/cache/next-minifier/content-v2/sha512/15/8c/0cef4e17432d7689463394a3386979936ea14d1355d91a851ab7906427caff8e555eb236955d89672969260a88648b64c7bfb714d56888e07d31ed1788f3'
An error has occurred during web site deployment.
Kudu Sync failed
\n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
There is missing PHP runtime for WebApp deployment
I'm trying to deploy a multi-container app from a Github Action. Whenever I pass the "configuration-file" setting to the action, I get the error message: "Deployment Failed with Error: Error: Multi container support is not available for windows containerized web app.".
Here is the YAML I'm using:
- uses: azure/webapps-deploy@v2
with:
app-name: '${{ secrets.APP_NAME }}' # this the same name as the AppService app name.
configuration-file: 'deploy/docker-compose.yml' # this is the relative path to my docker-compose file.
publish-profile: '${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}' # the publish profile string
images: '${{ secrets.REGISTRY_NAME }}/${{ secrets.APP_CONTAINER_NAME }}' # the image the action built in the previous step.
This is a Linux app. I can use the same docker-compose file via the azure-cli or the Portal website to configure the app as a multi-container app successfully. This issue appears to be isolated to the Github Action.
I can deploy a single-container app via this action successfully. I'm only getting errors when trying to deploy a multi-container configuration.
My use-case is: I am building and storing Docker images in ACR. I need to deploy that in my AppService. I am using GithubActions for the CD. Below is part of my workflow:
- name: Login to Azure Dev Environment
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Set Web App ACR authentication
uses: azure/appservice-settings@v1
with:
app-name: 'myapp'
app-settings-json: |
[
{
"name": "DOCKER_REGISTRY_SERVER_PASSWORD",
"value": "${{ secrets.DOCKER_REGISTRY_PASSWORD }}",
"slotSetting": false
},
{
"name": "DOCKER_REGISTRY_SERVER_URL",
"value": "https://myacr.azurecr.io",
"slotSetting": false
},
{
"name": "DOCKER_REGISTRY_SERVER_USERNAME",
"value": "${{ secrets.DOCKER_REGISTRY_USERNAME }}",
"slotSetting": false
}
]
- name: Deploy to Azure Dev App Service
uses: azure/webapps-deploy@v2
with:
app-name: 'myapp'
images: 'myacr.azurecr.io/mysvc:sha-${{ env.GITHUB_SHA_SHORT }}'
Getting the following error in the deploy step:
Run azure/webapps-deploy@v2
Updating App Service Configuration settings. Data: ***"linuxFxVersion":"DOCKER|mysvc:sha-2b106095"***
Updated App Service Configuration settings.
Restarting app service: myapp
Restarted app service: myapp
Warning: Error: Failed to update deployment history.
Ip Forbidden (CODE: 403)
App Service Application URL: http://myapp.azurewebsites.net
Below are the logs I am seeing in my AppService:
2021-01-12T07:10:52.811Z ERROR - Pulling docker image mysvc:sha-2b106095 failed:
2021-01-12T07:10:52.811Z INFO - Pulling image from Docker hub: library/mysvc:sha-2b106095
2021-01-12T07:10:53.069Z ERROR - DockerApiException: Docker API responded with status code=NotFound, response={"message":"pull access denied for mysvc, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"}
2021-01-12T07:10:53.077Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
I think the problem is it is not recognizing the registry as ACR and trying to pull from Docker Hub.
Am I missing any configuration here?
Webapp deploy action is succeeding for me but the webapp is not properly deployed.
My workflow can be seen here and the workflow run can be seen here
All is well till here. But when I go to my webapp, I get error. In the Diagnostic logs of the webapp, it says it couldn't authenticate while running the docker image pull. This is weird. It was able to do a docker push with the same credentials. Docker pull should also succeed.
I have already added my workflow run details above, if there are any other questions, please reach out to me directly.
I have an app service frosted-web
with a deployment slot staging
.
I use the following azure/webapps-deploy@v2
action to try to push a new image to the staging
slot on the frosted-web
app service.
- name: Update image tag on the staging Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'frosted-web'
slot-name: 'staging'
images: '${{ secrets.REGISTRY_LOGIN_SERVER }}/frosted-web:${{ github.sha }}'
However I get the following error:
I can't seem to find any docs on how to use slot-name
, but I would've expected this to just work. Deploying to the production slot works just fine. Am I missing something here?
Hi! I have been using this github action for months without issues. Unfortunately tonight I started seeing the following in my builds:
Deploy to Azure WebApp1s
NODE_VERSION: 12.x
Run azure/webapps-deploy@v2
with:
app-name: XXX
publish-profile: ***
package: .
slot-name: production
env:
AZURE_WEBAPP_NAME: XXX
AZURE_WEBAPP_PACKAGE_PATH: .
NODE_VERSION: 12.x
##[error]Deployment Failed with Error: Error: Internal Server Error. Please try again
Error: [object Object]
The internal server error makes me think it's on Azure's end. But I am able to deploy my function app successfully from Visual Studio Code. Also, the object output at the end would be helpful if I knew how to JSON.stringify
it! π
Can you please advise?
My workflow is now showing me warnings regarding the deprecation of set-env
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/. Need to upgrade to latest core toolkit
The jobs started to crash with Error: Cannot find module 'azure-actions-webclient/webClient'
which is imported in https://github.com/microsoft/pipelines-appservice-lib/blob/master/packages/appservice-rest/src/Kudu/KuduServiceClient.ts#L3
I believe the issue is caused by one of the last few commits made in this repository:
this one looks the most suspicious:
54291e6
Configuration:
- name: Deploy to Azure
uses: azure/webapps-deploy@v1
with:
app-name: my-app-name-on-azure
publish-profile: ${{ secrets.STAGING_AZURE_WEBAPP_PUBLISH_PROFILE }}
Logs:
2019-12-19T11:30:34.4883155Z ##[group]Run azure/webapps-deploy@v1
2019-12-19T11:30:34.4883365Z with:
2019-12-19T11:30:34.4883506Z app-name: staging-coinflip-aaa-hostedsite
2019-12-19T11:30:34.4884718Z publish-profile: ***
2019-12-19T11:30:34.4884923Z package: .
2019-12-19T11:30:34.4885057Z slot-name: production
2019-12-19T11:30:34.4885191Z env:
2019-12-19T11:30:34.4885326Z CI: true
2019-12-19T11:30:34.4885516Z SLACK_WEBHOOK: ***
2019-12-19T11:30:34.4885810Z SLACK_CHANNEL: ci-cd
2019-12-19T11:30:34.4885926Z SLACK_PRE_MESSAGE: *Deployed Feature:*
2019-12-19T11:30:34.4886033Z REPO_SLUG: oakslab/coinflip-AAA-hosted-site
2019-12-19T11:30:34.4886136Z COMMIT_MESSAGE:
2019-12-19T11:30:34.4886234Z COMMIT_ID:
2019-12-19T11:30:34.4886331Z ##[endgroup]
2019-12-19T11:30:34.6426081Z internal/modules/cjs/loader.js:800
2019-12-19T11:30:34.6426497Z throw err;
2019-12-19T11:30:34.6426646Z ^
2019-12-19T11:30:34.6426727Z
2019-12-19T11:30:34.6427637Z Error: Cannot find module 'azure-actions-webclient/webClient'
2019-12-19T11:30:34.6427819Z Require stack:
2019-12-19T11:30:34.6428710Z - /home/runner/work/_actions/azure/webapps-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/KuduServiceClient.js
2019-12-19T11:30:34.6429531Z - /home/runner/work/_actions/azure/webapps-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js
2019-12-19T11:30:34.6430125Z - /home/runner/work/_actions/azure/webapps-deploy/v1/node_modules/azure-actions-appservice-rest/Utilities/AzureAppServiceUtility.js
2019-12-19T11:30:34.6430643Z - /home/runner/work/_actions/azure/webapps-deploy/v1/lib/deploymentProvider/WebAppDeploymentProvider.js
2019-12-19T11:30:34.6431219Z - /home/runner/work/_actions/azure/webapps-deploy/v1/lib/main.js
2019-12-19T11:30:34.6431446Z at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
2019-12-19T11:30:34.6431817Z at Function.Module._load (internal/modules/cjs/loader.js:690:27)
2019-12-19T11:30:34.6432392Z at Module.require (internal/modules/cjs/loader.js:852:19)
2019-12-19T11:30:34.6432625Z at require (internal/modules/cjs/helpers.js:74:18)
2019-12-19T11:30:34.6433288Z at Object.<anonymous> (/home/runner/work/_actions/azure/webapps-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/KuduServiceClient.js:13:21)
2019-12-19T11:30:34.6433615Z at Module._compile (internal/modules/cjs/loader.js:959:30)
2019-12-19T11:30:34.6433853Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
2019-12-19T11:30:34.6434083Z at Module.load (internal/modules/cjs/loader.js:815:32)
2019-12-19T11:30:34.6434305Z at Function.Module._load (internal/modules/cjs/loader.js:727:14)
2019-12-19T11:30:34.6434589Z at Module.require (internal/modules/cjs/loader.js:852:19) {
2019-12-19T11:30:34.6434978Z code: 'MODULE_NOT_FOUND',
2019-12-19T11:30:34.6435149Z requireStack: [
2019-12-19T11:30:34.6435855Z '/home/runner/work/_actions/azure/webapps-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/KuduServiceClient.js',
2019-12-19T11:30:34.6436343Z '/home/runner/work/_actions/azure/webapps-deploy/v1/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js',
2019-12-19T11:30:34.6436861Z '/home/runner/work/_actions/azure/webapps-deploy/v1/node_modules/azure-actions-appservice-rest/Utilities/AzureAppServiceUtility.js',
2019-12-19T11:30:34.6437596Z '/home/runner/work/_actions/azure/webapps-deploy/v1/lib/deploymentProvider/WebAppDeploymentProvider.js',
2019-12-19T11:30:34.6437969Z '/home/runner/work/_actions/azure/webapps-deploy/v1/lib/main.js'
2019-12-19T11:30:34.6438115Z ]
2019-12-19T11:30:34.6438250Z }
2019-12-19T11:30:34.6478547Z ##[error]Node run failed with exit code 1
@SumiranAgg can you please take a look at it? it's kind of urgent.
I created a new App Service using the Azure App Service Migration assistant. The migration assistant creates app services with the "kind" attribute set to "app,migration" as opposed to "app."
This causes the action to fail with the error in the title:
##errorDeployment Failed with Error: Error: Action does not support app service with kind app,migration.
This may be related to issue #83
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.