I'm trying to deploy Azure Functions in already created App Service in Azure portal.
Using sls deploy
CLI for deploying my Azure function, but while deploying the functions sls
is trying to create new resource group for which I don't have access.
Following is the output of sls deploy
command:
$ sls deploy
Serverless: Removing .serverless directory
Serverless: Parsing Azure Functions Bindings.json...
Serverless: Building binding for function: admin event: httpTrigger
Serverless: Parsing Azure Functions Bindings.json...
Serverless: Building binding for function: image event: httpTrigger
Serverless: Parsing Azure Functions Bindings.json...
Serverless: Building binding for function: report event: httpTrigger
Serverless: Parsing Azure Functions Bindings.json...
Serverless: Building binding for function: gaims event: httpTrigger
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Logging into Azure
Serverless: Using subscription ID: <SUBSCRIPTION_ID>
Serverless: Creating resource group: <ALREADY_CREATED_RESOURCE_GROUP_NAME>
Error --------------------------------------------------
Error: The client '<USER_NAME>' with object id '<OBJECT_ID>' does not have authorization to perform action
'Microsoft.Resources/subscriptions/resourcegroups/write' over scope
'/subscriptions/SUBSCRIPTION_ID/resourcegroups/ALREADY_CREATED_RESOURCE_GROUP_NAME' or the scope is invalid.
If access was recently granted, please refresh your credentials.
at new RestError (C:\Users\analysis-node\node_modules\@azure\ms-rest-js\lib\restError.ts:18:5)
at C:\Users\analysis-node\node_modules\@azure\ms-rest-js\lib\policies\deserializationPolicy.ts:117:27
at process._tickCallback (internal/process/next_tick.js:68:7)
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: win32
Node Version: 10.20.1
Framework Version: 1.71.1
Plugin Version: 3.6.12
SDK Version: 2.3.0
Components Version: 2.30.11
In serverless.yml
, I've also specified the resourceGroup
parameter. Here is the gist of serverless.yml
provider:
stage: dev
name: azure
region: East US 2
runtime: nodejs10.x
resourceGroup: <ALREADY_CREATED_RESOURCE_GROUP_NAME>
subscriptionId: <SUBSCRIPTION_ID>
Is there any way to set resource group in serverless
cli which can be used while deploying the functions?