I have written a JSON script MyContainer.json, using Resource Manager Template to deploy a container.
The specified Registry credentials in the script as given below.
"imageRegistryCredentials": [
{
"server": "myregistry.azurecr.io",
"username": "myaccount@mytenant.onmicrosoft.com",
"password": "XYZ"
}
We wrote this JSON script as specified in the link https://docs.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files
We have also disabled the access key for the Azure registry for admin user as shown in the image RegDisAccKey.png

We deploy this JSON file to create the container with the given below command.
az deployment group create --resource-group MyResource --template-file MyContainer.json --debug
I am getting the following below error, as AutherizationFailed.
cli.azure.cli.core.util : Azure Error: AuthorizationFailed
Message: The client 'myaccount@mytenant.onmicrosoft.com' with object id 'b13d6d27-0359-4ba3-88b1-5c1c5a4ff6bb' does not have authorization to perform action 'Microsoft.Resources/deployments/validate/action' over scope '/subscriptions/ABCD-EFGH-IJKL/resourcegroups/MyResource/providers/Microsoft.Resources/deployments/MyContainer' or the scope is invalid. If access was recently granted, please refresh your credentials.
Azure Error: AuthorizationFailed
Message: The client 'myaccount@mytenant.onmicrosoft.com' with object id 'b13d6d27-0359-4ba3-88b1-5c1c5a4ff6bb' does not have authorization to perform action 'Microsoft.Resources/deployments/validate/action' over scope '/subscriptions/ABCD-EFGH-IJKL/resourcegroups/MyResource/providers/Microsoft.Resources/deployments/MyContainer' or the scope is invalid. If access was recently granted, please refresh your credentials.
I have also attached the complete debug error of the failure in azdeperr.txt
How do I create a container using RMT without specifying the Access Key of the Admin User and just be using my Azure login credentials? Is there any special authorization I need in order to successfully run and deply the container?

