<p>My AKS cluster and storage account are in the same Region: East US 2.
I have created secret:
<code>kubectl create secret generic fa-fileshare-secret --from-literal=azurestorageaccountname=fastorage --from-literal=azurestorageaccountkey='OWd7e9Ug' secret/fa-fileshare-secret created</code></p>
<p>In that storage account I have file share: <code>containershare</code></p>
<p>I have checked in the Configuration of the secret and values are being matched for account name and key (as this is stated in similar questions which did not help me).
I think VNET for storage account and AKS cluster are different, and also Subscription and Resource group are different (if relevant.)</p>
<p>When I try to execute deployment for my app, I am getting:</p>
<pre><code> Mounting arguments: -t cifs -o actimeo=30,mfsymlinks,file_mode=0777,dir_mode=0777,
&lt;masked&gt; //fastorage.file.core.windows.net/containershare
/var/lib/kubelet/plugins/kubernetes.io/csi/pv/#fa-fileshare-secret#containershare#ads-volume#default/globalmount
 Output: mount error(13): Permission denied
</code></pre>
<p>In <code>deployment.yaml</code> definition:</p>
<pre><code>........
      volumes:
      - name: ads-volume
        azureFile:
          secretName: fa-fileshare-secret
          shareName: containershare
          readOnly: false
............
</code></pre>
<p>What can be the problem (since different region and wrong credentials are not the issue). I am accessing the cluster through the kubectl from remote windows machine.</p>

<p>Thank You <a href="https://stackoverflow.com/users/12990185/andreys">AndreyS</a> for confirming you resolve your issue. Here is few more additional details that can help to know cause of your issue.</p>
<p>As Per Microsoft <a href="https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/fail-to-mount-azure-file-share#akssubnetnotallowed" rel="nofollow noreferrer">Document</a> here is the possible cause for this error <strong><code>Mount error(13): Permission denied</code></strong></p>
<blockquote>
<ul>
<li><a href="https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/fail-to-mount-azure-file-share#secretnotusecorrectstorageaccountkey" rel="nofollow noreferrer">Cause 1: Kubernetes secret doesn't reference the correct storage account name or
key</a></li>
<li><a href="https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/fail-to-mount-azure-file-share#akssubnetnotallowed" rel="nofollow noreferrer">Cause 2: AKS's VNET and subnet aren't allowed for the storage account</a></li>
<li><a href="https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/fail-to-mount-azure-file-share#aksnotawareprivateipaddress" rel="nofollow noreferrer">Cause 3: Connectivity is via a private link but nodes and the private endpoint are in different
VNETs</a></li>
</ul>
</blockquote>
<p>For mounting the storage file share with AKS Cluster(Pod) you should deploy both the resource in same resource group and same region and also to make sure to both resource in same VNET if not then you have to allow access to your AKS VNET in Storage is set to Selected networks, check if the VNET and subnet of the AKS cluster are added.</p>
<p><a href="https://i.stack.imgur.com/ubEdj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ubEdj.png" alt="enter image description here" /></a></p>
<p>It may take a few moments for the changes to take effect. After the VNET and subnet are added, check if the pod status changes from ContainerCreating to Running and mounted the File share as well.</p>
