Accessing Azure Web App with FTP

Login to azure portal
https://portal.azure.com/

Goto your web app

Select the tab “Deployment credentials” and set username and password to be used for FTP access. (remember to save).

Goto the “Overview” tab (the top tab)
In the right column you find:

Notice that the user name will be [web app name]\[my username]
That should be all you need to access the web app with ftp or ftps.

 

Import existing EPiServer users into an empty database – EPiServer 7.5

Here is a short guide for importing users from an existing EPiServer site into an empty EPiServer site. And then setup the default user groups and access rights. This is for EPiServer 7.5 using the standard Sql Membership but will probably work fine with newer EPiServer versions as well.

Create empty db

Run deployment center as administrator -> select create Sql db.

Importing users from old/other db:

How to copy table data, see this guide: https://www.sqlshack.com/how-to-copy-tables-from-one-database-to-another-in-sql-server/
The tables are named like: aspnet_Applications

Marked in bold are the tables that was used by my EPiServer 7.5 installation (the other tables where just empty). This is the order used, (see the link above), making sure the Users table is uploaded early on is important.

1. Application
2. Users
3.Membership
4.Paths
5.PersonalizationAllUsers
6.PersonalizationPerUser
7.Profile
8.Roles
9.Events
10.UsersInRoles (watch out for FK constraints to Users and Roles)
11.SchemaVersions (identical between same EPiServer db versions)

Create users and roles from scratch

Override the access protection to EPiServer admin until valid admin user and user groups are created:

Find location elements in web.config and comment out:

<location path="epi">

Comment out the <authorization> element entirely (removes the access protection). The same for location:

<location path="epi/CMS/admin">

Goto http://mysite.local/epi/CMS/Admin/Default.aspx or similar for epi admin area.

Create new roles in admin: (these are EPiServer defaults)
WebEditors
WebAdmins

Add your admin user  to WebEditors and WebAdmins group.

Goto admin “Set access rights”

Set correct access rights for editors and admin groups.
Check lower checkbox to make descendant content inherit the rights.
Also “Everyone” group should have Read access on root and downwards.

Set this in web.config:

<siteSettings pageRootId="1" pageStartId="1"

PagestartId should be root id.

Uncomment the authorization for /epi and /epi/cms/admin (enable the authorization again).

Login with you admin user
Create a start page or import an episerver export xml file.
Run  [mysite.local]/epi/CMS/Admin/IndexContent.aspx to update search index if imported content.

Goto site settings in admin and point out the page as start page. And/or set in web.config

<siteSettings pageRootId="1" pageStartId="4"

(usually becomes 4)

Goto site settings in admin and point out the all site hosts (dev, test, prod etc).
Add more users such as editors and adminstrators that need access to site.

Batch convert a folder of images from png to jpg

I had a bunch of png images in several subfolders which I wanted to convert into jpg.

I used the command line tool ImageMagick for Windows, which is free and can be downloaded here:
Download @ ImageMagick

This command will convert all images in the folder and its subfolders from png to jpg with quality 65. The converted files will get the same filename but with jpg extension:

for /R %f in (*.png) do ( convert -quality 65 "%f" "%~npf.jpg" )

convert is the ImageMagick command running, for /R is used for looping recursively.

Use this command when done to remove all the source png files:

del *.png /s

This will delete all png files in this folder and all subfolders.

How do I wrap a selection with an HTML tag in Visual Studio? – Stack Overflow

A very usable keyboard shortcut when working with html in Visual Studio.

Visual Studio 2015 comes with a new shortcut, Shift+Alt+W wraps the current selection with a div. This shortcut leaves the text “div” selected, making it seamlessly changeable to any desired tag. This coupled with the automatic end tag replacement makes for a quick solution. UPDATE This shortcut is available in Visual Studio 2017 as well, but you must have the “ASP.NET and Web Development” workload installed. Example Shift+Alt+W > p > Enter

Source: How do I wrap a selection with an HTML tag in Visual Studio? – Stack Overflow

Where do I find the Azure Website Deployment password

If you are using azure deployment profiles for Visual Studio you can find the deployment password here:

Login to portal, select the web app service, click the link “Get publish profile” to download. Open the xml file and find the password in element publishProfile attribute userPWD.

Source: Where do I get my actual Azure Website Deployment password? – Stack Overflow

Copying files larger than 2 GB over RDP

Symptoms

When you try to copy a file larger than 2 GB over a Remote Desktop Services or a Terminal Services session through Clipboard redirection (copy and paste) by using RDP client 6.0 or a later version, the file isn’t copied. And you don’t receive an error message.

Cause

It’s a known issue. Copying files larger than 2 GB by using this method isn’t supported.

Resolution

To resolve this issue, use one of the following methods:

  • Use Drive Redirection through Remote Desktop Services or a Terminal Services session if you want to transfer files larger than 2 GB.
  • Use command-line alternatives to copy files larger than 2 GB over a Remote Desktop Services or Terminal Services session. For example, use the following command:
    Console:

    xcopy \\tsclient\c\myfiles\LargeFile d:\temp  

Source: Copying files larger than 2 GB over a Remote Desktop Services or Terminal Services session by using Clipboard Redirection (copy and paste) fails silently