Open parag0 opened 4 years ago
Looking at the error it seems like a permission error. Could you check if you are setting the correct az cli credentials? You can do that either with az account set
command or using RBACs.
https://www.serverless.com/framework/docs/providers/azure/guide/credentials/
We have multiple function apps reusing resources (storage account, apims, etc) in the same resource group and it is working for us. You just need to pass the same exact name for the resources and it will reuse them. Example config for that
provider:
name: azure
runtime: nodejs10.x
tenantId: ${self:custom.config.tenantId}
os: linux
resourceGroup: ${opt:rg, self:custom.config.resourceGroup}
region: ${opt:region, 'East US 2'}
stage: ${opt:stage, 'dev'}
subscriptionId: ${self:custom.config.subscriptionId}
type: premium
appServicePlan:
name: ${self:custom.config.servicePlanName}
sku:
tier: ElasticPremium
name: EP1
appInsights:
name: ${self:custom.config.appInsightsName}
functionApp:
name: ${self:custom.config.functionAppName}
storageAccount:
name: ${self:custom.config.storageName}
Thanks. I had the same issue and found this very helpful. I was unable to find this information within the Serverless online documentation. Not sure if I missed it, but is there documentation available for ALL Azure yml properties? This link does not appear to be up to date:
https://www.serverless.com/framework/docs/providers/azure/guide/serverless.yml/
Thanks.
Yeah the maintainers would need to open a PR to the serverless documentation to update it. They have config documentation here: https://github.com/serverless/serverless-azure-functions/blob/master/docs/CONFIG.md
Also, I find it useful to look at the typescript definition for the config here: https://github.com/serverless/serverless-azure-functions/blob/master/src/models/serverless.ts#L36
Thank you for sharing and taking the time to respond. I am just starting to dive into this framework and after deploying, some of the initial feedback I received was related to the generated resource names, which my team did not care for. So, this helps a lot!
Hi @Rapol , here you are using the existing storage account and app insight?
Actually while I am using the existing storage account, getting below error. could you help?
Conflict - { "error": { "code": "StorageAccountAlreadyExists", "message": "The storage account named mdsptestconn already exists under the subscription." } }
Any update on this?
Hi,
I was trying to deploy my Azure function on a App Service which is already created. At the time of deployment
sls
is trying to create new resource group for which I don't have access.I have tried to use following gist in serverless.yml
And here is the output of
sls deploy
Is there any way to set resource group in serverless cli which can be used while deploying the functions?