Heroku Edge Addon Amazon Cloudfront - amazon-cloudfront

My app's slugsize exceeded the Heroku max limit so I added the Heroku Edge Addon to my application in an effort to move the largest size folder, which is public/img, to a CDN (Amazon Cloudfront). I do not have an AWS account.
I added the CDN EDGE_URL provided by the addon to the<img src=> tags on my website. Works fine so far.
My question is where do I manage the Cloudfront portion of things since there is no dashboard on Heroku. Do I need to sign up for an AWS account? What files/folders do I include in the .slugignore file? Do I need to manually move the public/img folder to Cloudfront? I use Github for version control and I typically push to Heroku for deployment. Do I need to rm the public/img folder from Github and add it to my .gitignore file moving forward?

Related

Azure App Service Restart required after uploading new contents to FTP

I have some app services and I update the web sites content by uploading the data via FTPS.
Occasionally, after I upload new content, the sites don't display it at all or partially until the app service is restarted.
Is this normal behavior?
What can be done to avoid restarting or monitoring the site and automatically restarting the app service if the site does not appear properly after updating the content?
Thanks
Just to highlight, based on your application framework - Unlike Git-based deployments and Zip deployment, FTP deployment doesn't support build automation, such as: dependency restores (such as NuGet, NPM, PIP, and Composer automations), compilation of .NET binaries, generation of web.config (here is a Node.js example).
You may generate these necessary files manually on your local machine, and then deploy them together with your app.
Additionally, App Service deploys files to the wwwroot folder. It never directly restarts your app.
You may verify if the deployment files are in root folder. A deployment issue is an issue that causes the wrong set of files to get deployed to your site folder (typically d:\home\site\wwwroot). Deployment-vs-runtime-issues

FTP'ing a Suave app to Azure

Having never used Azure before I'm attempting to deploy a simple F# Suave app to Azure using FTP. Ultimately I want to deploy via github but I initially thought FTP'ing it would be the easy first step. According to https://suave.io/azure-app-service.html it should be straight forward.
These are the steps I followed
Created a new web app in Azure including a resource group
and app service plan. All on the Free Tier.
Downloaded the publishsettings XML file that Azure created.
Cloned this repo: https://github.com/isaacabraham/fsharp-demonstrator
Used FileZilla to connect via FTP using the creds
from step 2.
Uploaded the files (via FTP) from
fsharp-demonstrator/src/SuaveHost (which includes the necessary web.config file) from the repo cloned at step 3 to
the site\wwwroot on Azure.
Navigated to Azure site url.
Then I receive the error:
The specified CGI application encountered an error and the server terminated the process.
(When I look at the folders on Azure under site\wwwroot I don't see any obj or bin folders. I don't think any msbuild process occurred. That doesn't seem right.)
Anybody got any idea what the problem is?
I suspect the issue is that when you deploy via FTP, then Azure does not automatically run the deploy script specified in the .deployment file.
The build.fsx script uses Kudu service to deploy the built files, so it might be easier to just use Github deployment rather than FTP - this way, Azure will do the deployment for you.
If you want to deploy via FTP, you'll need to build the project locally and upload the output. I'm not sure how to best do this with Isaac's Kudu-based demo though (ultimately, you need web.config that points to your built executable like this)

Deploying Single Page app from appveyor to azure

I'm trying to figure out how to continuously deploy a single page application from appveyor to an azure website. I'm in a bit of a bind because I don't have access to the azure directly, so I'm trying to figure out as many details before contacting the admin, but the appveyor/azure documentation is leaving me with some questions.
My Goals:
Deploy a static site after it's built or trigger azure to do a deployment after a successful build. The app is written in typescript with angular and a bunch of other dependencies that get compiled and bundled into a static site.
I do not want the end user to ever know a deployment is taking place, so any incremental copying to a live environment is out.
I do not want to check in derived files or builds into the repo.
I currently have a build system that bundles the static site it in a zip archive. So my questions are:
Will using the WebDeploy provider meet my goals? Will there be any downtime during deployments if I deploy the zip archive as an artifact?
Is there another approach that would work better?
Is there a way to do this with azure automated deployments? For example, trigger azure to deploy after a successful build. If so, can kudu handle cloning a private submodule as part of the deployment process. I saw that they have submodule support, but I couldn't figure out from the docs if there would be any authentication issues with private submodules.
FYI, the build system is 100% NodeJS driven and independent of the windows ecosystem.
AppVeyor will will automatically deploy to an Azure website. Use the website below to setup your deployment.
http://www.appveyor.com/docs/deployment/web-deploy
Users are going to notice the change if the static files are not cached in their browsers or if they do a hard reload. Regardless of the implementation method, It is advisable to use a CDN (content delivery network). Connect the CDN endpoints to your app service and have the DNS point to the CDN instead of app service. The CDN will serve the static files to the end user instead of the app service itself. The CDN caches the last deployed files and continues serving them to end user until you purge them. Hence, you can keep deploying to your app service and the end user doesn't get affected by your deployments at all since they are accessing your site via CDN instead of app service. Once you have a stable deployment, you can purge your CDN and the latest code will be cached to the CDN again from your app service.
To answer your question about deploying the code, Regardless of the CI/CD system you use, FTP deployment from azure CLI can be one of the methods. Click here for details. However, WebDeploy is the most standard methods of all when you deploy to an app service.

Uploading files to openshift without using git?

I'm currently using github.com to push and deploy my files. One of these files contains a username and password for an API on a website. Is there a way to upload files to openshift without publicly exposing saved authentication credentials on github? To be more specific, I have a config.js file that has a username and a password and I don't want that to be stored on github, but used on openshift. Do I need to make a database instead?
Is there a better way to deploy node.js apps? I don't have money to spend.
I use winscp to log into my app. Using winscp I then copy my config.ini file which contains my secret stuff than I don't want on github to the Openshift data directory. From there my app just loads that file and retrieves the necessary information.

GitHub deployment to Azure not working

I'm deploying to Azure sites using GitHub, but for some reason I'm not seeing any files insidre the wwwroot folder. It seems like the deployment is not going thur. I do see the files inside the repository folder.
You don't specify what you have done in setting up the deployment. However, the following is what has worked for me:
Set the Azure Website for Git Deployment via the following instructions:
http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-git/
Create a GitHub repository
Initialize your local working folder in Git. Push to the repo. By the sounds of things, you have done this.
Then you need to make sure you link your Azure Website with your GitHub repo. In the Portal, go to the 'Deployments' section of your Azure Website and click:
If you are logged into GitHub in the same browser it will quickly ask you to specify the correct repository and that'll be it.
This is the step I suspect you either may not have done completely, or perhaps you have selected the wrong repository.
Once it is hooked up, Azure will pull and deploy each time you push a commit to the master branch in the repository.

Resources