Question: I created the aks cluster with azure service principal id and i provided the contributer role according to the subscription and resource group.

For each and every time when i executed the pipeline the sign-in is asking and after i authenticated it is getting the data.

Also the "kubectl get" task is taking more than 30 min and is getting "Kubectl Server Version: Could not find kubectl server version"

*To sign in, use a web browser to open the page <https://microsoft.com/devicelogin> and enter the code CRA2XssWEXUUA to authenticate*

Thanks in advance

[![enter image description here](https://i.stack.imgur.com/wxXk9.png)](https://i.stack.imgur.com/wxXk9.png)

Answer: 
The easiest solution may be to flatten the different split characters to a single one:

```py
with open("example.dat", "r") as fh:
    lines = []
    for line in fh:
        lines.append( line.strip().replace("[", ",").replace("]", ",").split(",") )

```
You can use named groups in regular expression to more properly extract the information (read more here: <https://www.regular-expressions.info/refext.html>):

```
import re

pat = r"(?P<city>[^,]*), (?P<state>[\w\W]*)\[(?P<lat>\d+),(?P<lon>\d+)\](?P<pop>\d+)"
pat = re.compile(pat, re.VERBOSE)

city = match.group("city")
state = match.group("state")
lat = float(match.group("lat"))
lon = float(match.group("lon"))
population = int(match.group("pop"))

line = [city, state, lat, lon, population)
# => ['New York City', ' NY', 40.0, 74.0, 11000000]

```