Here you go. Because the range you are sorting includes blank rows, you have to find the actual last row with data and only sort those. The downside of this approach is it stops at the first blank row, so you can't have any blank rows within the data.
function SortbyCustomerName() {
var ss = SpreadsheetApp.getActive();
var sheet = ss.getSheetByName('Master');
//get the rows with data (stops at first blank row)
//returns e.g., "A7:A44". We want the "44".
var rows = sheet.getRange("A7").getDataRegion(SpreadsheetApp.Dimension.ROWS).getA1Notation().toString();
//parse the result to get the last row number
var lastRow = rows.slice(rows.indexOf(":") +2)
//add the ending row number to the sort range
sheet.getRange('A7:az' + lastRow).activate().sort({column: 1, ascending: true});
};