Passing a macro to an environment option (TikZ/pgfplots)

You can force expansion via:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{calc}

\usepackage{pgfplots} 


\begin{document}

    %The figure I want to obtain (but without giving "A1,A2,A3" explicitly)
    \begin{tikzpicture}
    \begin{axis}[
    xmin=0,xmax=10,
    ymin=0,ymax=4,
    xtick={1,4,7},
    xticklabels={A1,A2,A3},
    ytick=\empty
    ]

    \addplot+[domain=0:10,samples=100,no markers]{sqrt(x)};

    \end{axis}

    \end{tikzpicture}

    % This fails to do what I want, as the commas are not understood as value separators
    \begin{tikzpicture}
    \newcommand{\tiklist}{A1,A2,B}
    \edef\tmp{\noexpand\begin{axis}[
    xmin=0,xmax=10,
    ymin=0,ymax=4,
    xtick={1,4,7},
    xticklabels={\tiklist},
    ytick=\empty
    ]}\tmp

    \addplot+[domain=0:10,samples=100,no markers]{sqrt(x)};

    \end{axis}

    \end{tikzpicture}

\end{document}

You can force expansion via the .expanded handler of pgfkeys (section 82.4.6 "Expanded and Multiple Values", p. 890, pgfmanual, v3.0.1a).

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{pgfplots} 

\begin{document}

    \begin{tikzpicture}
    \newcommand{\tiklist}{A1,A2,B}
    \begin{axis}[
    xmin=0,xmax=10,
    ymin=0,ymax=4,
    xtick={1,4,7},
    xticklabels/.expanded=\tiklist,
    ytick=\empty
    ]

    \addplot+[domain=0:10,samples=100,no markers]{sqrt(x)};

    \end{axis}

    \end{tikzpicture}

\end{document}