Hello again,
This authentication flow was the proper one to use, at least in my case. All the tutorials that I followed were correct, it was just that I did not properly write the yml file, where the actual authentication data is extracted.
Here are the edited yml configurations that fixed my problem:
service.yml:
apiVersion: v1
kind: Service
metadata:
name: identityapi-service
spec:
type: LoadBalancer
selector:
app: aadtest1
ports:
- protocol: TCP
port: 81 # External port
targetPort: 5268 # Internal container port
deployment.yml:
apiVersion: v1
kind: Pod
metadata:
name: aadtest1
labels:
aadpodidbinding: sqlaad
spec:
containers:
- name: identityapi-container
image: bluetoothspeakerstore.azurecr.io/identityapi:BSS
imagePullPolicy: Always
ports:
- containerPort: 5268
env:
- name: SERVER_NAME
value: bss-previewdb.database.windows.net
- name: DATABASE_NAME
value: BSS-Db
imagePullSecrets:
- name: arhsbulgaria
aadpodidentity.yml:
apiVersion: "aadpodidentity.k8s.io/v1"
kind: AzureIdentity
metadata:
name: sqlaad1
spec:
type: 0
resourceID: myResourceId
clientID: myClientId
aadpodidentitybinding.yml:
apiVersion: "aadpodidentity.k8s.io/v1"
kind: AzureIdentityBinding
metadata:
name: sqlaadbinding1
spec:
azureIdentity: sqlaad1
selector: sqlaad
Basically the main issue was in my deployment.yml file where it needed to be specified as "Pod" and not deployment.
I am very thankful to the creator of this blog: