Azure / Azure/azure-cli-extensions

[functionapp] Can't use Azure CLI to Create a Function App from Within the same Script that the Storage Account was Created In

Open
#10,029 2 comments 1 reaction 2 assignees Claimed by @a0x1ab View on GitHub
Auto-Assign Functions Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

Source: https://github.com/Azure/azure-cli/issues/32019 (by @nlaymon1980)
Affected extension: `functionapp` (`src/functionapp/`)

---

<<>>
# Issue #32019 (by @nlaymon1980)
## Title
Can't use Azure CLI to Create a Function App from Within the same Script that the Storage Account was Created In

## Body
### Describe the bug

Azure cli is failing to create a function app using an EP1 App Service Plan from within the same script that creates the associated storage account. We are receiving the following error

ERROR: Creation of storage file share failed with: 'The remote server returned an error: (403) Forbidden.'. Please check if the storage account is accessible.

We have verified that the network rules of the storage account allow the VNet of the App Service Plan and the Cloud Shell IP Address.

The only workaround found was to save the networking rules of the storage account from the Azure Portal after the storage account was created and before the function app create command.

Microsoft Case #2506050040013371 was opened for this issue.

### Related command

az functionapp create -n xxx-functionapp-qa -g xxx-qa --plan xxx-fa1-l-qa --app-insights xxx-fa-qa-appinsights --storage-account xxxqa --functions-version 4 --runtime python --runtime-version 3.11 --vnet xxx-vnet-qa --subnet subnet-fa1 --https-only true --only-show-errors

### Errors

ERROR: Creation of storage file share failed with: 'The remote server returned an error: (403) Forbidden.'. Please check if the storage account is accessible.

### Issue script & Debug output

ERROR: Creation of storage file share failed with: 'The remote server returned an error: (403) Forbidden.'. Please check if the storage account is accessible.

### Expected behavior

Function App should be created as well as the File Share in the storage account.

### Environment Summary

azure-cli 2.76.0

core 2.76.0
telemetry 1.1.0

Extensions:
application-insights 1.2.3
ml 2.38.0
ssh 2.0.6

Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0

Extensions system directory '/usr/lib/python3.12/site-packages/azure-cli-extensions'

Python (Linux) 3.12.9 (main, Jul 29 2025, 01:30:13) [GCC 13.2.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

### Additional context

Microsoft Case #2506050040013371 was opened for this issue.

## Comments
### Comment by @yonzhan

Thank you for opening this issue, we will look into it.

### Comment by @microsoft-github-policy-service[bot]
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AnatoliB, @Francisco-Gamino, @shreyabatra4.

<<>>

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.